kerneltime commented on code in PR #4473:
URL: https://github.com/apache/ozone/pull/4473#discussion_r1184447033
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/signature/AuthorizationV4HeaderParser.java:
##########
@@ -168,47 +168,50 @@ private Credential parseCredentials(String credential)
if (credentialObj.getAccessKeyID().isEmpty()) {
throw new MalformedResourceException(
- "AWS access id shouldn't be empty. credential: " + credential,
- authHeader);
+ "AWS access id is empty. credential: " + credential, authHeader);
}
if (credentialObj.getAwsRegion().isEmpty()) {
throw new MalformedResourceException(
- "AWS region shouldn't be empty. credential: " + credential,
- authHeader);
+ "AWS region is empty. credential: " + credential, authHeader);
}
- if (credentialObj.getAwsRequest().isEmpty()) {
+ if (credentialObj.getAwsRequest().isEmpty() ||
Review Comment:
I was going over the string parsing logic for credentialObj and we can
definitely do a lot better in Credential::parcelCredential() method and add
tests. This can be done in a separate jira. I do not think the credential
parsing logic is defensive enough. Also here, we can first check if
`credentialObj.getAwsRequest() != 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]