priyeshkaratha commented on code in PR #10408:
URL: https://github.com/apache/ozone/pull/10408#discussion_r3356838106


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/RootEndpoint.java:
##########
@@ -48,6 +58,101 @@ public class RootEndpoint extends EndpointBase {
   @GET
   public Response get()
       throws OS3Exception, IOException {
+    if (isListDirectoryBucketsRequest()) {
+      return listDirectoryBuckets();
+    }
+    return listAllBuckets();
+  }
+
+  private boolean isListDirectoryBucketsRequest() {
+    return queryParams().get(QueryParams.MAX_DIRECTORY_BUCKETS) != null
+        || queryParams().get(QueryParams.CONTINUATION_TOKEN) != null
+        || isS3ExpressSignedRequest();
+  }
+
+  private boolean isS3ExpressSignedRequest() {
+    if (signatureInfo == null) {
+      return false;
+    }
+    String credentialScope = signatureInfo.getCredentialScope();
+    if (credentialScope == null || credentialScope.isEmpty()) {
+      return false;
+    }
+    String[] parts = credentialScope.split("/");
+    return parts.length >= 3 && S3_EXPRESS_SERVICE.equals(parts[2]);
+  }

Review Comment:
   The s3express service name in the SigV4 credential scope is not explicitly 
called out on the ListDirectoryBuckets API doc page, but it is a 
well-established behavior of the AWS SDKs and CLI when signing requests to S3 
Express Regional endpoints (s3express-control.<region>.amazonaws.com). In 
SigV4, the credential scope format is `<date>/<region>/<service>/aws4_request`, 
and the AWS SDKs consistently use s3express as the service component for all S3 
Express operations 
   
   I'll add a comment in the code making this explicit.



-- 
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