-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HDDS-1043. Enable token based authentication for S3 api. #561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
${hostname}= Execute hostname | ||
Execute kinit -k testuser/${hostname}@EXAMPLE.COM -t /etc/security/keytabs/testuser.keytab | ||
${result} = Execute ozone sh s3 getsecret | ||
${accessKey} = Get Regexp Matches ${result} (?<=awsAccessKey=).* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace:tabs in line
@@ -45,7 +45,7 @@ wait_for_datanodes(){ | |||
|
|||
#Print it only if a number. Could be not a number if scm is not yet started | |||
if [[ "$datanodes" ]]; then | |||
echo "$datanodes datanode is up and healhty (until now)" | |||
echo "$datanodes datanode is up and healthy (until now)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace:tabs in line
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/AWSV4AuthValidator.java
Show resolved
Hide resolved
could you please share the failing tests. I can't find them in test report. |
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/AWSV4AuthValidator.java
Outdated
Show resolved
Hide resolved
*/ | ||
public static boolean validateRequest(String strToSign, String signature, | ||
String userKey) { | ||
String expectedSignature = Hex.encode(sign(getSignatureKey( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this line in to a method say getSignature()
As from the doc, this is signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added java doc for, let me know if you feel strongly about having it in separate function as it is one liner code.
} catch (IOException e) { | ||
LOG.error("Error while validating S3 identifier:{}", | ||
identifier, e); | ||
throw new InvalidToken("No S3 secret found for S3 identifier:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now if InvalidToken is thrown as an exception during invalid/malformed header, then how this will be thrown to the end user s3 request? I don't see any code for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now if token validation fails rpc connection will fail itself. S3 gateway will get an error. Error propagation to client will depend on S3g error handling.
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/OzoneServiceProvider.java
Outdated
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
forced reset to squashed commit as local rebase added spurious commits. |
|
||
Secure S3 test Failure | ||
Run Keyword Install aws cli | ||
${rc} ${result} = Run And Return Rc And Output aws s3api --endpoint-url ${ENDPOINT_URL} create-bucket --bucket bucket-test123 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace:tabs in line
${hostname}= Execute hostname | ||
Execute kinit -k testuser/${hostname}@EXAMPLE.COM -t /etc/security/keytabs/testuser.keytab | ||
${result} = Execute ozone sh s3 getsecret | ||
${accessKey} = Get Regexp Matches ${result} (?<=awsAccessKey=).* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace:tabs in line
💔 -1 overall
This message was automatically generated. |
Yetus is still not running all the tests. check the small red X next to your commit id: https://ci.anzix.net/job/ozone/427/testReport/
|
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
|
||
Secure S3 test Failure | ||
Run Keyword Install aws cli | ||
${rc} ${result} = Run And Return Rc And Output aws s3api --endpoint-url ${ENDPOINT_URL} create-bucket --bucket bucket-test123 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace:tabs in line
${hostname}= Execute hostname | ||
Execute kinit -k testuser/${hostname}@EXAMPLE.COM -t /etc/security/keytabs/testuser.keytab | ||
${result} = Execute ozone sh s3 getsecret | ||
${accessKey} = Get Regexp Matches ${result} (?<=awsAccessKey=).* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace:tabs in line
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ajayydv the patch and the continuous improvement. This is a real milestone for the S3 gateway.
I am doing a final local build and test (including checkstyle/findbugs/acceptance) and will commit it soon.
…ob and cause unit tests to get skipped Author: Cameron Lee <calee@linkedin.com> Reviewers: Xinyu Liu <xinyu@apache.org> Closes apache#561 from cameronlee314/app_runner_main_exit
No description provided.