This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new efe0c7eba15 HDDS-17054. Allow S3 actions to be sent even if STS is not 
enabled (#11787)
efe0c7eba15 is described below

commit efe0c7eba1527530d1001f6517b733576fdc6d61
Author: fmorg-git <[email protected]>
AuthorDate: Wed Oct 28 11:31:20 2026 -0700

    HDDS-17054. Allow S3 actions to be sent even if STS is not enabled (#11787)
    
    Co-authored-by: Cursor <[email protected]>
---
 .../src/main/proto/OmClientProtocol.proto          |  2 +-
 .../apache/hadoop/ozone/om/OmMetadataReader.java   | 17 ++---
 .../hadoop/ozone/om/TestOMMetadataReader.java      | 59 +++++++++++----
 .../hadoop/ozone/s3/endpoint/EndpointBase.java     | 17 ++---
 .../TestS3ActionOverrideForOwnerVerification.java  | 84 ++++++----------------
 5 files changed, 80 insertions(+), 99 deletions(-)

diff --git 
a/hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto 
b/hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto
index 88397725397..bf29a6b6846 100644
--- a/hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto
+++ b/hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto
@@ -2523,7 +2523,7 @@ message S3Authentication {
     optional string resolvedStsTempAccessKeyId = 8;
     optional string resolvedStsSecretKeyId = 9;
     // S3 action without the s3: prefix for this request (e.g. GetObject), set 
by S3 Gateway for use
-    // in finer-grained STS permissions.
+    // in S3 action-based authorization (STS session policies and authorizers 
such as Ranger).
     optional string s3Action = 10;
     // Resolved so GetCallerIdentity can return the assumed-role identity from 
the session token.
     optional string resolvedStsAssumedRoleId = 11;
diff --git 
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataReader.java
 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataReader.java
index 276e4304fae..78a33b51cbf 100644
--- 
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataReader.java
+++ 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataReader.java
@@ -786,6 +786,7 @@ public boolean checkAcls(OzoneObj obj, 
RequestContext.Builder contextBuilder,
    * Checks access for the S3 action in the context and then for each S3 
action it depends on (see
    * {@link #DEPENDENT_S3_ACTIONS}), so a single request does not need a 
separate RPC per action.
    * Each {@link IAccessAuthorizer#checkAccess} call carries exactly one S3 
action.
+   * Dependent checks are skipped for the native authorizer because it does 
not evaluate S3 actions.
    *
    * @return true only if access is granted for the S3 action and all of its 
dependent S3 actions.
    */
@@ -795,7 +796,7 @@ private boolean 
checkAccessIncludingDependentS3Actions(OzoneObj obj, RequestCont
       return false;
     }
     final String s3Action = context.getS3Action();
-    if (s3Action == null) {
+    if (s3Action == null || accessAuthorizer.isNative()) {
       return true;
     }
     for (String dependentAction : DEPENDENT_S3_ACTIONS.getOrDefault(s3Action, 
Collections.emptyList())) {
@@ -812,11 +813,16 @@ private boolean 
checkAccessIncludingDependentS3Actions(OzoneObj obj, RequestCont
    * S3 action from {@link S3Authentication} (set on S3 requests). Either or 
both may be absent, in
    * which case the corresponding field is left untouched on the builder.
    * <p>
-   * The S3 action is only propagated when the S3 STS feature flag is enabled, 
since it is only used
-   * for fine-grained STS authorization.
+   * The S3 action is always propagated so that authorizers such as Ranger can 
apply S3 action-based
+   * policies. The session policy is only propagated when the S3 STS feature 
flag is enabled.
    * @param contextBuilder the builder to enrich in-place
    */
   private void maybeAddToContextFromThreadLocal(RequestContext.Builder 
contextBuilder) {
+    final S3Authentication s3Authentication = OzoneManager.getS3Auth();
+    if (s3Authentication != null && s3Authentication.hasS3Action() && 
!s3Authentication.getS3Action().isEmpty()) {
+      contextBuilder.setS3Action(s3Authentication.getS3Action());
+    }
+
     if (!ozoneManager.isS3STSEnabled()) {
       return;
     }
@@ -825,11 +831,6 @@ private void 
maybeAddToContextFromThreadLocal(RequestContext.Builder contextBuil
     if (stsTokenIdentifier != null) {
       contextBuilder.setSessionPolicy(stsTokenIdentifier.getSessionPolicy());
     }
-
-    final S3Authentication s3Authentication = OzoneManager.getS3Auth();
-    if (s3Authentication != null && s3Authentication.hasS3Action() && 
!s3Authentication.getS3Action().isEmpty()) {
-      contextBuilder.setS3Action(s3Authentication.getS3Action());
-    }
   }
 
   static String getClientAddress() {
diff --git 
a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOMMetadataReader.java
 
b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOMMetadataReader.java
index 5ef2d800037..65e20d8a19a 100644
--- 
a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOMMetadataReader.java
+++ 
b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOMMetadataReader.java
@@ -25,6 +25,7 @@
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
@@ -158,15 +159,17 @@ public void testNoSessionPolicyWhenThreadLocalIsNull() 
throws Exception {
     verifySessionPolicyPassedToAuthorizer(accessAuthorizer, obj, null);
   }
 
-  @Test
-  public void testCheckAclsAttachesS3ActionFromThreadLocal() throws Exception {
+  @ParameterizedTest
+  @ValueSource(booleans = {true, false})
+  public void testCheckAclsAttachesS3ActionFromThreadLocal(boolean 
isS3StsEnabled) throws Exception {
     OzoneManager.setS3Auth(S3Authentication.newBuilder()
         .setAccessId(ACCESS_KEY_ID)
         .setS3Action("GetObject")
         .build());
 
     final IAccessAuthorizer accessAuthorizer = 
createMockIAccessAuthorizerReturningTrue();
-    final OmMetadataReader omMetadataReader = 
createMetadataReader(accessAuthorizer);
+    final OmMetadataReader omMetadataReader = createMetadataReader(
+        accessAuthorizer, mock(KeyManager.class), isS3StsEnabled);
 
     final RequestContext.Builder contextWithoutS3ActionBuilder = 
createTestRequestContextBuilder();
     final OzoneObj obj = createTestOzoneObj();
@@ -176,15 +179,17 @@ public void 
testCheckAclsAttachesS3ActionFromThreadLocal() throws Exception {
     verifyS3ActionPassedToAuthorizer(accessAuthorizer, obj, "GetObject");
   }
 
-  @Test
-  public void testCheckAclsAlsoChecksGetObjectForGetObjectAttributes() throws 
Exception {
+  @ParameterizedTest
+  @ValueSource(booleans = {true, false})
+  public void testCheckAclsAlsoChecksGetObjectForGetObjectAttributes(boolean 
isS3StsEnabled) throws Exception {
     OzoneManager.setS3Auth(S3Authentication.newBuilder()
         .setAccessId(ACCESS_KEY_ID)
         .setS3Action("GetObjectAttributes")
         .build());
 
     final IAccessAuthorizer accessAuthorizer = 
createMockIAccessAuthorizerReturningTrue();
-    final OmMetadataReader omMetadataReader = 
createMetadataReader(accessAuthorizer);
+    final OmMetadataReader omMetadataReader = createMetadataReader(
+        accessAuthorizer, mock(KeyManager.class), isS3StsEnabled);
     final OzoneObj obj = createTestOzoneObj();
 
     assertTrue(omMetadataReader.checkAcls(obj, 
createTestRequestContextBuilder(), true));
@@ -233,10 +238,12 @@ public void 
testCheckAclsSkipsDependentActionWhenGetObjectAttributesDenied() thr
   }
 
   @Test
-  public void testCheckAclsDoesNotCheckDependentActionWhenStsFeatureDisabled() 
throws Exception {
+  public void testCheckAclsDoesNotAttachSessionPolicyWhenStsFeatureDisabled() 
throws Exception {
+    setupStsTokenIdentifier();
+
     OzoneManager.setS3Auth(S3Authentication.newBuilder()
         .setAccessId(ACCESS_KEY_ID)
-        .setS3Action("GetObjectAttributes")
+        .setS3Action("PutObject")
         .build());
 
     final IAccessAuthorizer accessAuthorizer = 
createMockIAccessAuthorizerReturningTrue();
@@ -245,23 +252,45 @@ public void 
testCheckAclsDoesNotCheckDependentActionWhenStsFeatureDisabled() thr
 
     assertTrue(omMetadataReader.checkAcls(obj, 
createTestRequestContextBuilder(), true));
 
-    verifyS3ActionPassedToAuthorizer(accessAuthorizer, obj, null);
+    final ArgumentCaptor<RequestContext> captor = 
ArgumentCaptor.forClass(RequestContext.class);
+    verify(accessAuthorizer).checkAccess(eq(obj), captor.capture());
+    assertNull(captor.getValue().getSessionPolicy());
+    assertEquals("PutObject", captor.getValue().getS3Action());
   }
 
-  @Test
-  public void testCheckAclsDoesNotAttachS3ActionWhenStsFeatureDisabled() 
throws Exception {
+  @ParameterizedTest
+  @ValueSource(booleans = {true, false})
+  public void testCheckAclsSkipsDependentActionForNativeAuthorizer(boolean 
isS3StsEnabled) throws Exception {
     OzoneManager.setS3Auth(S3Authentication.newBuilder()
         .setAccessId(ACCESS_KEY_ID)
-        .setS3Action("GetObject")
+        .setS3Action("GetObjectAttributes")
         .build());
 
     final IAccessAuthorizer accessAuthorizer = 
createMockIAccessAuthorizerReturningTrue();
-    final OmMetadataReader omMetadataReader = 
createMetadataReader(accessAuthorizer, mock(KeyManager.class), false);
+    when(accessAuthorizer.isNative()).thenReturn(true);
+    final OmMetadataReader omMetadataReader = createMetadataReader(
+        accessAuthorizer, mock(KeyManager.class), isS3StsEnabled);
+    final OzoneObj obj = createTestOzoneObj();
 
-    final RequestContext.Builder contextWithoutS3ActionBuilder = 
createTestRequestContextBuilder();
+    assertTrue(omMetadataReader.checkAcls(obj, 
createTestRequestContextBuilder(), true));
+
+    verifyS3ActionPassedToAuthorizer(accessAuthorizer, obj, 
"GetObjectAttributes");
+  }
+
+  @ParameterizedTest
+  @ValueSource(booleans = {true, false})
+  public void testCheckAclsLeavesS3ActionUnsetWhenS3ActionEmpty(boolean 
isS3StsEnabled) throws Exception {
+    OzoneManager.setS3Auth(S3Authentication.newBuilder()
+        .setAccessId(ACCESS_KEY_ID)
+        .setS3Action("")
+        .build());
+
+    final IAccessAuthorizer accessAuthorizer = 
createMockIAccessAuthorizerReturningTrue();
+    final OmMetadataReader omMetadataReader = createMetadataReader(
+        accessAuthorizer, mock(KeyManager.class), isS3StsEnabled);
     final OzoneObj obj = createTestOzoneObj();
 
-    assertTrue(omMetadataReader.checkAcls(obj, contextWithoutS3ActionBuilder, 
true));
+    assertTrue(omMetadataReader.checkAcls(obj, 
createTestRequestContextBuilder(), true));
 
     verifyS3ActionPassedToAuthorizer(accessAuthorizer, obj, null);
   }
diff --git 
a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/EndpointBase.java
 
b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/EndpointBase.java
index 91e6d7f519b..e9f7d751899 100644
--- 
a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/EndpointBase.java
+++ 
b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/EndpointBase.java
@@ -24,8 +24,6 @@
 import static 
org.apache.hadoop.ozone.OzoneConfigKeys.HDDS_CONTAINER_RATIS_DATASTREAM_ENABLED_DEFAULT;
 import static 
org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_FS_DATASTREAM_AUTO_THRESHOLD;
 import static 
org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_FS_DATASTREAM_AUTO_THRESHOLD_DEFAULT;
-import static 
org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_S3G_STS_HTTP_ENABLED_DEFAULT;
-import static 
org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_S3G_STS_HTTP_ENABLED_KEY;
 import static org.apache.hadoop.ozone.OzoneConsts.ETAG;
 import static org.apache.hadoop.ozone.OzoneConsts.KB;
 import static 
org.apache.hadoop.ozone.s3.S3GatewayConfigKeys.OZONE_S3G_CLIENT_BUFFER_SIZE_DEFAULT;
@@ -214,7 +212,6 @@ public abstract class EndpointBase {
   private int chunkSize;
   private boolean datastreamEnabled;
   private long datastreamMinLength;
-  private boolean s3StsEnabled;
 
   @Context
   private ContainerRequestContext context;
@@ -279,10 +276,6 @@ public void initialization() {
         OZONE_FS_DATASTREAM_AUTO_THRESHOLD,
         OZONE_FS_DATASTREAM_AUTO_THRESHOLD_DEFAULT, StorageUnit.BYTES);
 
-    s3StsEnabled = getOzoneConfiguration().getBoolean(
-        OZONE_S3G_STS_HTTP_ENABLED_KEY,
-        OZONE_S3G_STS_HTTP_ENABLED_DEFAULT);
-
     init();
   }
 
@@ -312,11 +305,12 @@ private void setReadConsistencyFromHeader(ClientProtocol 
clientProtocol) {
   }
 
   /**
-   * Sets the IAM S3 action on thread-local {@link S3Auth} for fine-grained 
STS authorization.
-   * Called when the handler resolves the {@link S3GAction}.
+   * Sets the IAM S3 action on thread-local {@link S3Auth} for authorization 
(STS session policies and
+   * S3 action-based authorizer policies such as Ranger). Called when the 
handler resolves the
+   * {@link S3GAction}.
    */
   protected void applyS3Action(S3GAction action) {
-    if (s3Auth != null && s3StsEnabled) {
+    if (s3Auth != null) {
       s3Auth.setS3Action(S3GActionIamMapper.toS3ActionString(action));
     }
   }
@@ -332,7 +326,7 @@ protected void applyS3Action(S3GAction action) {
    */
   protected <T, E extends Exception> T runWithS3ActionString(String s3Action, 
CheckedSupplier<T, E> checkedSupplier)
       throws E {
-    if (s3Auth == null || !s3StsEnabled) {
+    if (s3Auth == null) {
       return checkedSupplier.get();
     }
     final String originalS3Action = s3Auth.getS3Action();
@@ -717,7 +711,6 @@ protected void copyDependenciesTo(EndpointBase target) {
     }
     target.queryParams = queryParams;
     target.s3Auth = s3Auth;
-    target.s3StsEnabled = s3StsEnabled;
     target.setClient(this.client);
     target.setOzoneConfiguration(this.ozoneConfiguration);
     target.setContext(this.context);
diff --git 
a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestS3ActionOverrideForOwnerVerification.java
 
b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestS3ActionOverrideForOwnerVerification.java
index 36a8518c7ed..4705ce59c28 100644
--- 
a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestS3ActionOverrideForOwnerVerification.java
+++ 
b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestS3ActionOverrideForOwnerVerification.java
@@ -27,7 +27,6 @@
 import static org.apache.hadoop.ozone.s3.util.S3Consts.X_AMZ_CONTENT_SHA256;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyBoolean;
@@ -68,6 +67,7 @@
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.CsvSource;
 import org.junit.jupiter.params.provider.ValueSource;
 
 /**
@@ -87,19 +87,16 @@ public static void setUp() {
     S3GatewayMetrics.create(new OzoneConfiguration());
   }
 
-  @Test
-  public void testListObjectVersionsUsesListBucketVersionsAction() throws 
Exception {
-    assertEquals("ListBucketVersions", listBucketAction(true, true));
-  }
-
-  @Test
-  public void testListObjectsUsesListBucketAction() throws Exception {
-    assertEquals("ListBucket", listBucketAction(false, true));
+  @ParameterizedTest
+  @ValueSource(booleans = {true, false})
+  public void testListObjectVersionsUsesListBucketVersionsAction(boolean 
isStsEnabled) throws Exception {
+    assertEquals("ListBucketVersions", listBucketAction(true, isStsEnabled));
   }
 
-  @Test
-  public void testListObjectVersionsDoesNotSetActionWhenStsDisabled() throws 
Exception {
-    assertNull(listBucketAction(true, false));
+  @ParameterizedTest
+  @ValueSource(booleans = {true, false})
+  public void testListObjectsUsesListBucketAction(boolean isStsEnabled) throws 
Exception {
+    assertEquals("ListBucket", listBucketAction(false, isStsEnabled));
   }
 
   @Test
@@ -111,10 +108,11 @@ public void 
testListObjectVersionsUsesListObjectVersionsAuditAction() throws Exc
     assertEquals(S3GAction.LIST_OBJECT_VERSIONS, auditAction.get());
   }
 
-  @Test
-  public void 
testUploadPartCopyUsesGetObjectActionForSourceBucketOwnerLookup() throws 
Exception {
+  @ParameterizedTest
+  @ValueSource(booleans = {true, false})
+  public void 
testUploadPartCopyUsesGetObjectActionForSourceBucketOwnerLookup(boolean 
isStsEnabled) throws Exception {
     final AtomicReference<String> actionAtSourceBucketOwnerLookup = new 
AtomicReference<>();
-    final ObjectEndpoint endpoint = 
newEndpoint(actionAtSourceBucketOwnerLookup, true);
+    final ObjectEndpoint endpoint = 
newEndpoint(actionAtSourceBucketOwnerLookup, isStsEnabled);
 
     // Trigger UploadPartCopy (MPU part upload with copy header).
     final String uploadId = "upload-id";
@@ -123,10 +121,11 @@ public void 
testUploadPartCopyUsesGetObjectActionForSourceBucketOwnerLookup() th
     assertEquals("GetObject", actionAtSourceBucketOwnerLookup.get());
   }
 
-  @Test
-  public void testCopyObjectUsesGetObjectActionForSourceBucketOwnerLookup() 
throws Exception {
+  @ParameterizedTest
+  @ValueSource(booleans = {true, false})
+  public void 
testCopyObjectUsesGetObjectActionForSourceBucketOwnerLookup(boolean 
isStsEnabled) throws Exception {
     final AtomicReference<String> actionAtSourceBucketOwnerLookup = new 
AtomicReference<>();
-    final ObjectEndpoint endpoint = 
newEndpoint(actionAtSourceBucketOwnerLookup, true);
+    final ObjectEndpoint endpoint = 
newEndpoint(actionAtSourceBucketOwnerLookup, isStsEnabled);
 
     // Trigger CopyObject (PUT with copy header, no upload ID).
     assertThrows(Exception.class, () -> put(endpoint, DEST_BUCKET, DEST_KEY, 
""));
@@ -134,36 +133,13 @@ public void 
testCopyObjectUsesGetObjectActionForSourceBucketOwnerLookup() throws
     assertEquals("GetObject", actionAtSourceBucketOwnerLookup.get());
   }
 
-  @Test
-  public void testUploadPartCopyDoesNotSetActionWhenStsDisabled() throws 
Exception {
-    final AtomicReference<String> actionAtSourceBucketOwnerLookup = new 
AtomicReference<>();
-    final ObjectEndpoint endpoint = 
newEndpoint(actionAtSourceBucketOwnerLookup, false);
-
-    // Trigger UploadPartCopy (MPU part upload with copy header).
-    final String uploadId = "upload-id";
-    assertThrows(Exception.class, () -> put(endpoint, DEST_BUCKET, DEST_KEY, 
1, uploadId, ""));
-
-    assertNull(actionAtSourceBucketOwnerLookup.get());
-  }
-
-  @Test
-  public void testCopyObjectDoesNotSetActionWhenStsDisabled() throws Exception 
{
-    final AtomicReference<String> actionAtSourceBucketOwnerLookup = new 
AtomicReference<>();
-    final ObjectEndpoint endpoint = 
newEndpoint(actionAtSourceBucketOwnerLookup, false);
-
-    // Trigger CopyObject (PUT with copy header, no upload ID).
-    assertThrows(Exception.class, () -> put(endpoint, DEST_BUCKET, DEST_KEY, 
""));
-
-    assertNull(actionAtSourceBucketOwnerLookup.get());
-  }
-
   @ParameterizedTest
-  @ValueSource(strings = {"ETag", "ObjectParts"})
-  public void 
testGetObjectAttributesSendsSingleOmRequestWithGetObjectAttributesAction(String 
attribute)
-      throws Exception {
+  @CsvSource({"ETag,true", "ETag,false", "ObjectParts,true", 
"ObjectParts,false"})
+  public void 
testGetObjectAttributesSendsSingleOmRequestWithGetObjectAttributesAction(
+      String attribute, boolean isStsEnabled) throws Exception {
     final List<String> actions = new ArrayList<>();
     final ClientProtocol clientProtocol = mock(ClientProtocol.class);
-    final ObjectEndpoint endpoint = newGetObjectAttributesEndpoint(actions, 
true, clientProtocol, false);
+    final ObjectEndpoint endpoint = newGetObjectAttributesEndpoint(actions, 
isStsEnabled, clientProtocol, false);
 
     final Response response = getObjectAttributes(endpoint, DEST_BUCKET, 
DEST_KEY, attribute);
 
@@ -173,19 +149,6 @@ public void 
testGetObjectAttributesSendsSingleOmRequestWithGetObjectAttributesAc
     verifySingleMetadataLookup(clientProtocol, attribute);
   }
 
-  @ParameterizedTest
-  @ValueSource(strings = {"ETag", "ObjectParts"})
-  public void 
testGetObjectAttributesSkipsAdditionalCheckWhenStsDisabled(String attribute) 
throws Exception {
-    final List<String> actions = new ArrayList<>();
-    final ObjectEndpoint endpoint = newGetObjectAttributesEndpoint(actions, 
false);
-
-    final Response response = getObjectAttributes(endpoint, DEST_BUCKET, 
DEST_KEY, attribute);
-
-    assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
-    // With STS disabled, no S3 action is sent to OM.
-    assertEquals(Collections.singletonList(null), actions);
-  }
-
   @ParameterizedTest
   @ValueSource(strings = {"ETag", "ObjectParts"})
   public void 
testGetObjectAttributesPermissionDeniedReturnsAccessDenied(String attribute) 
throws Exception {
@@ -273,11 +236,6 @@ private static ObjectEndpoint 
newEndpoint(AtomicReference<String> actionAtSource
         .build();
   }
 
-  private static ObjectEndpoint newGetObjectAttributesEndpoint(List<String> 
actions, boolean isStsEnabled)
-      throws Exception {
-    return newGetObjectAttributesEndpoint(actions, isStsEnabled, 
mock(ClientProtocol.class), false);
-  }
-
   private static ObjectEndpoint newGetObjectAttributesEndpoint(List<String> 
actions, boolean isStsEnabled,
       ClientProtocol clientProtocol, boolean denyAccess) throws Exception {
     final HttpHeaders headers = mock(HttpHeaders.class);


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

Reply via email to