x-pack/filebeat/input/httpjson: share oauth2 clients where possible
Proposed commit message
x-pack/filebeat/input/httpjson: share oauth2 clients where possible
The httpjson input makes new http.Client values for every chain step.
This is inefficient for a variety of reasons, but the configuration API
that we expose makes the general fix for this non-trivial. It is,
however, possible to fix the OAuth2 behaviour that arises from this
where root parent steps in a chain make use of OAuth2 and so do its
children, but the children needlessly request tokens because they do
not have access to the oauth2.Transports token cache. The fix here is
to retain the prepared OAuth2 client in the relevant config and use
that if it is non-nil. This does not fix the case that a non-root
parent shares OAuth2 authentication with its children, but this is
likely to be uncommon.
Checklist
- [ ] My code follows the style guidelines of this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have made corresponding change to the default configuration files
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added an entry in
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.
Disruptive User Impact
Author's Checklist
- [ ]
How to test this PR locally
Related issues
- Closes #34834
Use cases
Screenshots
Logs
:robot: GitHub comments
Expand to view the GitHub comments
Just comment with:
rundocs-build: Re-trigger the docs validation. (use unformatted text in the comment!)
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)
This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/
git fetch upstream
git checkout -b 34834-httpjson upstream/34834-httpjson
git merge upstream/main
git push upstream 34834-httpjson
This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/
git fetch upstream
git checkout -b 34834-httpjson upstream/34834-httpjson
git merge upstream/main
git push upstream 34834-httpjson
This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/
git fetch upstream
git checkout -b 34834-httpjson upstream/34834-httpjson
git merge upstream/main
git push upstream 34834-httpjson
This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/
git fetch upstream
git checkout -b 34834-httpjson upstream/34834-httpjson
git merge upstream/main
git push upstream 34834-httpjson
This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/
git fetch upstream
git checkout -b 34834-httpjson upstream/34834-httpjson
git merge upstream/main
git push upstream 34834-httpjson
This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/
git fetch upstream
git checkout -b 34834-httpjson upstream/34834-httpjson
git merge upstream/main
git push upstream 34834-httpjson