-
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
Fix verbose get data stream API not requiring extra privileges #112973
Conversation
When a user uses the `GET /_data_stream?verbose` API to retrieve the verbose version of the response (which includes the `maximum_timestamp`, as added in elastic#112303), the response object should be performed with the same privilege-checking as the get-data-stream API, meaning that no extra priveleges should be required return the field. This commit makes the Transport action use an entitled client so that extra privileges are not required, and adds a test to ensure that it works.
Pinging @elastic/es-data-management (Team:Data Management) |
Hi @dakrone, I've created a changelog YAML for you. |
@@ -90,7 +91,7 @@ public TransportGetDataStreamsAction( | |||
this.systemIndices = systemIndices; | |||
this.globalRetentionSettings = globalRetentionSettings; | |||
clusterSettings = clusterService.getClusterSettings(); | |||
this.client = client; | |||
this.client = new OriginSettingClient(client, "stack"); |
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.
For anyone confused in the future like I was, "stack" is the value of ClientHelper.STACK_ORIGIN, which is in x-pack so can't be pulled in here. This gets used in org.elasticsearch.xpack.security.authz.AuthorizationUtils.switchUserBasedOnActionOriginAndExecute().
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
…ic#112973) * Fix verbose get data stream API not requiring extra privileges When a user uses the `GET /_data_stream?verbose` API to retrieve the verbose version of the response (which includes the `maximum_timestamp`, as added in elastic#112303), the response object should be performed with the same privilege-checking as the get-data-stream API, meaning that no extra priveleges should be required return the field. This commit makes the Transport action use an entitled client so that extra privileges are not required, and adds a test to ensure that it works. * Update docs/changelog/112973.yaml
💚 Backport successful
|
…) (#113035) * Fix verbose get data stream API not requiring extra privileges When a user uses the `GET /_data_stream?verbose` API to retrieve the verbose version of the response (which includes the `maximum_timestamp`, as added in #112303), the response object should be performed with the same privilege-checking as the get-data-stream API, meaning that no extra priveleges should be required return the field. This commit makes the Transport action use an entitled client so that extra privileges are not required, and adds a test to ensure that it works. * Update docs/changelog/112973.yaml Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…ic#112973) * Fix verbose get data stream API not requiring extra privileges When a user uses the `GET /_data_stream?verbose` API to retrieve the verbose version of the response (which includes the `maximum_timestamp`, as added in elastic#112303), the response object should be performed with the same privilege-checking as the get-data-stream API, meaning that no extra priveleges should be required return the field. This commit makes the Transport action use an entitled client so that extra privileges are not required, and adds a test to ensure that it works. * Update docs/changelog/112973.yaml
When a user uses the
GET /_data_stream?verbose
API to retrieve the verbose version of the response (which includes themaximum_timestamp
, as added in #112303), the response object should be performed with the same privilege-checking as the get-data-stream API, meaning that no extra priveleges should be required return the field.This commit makes the Transport action use an entitled client so that extra privileges are not required, and adds a test to ensure that it works.