You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by sa...@apache.org on 2020/07/22 13:00:28 UTC

[hadoop-ozone] 18/39: HDDS-3765. Fluentd writing to secure Ozone S3 API fails with 500 Error. (#1179)

This is an automated email from the ASF dual-hosted git repository.

sammichen pushed a commit to branch ozone-0.6.0
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git

commit adb15ba882acd72c8540d30d29b0a576b9f8ca2f
Author: avijayanhwx <14...@users.noreply.github.com>
AuthorDate: Wed Jul 15 10:56:22 2020 -0700

    HDDS-3765. Fluentd writing to secure Ozone S3 API fails with 500 Error. (#1179)
    
    (cherry picked from commit d6c7f2836d2f2f06b2150299365311843eb58d08)
---
 .../src/main/smoketest/security/ozone-secure-s3.robot     | 15 +++++++++++++++
 .../apache/hadoop/ozone/s3/AWSV4SignatureProcessor.java   |  8 +-------
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/hadoop-ozone/dist/src/main/smoketest/security/ozone-secure-s3.robot b/hadoop-ozone/dist/src/main/smoketest/security/ozone-secure-s3.robot
index 5103e80..70bade5 100644
--- a/hadoop-ozone/dist/src/main/smoketest/security/ozone-secure-s3.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/security/ozone-secure-s3.robot
@@ -24,6 +24,8 @@ Test Timeout        5 minutes
 
 *** Variables ***
 ${ENDPOINT_URL}     http://s3g:9878
+${TEMPDIR}          /tmp
+${TEST_FILE}        NOTICE.txt
 
 *** Keywords ***
 Setup volume names
@@ -38,6 +40,19 @@ Secure S3 test Success
     ${output} =         Execute          aws s3api --endpoint-url ${ENDPOINT_URL} list-buckets
                         Should contain   ${output}         bucket-test123
 
+Secure S3 put-object test
+    ${testFilePath} =       Set Variable            ${TEMPDIR}/${TEST_FILE}
+                            Copy File               ${TEST_FILE}            ${testFilePath}
+    ${output} =             Execute                 aws s3api --endpoint ${ENDPOINT_URL} put-object --bucket=bucket-test123 --key=tmp1/tmp2/NOTICE.txt --body=${testFilePath}
+    ${output} =             Execute                 aws s3api --endpoint ${ENDPOINT_URL} list-objects --bucket=bucket-test123
+                            Should contain   ${output}         tmp1/tmp2/NOTICE.txt
+    ${output} =             Execute                 aws s3api --endpoint ${ENDPOINT_URL} put-object --bucket=bucket-test123 --key=tmp3//tmp4/NOTICE.txt --body=${testFilePath}
+    ${output} =             Execute                 aws s3api --endpoint ${ENDPOINT_URL} list-objects --bucket=bucket-test123
+                            Should contain   ${output}         tmp3//tmp4/NOTICE.txt
+    ${output} =             Execute                 aws s3api --endpoint ${ENDPOINT_URL} put-object --bucket=bucket-test123 --key=//tmp5/tmp6/NOTICE.txt --body=${testFilePath}
+    ${output} =             Execute                 aws s3api --endpoint ${ENDPOINT_URL} list-objects --bucket=bucket-test123
+                            Should contain   ${output}         //tmp5/tmp6/NOTICE.txt
+
 Secure S3 test Failure
     Run Keyword         Setup dummy credentials for S3
     ${rc}  ${result} =  Run And Return Rc And Output  aws s3api --endpoint-url ${ENDPOINT_URL} create-bucket --bucket bucket-test123
diff --git a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/AWSV4SignatureProcessor.java b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/AWSV4SignatureProcessor.java
index 099221d..1ff1a72 100644
--- a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/AWSV4SignatureProcessor.java
+++ b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/AWSV4SignatureProcessor.java
@@ -104,13 +104,7 @@ public class AWSV4SignatureProcessor implements SignatureProcessor {
 
 
     this.queryMap = context.getUriInfo().getQueryParameters();
-    try {
-      this.uri = new URI(context.getUriInfo().getRequestUri()
-          .getPath().replaceAll("\\/+",
-              "/")).normalize().getPath();
-    } catch (URISyntaxException e) {
-      throw S3_AUTHINFO_CREATION_ERROR;
-    }
+    this.uri = context.getUriInfo().getRequestUri().getPath();
 
     this.method = context.getMethod();
     if (v4Header == null) {


---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-commits-help@hadoop.apache.org