fmorg-git commented on code in PR #11313: URL: https://github.com/apache/ozone/pull/11313#discussion_r4148474782
########## hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectNotImplementedHandler.java: ########## @@ -0,0 +1,64 @@ +/* + * 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 com.google.common.collect.ImmutableSet; +import java.io.InputStream; +import java.util.Set; +import javax.ws.rs.core.Response; +import org.apache.hadoop.ozone.s3.endpoint.ObjectEndpoint.ObjectRequestContext; +import org.apache.hadoop.ozone.s3.util.S3Consts.QueryParams; + +/** + * Rejects object subresource operations that are not implemented. + * <p> + * Must be added to the chain after the handlers of specific subresources ({@link ObjectAclHandler}, + * {@link ObjectAttributesHandler}, {@link ObjectGetTorrentHandler}, {@link ObjectTaggingHandler}, + * {@link MultipartKeyHandler}), etc. so that it only sees the HTTP methods those handlers do not handle, e.g. DELETE + * {@code ?acl} or PUT {@code ?attributes}. Otherwise, the requests fall through to another operation of the same HTTP + * method: a GET returns the object body, a PUT overwrites the object with the request body and a DELETE deletes it. + * <p> + * {@code ?uploads} is only valid for POST ({@code CreateMultipartUpload}), which does not go through this chain. + */ +class ObjectNotImplementedHandler extends ObjectOperationHandler { + + private static final Set<String> SUBRESOURCES = ImmutableSet.of( + QueryParams.ACL, QueryParams.ANNOTATION, QueryParams.ATTRIBUTES, QueryParams.ENCRYPTION, QueryParams.LEGAL_HOLD, + QueryParams.RENAME_OBJECT, QueryParams.RETENTION, QueryParams.TORRENT, QueryParams.UPLOADS); Review Comment: updated - 490797494a72087bb05043e054a2f37422548f50 -- 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]
