HDDS-15771. [STS] Add s3Action for expected bucket owner condition checks#10688
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses an STS/Ranger authorization edge case for S3 copy-style operations (CopyObject and UploadPartCopy) when x-amz-expected-bucket-owner / x-amz-expected-source-bucket-owner headers are present. It ensures the internal bucket-owner verification lookups execute with a non-empty IAM-style s3Action (specifically GetObject) so Ranger “action-matches” conditions don’t incorrectly deny the request.
Changes:
- Wrap source-bucket owner lookup in CopyObject and UploadPartCopy paths with
runWithS3ActionString("GetObject", ...). - Add a focused unit test validating the
S3Auth.s3Actionvalue at the time of the source-bucket owner lookup for both CopyObject and UploadPartCopy.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java | Ensures source bucket owner lookup for copy-style operations runs under GetObject action string via runWithS3ActionString. |
| hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestS3ActionOverrideForOwnerVerification.java | Adds unit coverage to assert GetObject is set during source-bucket owner lookup in CopyObject and UploadPartCopy flows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
Merged. Thanks @fmorg-git |
Contributor
Author
|
Thanks for the review and merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please describe your PR in detail:
This PR ensures that the bucket owner verification condition checks are have s3 action associated with them so that the Ranger authorization checks will pass.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15771
How was this patch tested?
unit tests and smoke tests