-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactors ClientHelper to combine header logic #30620
Conversation
Pinging @elastic/es-security |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTMToo :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
You could remove Watcher.HEADER_FILTERS
and replace with the ClientHelper ones, or I can do that as a follow up.
This change removes all the `*ClientHelper` classes which were repeating logic between plugins and instead adds `ClientHelper.executeWithHeaders()` and `ClientHelper.executeWithHeadersAsync()` methods to centralise the logic for executing requests with stored security headers.
@elasticmachine retest this please |
* Refactors ClientHelper to combine header logic This change removes all the `*ClientHelper` classes which were repeating logic between plugins and instead adds `ClientHelper.executeWithHeaders()` and `ClientHelper.executeWithHeadersAsync()` methods to centralise the logic for executing requests with stored security headers. * Removes Watcher headers constant x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/tran sport/actions/put/TransportPutWatchActionTests.java /Users/colings86/dev/work/git/elasticsearch/.git/worktrees/elasticsearch -6.x/CHERRY_PICK_HEAD x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ClientHelp er.java x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MlClien tHelper.java x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MlMetad ata.java x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafee d/DatafeedUpdate.java x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ClientHelp erTests.java x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/Transpo rtPreviewDatafeedAction.java x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extra ctor/aggregation/AggregationDataExtractor.java x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extra ctor/chunked/ChunkedDataExtractor.java x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extra ctor/scroll/ScrollDataExtractor.java x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extra ctor/scroll/ScrollDataExtractorFactory.java x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlClientHelper Tests.java x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/job/Ro llupClientHelper.java x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/job/Ro llupJobTask.java x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/job/Ro llupClientHelperTests.java x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watc her.java x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watc herClientHelper.java x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/acti ons/index/ExecutableIndexAction.java x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/inpu t/search/ExecutableSearchInput.java x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/tran sform/search/ExecutableSearchTransform.java x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/tran sport/actions/put/TransportPutWatchAction.java x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/Watc herClientHelperTests.java x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/tran sport/actions/put/TransportPutWatchActionTests.java
…ngs-to-true * elastic/master: (34 commits) Test: increase search logging for LicensingTests Adjust serialization version in IndicesOptions [TEST] Fix compilation Remove version argument in RangeFieldType (elastic#30411) Remove unused DirectoryUtils class. (elastic#30582) Mitigate date histogram slowdowns with non-fixed timezones. (elastic#30534) Add a MovingFunction pipeline aggregation, deprecate MovingAvg agg (elastic#29594) Removes AwaitsFix on IndicesOptionsTests Template upgrades should happen in a system context (elastic#30621) Fix bug in BucketMetrics path traversal (elastic#30632) Fixes IndiceOptionsTests to serialise correctly (elastic#30644) S3 repo plugin populate SettingsFilter (elastic#30652) mute IndicesOptionsTests.testSerialization Rest High Level client: Add List Tasks (elastic#29546) Refactors ClientHelper to combine header logic (elastic#30620) [ML] Wait for ML indices in rolling upgrade tests (elastic#30615) Watcher: Ensure secrets integration tests also run triggered watch (elastic#30478) Move allocation awareness attributes to list setting (elastic#30626) [Docs] Update code snippet in has-child-query.asciidoc (elastic#30510) Replace custom reloadable Key/TrustManager (elastic#30509) ...
* Refactors ClientHelper to combine header logic This change removes all the `*ClientHelper` classes which were repeating logic between plugins and instead adds `ClientHelper.executeWithHeaders()` and `ClientHelper.executeWithHeadersAsync()` methods to centralise the logic for executing requests with stored security headers. * Removes Watcher headers constant
@colings86 Can the "backport pending" label be removed now? |
Yes, sorry it got forgotten but thanks very much for catching this @jpountz |
This change removes all the
*ClientHelper
classes which wererepeating logic between plugins and instead adds
ClientHelper.executeWithHeaders()
andClientHelper.executeWithHeadersAsync()
methods to centralise thelogic for executing requests with stored security headers.
I have request reviews from everyone I think this refractor affects and also @jaymode since this is really a security change in essence.