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


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

Review Comment:
   You're right, good catch. The standard ListBuckets API also accepts 
continuation-token as a 
   query parameter (for paginated listing), so using it as a discriminator 
would incorrectly route 
   a paginated ListBuckets request into listDirectoryBuckets().
   The only query parameter that is exclusive to ListDirectoryBuckets is 
max-directory-buckets. 
   I'll remove the CONTINUATION_TOKEN check from 
isListDirectoryBucketsRequest(). The routing 
   will then rely solely on the presence of max-directory-buckets or the S3 
Express credential 
   scope (isS3ExpressSignedRequest()), which is the correct approach.



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