d8tltanc commented on a change in pull request #9485:
URL: https://github.com/apache/kafka/pull/9485#discussion_r533919425



##########
File path: core/src/main/scala/kafka/security/authorizer/AclAuthorizer.scala
##########
@@ -304,6 +308,122 @@ class AclAuthorizer extends Authorizer with Logging {
     if (zkClient != null) zkClient.close()
   }
 
+  // TODO: 1. Discuss how to log audit message
+  // TODO: 2. Discuss if we need a trie to optimize(mainly for the O(n^2) loop 
but I think
+  //  in most of the cases it would be O(1) because denyDominatePrefixAllow 
should be rare
+  override def authorizeByResourceType(requestContext: 
AuthorizableRequestContext,
+                                       op: AclOperation,
+                                       resourceType: ResourceType): 
AuthorizationResult = {
+    if (resourceType eq ResourceType.ANY)
+      throw new IllegalArgumentException("Must specify a non-filter resource 
type for authorizeByResourceType")
+
+    if (resourceType eq ResourceType.UNKNOWN)
+      throw new IllegalArgumentException("Unknown resource type")
+
+    if (op eq AclOperation.ANY)
+      throw new IllegalArgumentException("Must specify a non-filter operation 
type for authorizeByResourceType")
+
+    if (op eq AclOperation.UNKNOWN)
+      throw new IllegalArgumentException("Unknown operation type")

Review comment:
       commit f6d2a39706998160ebe77a854b8bf64268eec68a




----------------------------------------------------------------
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


Reply via email to