beats icon indicating copy to clipboard operation
beats copied to clipboard

x-pack/filebeat/input/httpjson: share oauth2 clients where possible

Open efd6 opened this issue 6 months ago • 3 comments

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.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

  • Closes #34834

Use cases

Screenshots

Logs

efd6 avatar Jun 24 '25 04:06 efd6

:robot: GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

github-actions[bot] avatar Jun 24 '25 04:06 github-actions[bot]

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

elasticmachine avatar Jun 24 '25 05:06 elasticmachine

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

mergify[bot] avatar Jun 24 '25 22:06 mergify[bot]

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

mergify[bot] avatar Jul 01 '25 10:07 mergify[bot]

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

mergify[bot] avatar Jul 03 '25 07:07 mergify[bot]

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

mergify[bot] avatar Jul 03 '25 09:07 mergify[bot]

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

mergify[bot] avatar Jul 10 '25 03:07 mergify[bot]

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

mergify[bot] avatar Jul 15 '25 20:07 mergify[bot]