hevinhsu commented on code in PR #8558:
URL: https://github.com/apache/ozone/pull/8558#discussion_r2134569469


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketOwnerCondition.java:
##########
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.s3.endpoint;
+
+import javax.ws.rs.core.HttpHeaders;
+import org.apache.hadoop.ozone.om.exceptions.OMException;
+import org.apache.hadoop.ozone.s3.util.S3Consts;
+
+/**
+ * Bucket owner condition to verify bucket ownership.
+ * <p>
+ * See: 
https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucket-owner-condition.html
+ * for more details
+ */
+public final class BucketOwnerCondition {
+
+  public static final String ERROR_MESSAGE = "Expected bucket owner does not 
match";
+
+  private BucketOwnerCondition() {
+
+  }
+
+  /**
+   * Verify the bucket owner condition.
+   *
+   * @param headers       HTTP headers
+   * @param bucketOwner   bucket owner
+   * @throws OMException if the expected bucket owner does not match the actual
+   *                     bucket owner
+   */
+  public static void verify(HttpHeaders headers, String bucketOwner) throws 
OMException {

Review Comment:
   Thanks for pointing this out. I initially thought owner would be a non-null 
value. I'll skip the verification when ```bucketOwner``` is null.



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