d8tltanc commented on a change in pull request #9485: URL: https://github.com/apache/kafka/pull/9485#discussion_r545576700
########## File path: clients/src/main/java/org/apache/kafka/common/utils/SecurityUtils.java ########## @@ -146,4 +148,32 @@ else if (capitalizeNext) { } return builder.toString(); } + + public static void authorizeByResourceTypeCheckArgs(AclOperation op, + ResourceType type) { + if (type == ResourceType.ANY) { + throw new IllegalArgumentException( + "Must specify a non-filter resource type for authorizeByResourceType"); + } + + if (type == ResourceType.UNKNOWN) { + throw new IllegalArgumentException( + "Unknown resource type"); + } + + if (op == AclOperation.ANY) { + throw new IllegalArgumentException( + "Must specify a non-filter operation type for authorizeByResourceType"); + } + + if (op == AclOperation.UNKNOWN) { + throw new IllegalArgumentException( + "Unknown operation type"); + } + } + + public static boolean canDenyAll(ResourcePattern pattern) { Review comment: commit b6a766b ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org