fmorg-git commented on code in PR #11413:
URL: https://github.com/apache/ozone/pull/11413#discussion_r4201476701


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectAttributesHandler.java:
##########
@@ -124,6 +124,9 @@ Response handleGetRequest(ObjectRequestContext context, 
String keyPath)
       OzoneKey key;
       NavigableMap<Integer, Long> completedPartSizes = null;
       try {
+        // AWS requires the credentials to support both s3:GetObject and 
s3:GetObjectAttributes actions. The
+        // main metadata request runs with GetObjectAttributes; perform the 
dependent GetObject check first.
+        requireS3ActionString("GetObject", () -> 
getClientProtocol().headS3Object(bucketName, keyPath));

Review Comment:
   updated - ba56e04886b122adbafef6fb6d045ecb01831655



##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestS3ActionOverrideForOwnerVerification.java:
##########
@@ -109,6 +126,31 @@ public void 
testCopyObjectDoesNotSetActionWhenStsDisabled() throws Exception {
     assertNull(actionAtSourceBucketOwnerLookup.get());
   }
 
+  @ParameterizedTest
+  @ValueSource(strings = {"ETag", "ObjectParts"})
+  public void testGetObjectAttributesRequiresBothIamActions(String attribute) 
throws Exception {

Review Comment:
   updated - ba56e04886b122adbafef6fb6d045ecb01831655



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to