yandrey321 commented on code in PR #11367: URL: https://github.com/apache/ozone/pull/11367#discussion_r4146428634
########## hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/TestS3GatewayHttpServers.java: ########## @@ -0,0 +1,100 @@ +/* + * 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; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; + +import java.io.IOException; +import java.nio.file.Path; +import org.apache.hadoop.hdds.conf.MutableConfigurationSource; +import org.apache.hadoop.hdds.conf.OzoneConfiguration; +import org.apache.hadoop.ozone.OzoneConfigKeys; +import org.apache.hadoop.ozone.s3sts.S3STSConfigKeys; +import org.apache.ozone.test.GenericTestUtils.PortAllocator; +import org.eclipse.jetty.ee8.webapp.WebAppContext; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +/** + * Tests the CDI wiring of the S3 Gateway HTTP servers. + */ +class TestS3GatewayHttpServers { + + /** + * Attribute Weld's JettyContainer probes for, set by CdiDecoratingListener. + */ + private static final String CDI_ATTRIBUTE = "org.eclipse.jetty.cdi"; + private static final String CDI_MODE = "CdiDecoratingListener"; + + @TempDir + private Path tempDir; + + /** + * An enabled server gets Jetty's CDI integration attribute, without which + * Weld falls through to its legacy Jetty container and fails to start the + * context on Jetty 12. + */ + @Test + void enabledServerInstallsCdiIntegrationAttribute() throws Exception { + OzoneConfiguration conf = newConf(); + conf.set(S3GatewayConfigKeys.OZONE_S3G_HTTP_ADDRESS_KEY, + "127.0.0.1:" + PortAllocator.getFreePort()); Review Comment: fixed ########## hadoop-hdds/docs/content/security/SecuringS3.md: ########## @@ -68,6 +68,17 @@ the AWS credentials. The values will be printed out on the screen. You can set these values up in your _.aws_ file for automatic access while working against Ozone S3 buckets. +If a secret already exists for the user, the endpoint responds with HTTP +`400 Bad Request` and the error code `S3_SECRET_ALREADY_EXISTS` in the +plain-text response body. The error code is carried in the body, not in the +HTTP status line (reason phrase), so clients must read the body rather than +parse the status message: +```bash +curl -X PUT --negotiate -u : -v https://localhost:9879/secret +# < HTTP/1.1 400 Bad Request +# S3_SECRET_ALREADY_EXISTS +``` + Review Comment: fixed -- 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]
