ChenSammi commented on code in PR #9899:
URL: https://github.com/apache/ozone/pull/9899#discussion_r3062787093
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/acl/iam/IamSessionPolicyResolver.java:
##########
@@ -548,12 +552,16 @@ private static void processBucketResource(String
volumeName, Set<S3Action> mappe
if (action == S3Action.LIST_BUCKET || action == S3Action.ALL_S3) {
// If condition prefixes are present, these would constrain the object
permissions if the action
// is s3:ListBucket or s3:* (which includes s3:ListBucket)
- if (prefixes != null && !prefixes.isEmpty()) {
- for (String prefix : prefixes) {
+ if (condition != null && condition.prefixes != null &&
!condition.prefixes.isEmpty()) {
+ for (String prefix : condition.prefixes) {
+ // If operator is StringEquals, we should ignore any prefix
containing wildcards
+ if (STRING_EQUALS.equals(condition.operator) &&
hasWildcard(prefix)) {
+ continue;
Review Comment:
Here the STRING_EQUALS with wildcard situation is silently ignored. Will we
reject the policy and return exception in parsePrefixesFromConditions() more
user friendly?
--
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]