omkreddy commented on code in PR #10738:
URL: https://github.com/apache/kafka/pull/10738#discussion_r857163551


##########
core/src/test/scala/unit/kafka/security/token/delegation/DelegationTokenManagerTest.scala:
##########
@@ -315,13 +314,20 @@ class DelegationTokenManagerTest extends 
QuorumTestHarness  {
       List()
     }
     else {
-      def authorizeToken(tokenId: String) = {
+      def authorizeToken(tokenId: String): Boolean = {
         val requestContext = 
AuthorizerUtils.sessionToRequestContext(hostSession)
         val action = new Action(AclOperation.DESCRIBE,
           new ResourcePattern(DELEGATION_TOKEN, tokenId, LITERAL), 1, true, 
true)
         aclAuthorizer.authorize(requestContext, 
List(action).asJava).asScala.head == AuthorizationResult.ALLOWED
       }
-      def eligible(token: TokenInformation) = 
DelegationTokenManager.filterToken(requestPrincipal, Option(requestedOwners), 
token, authorizeToken)
+      def authorizeRequester(owner: KafkaPrincipal): Boolean = {
+        val requestContext = 
AuthorizerUtils.sessionToRequestContext(hostSession)
+        val action = new Action(AclOperation.DESCRIBE,

Review Comment:
   Do we have a test to exercise this method alone?  why are we using 
`DESCRIBE` Operation here?



##########
core/src/main/scala/kafka/security/authorizer/AclEntry.scala:
##########
@@ -100,9 +100,10 @@ object AclEntry {
     resourceType match {
       case ResourceType.TOPIC => Set(READ, WRITE, CREATE, DESCRIBE, DELETE, 
ALTER, DESCRIBE_CONFIGS, ALTER_CONFIGS)
       case ResourceType.GROUP => Set(READ, DESCRIBE, DELETE)
-      case ResourceType.CLUSTER => Set(CREATE, CLUSTER_ACTION, 
DESCRIBE_CONFIGS, ALTER_CONFIGS, IDEMPOTENT_WRITE, ALTER, DESCRIBE)
+      case ResourceType.CLUSTER => Set(CREATE, CLUSTER_ACTION, 
DESCRIBE_CONFIGS, ALTER_CONFIGS, IDEMPOTENT_WRITE, ALTER, DESCRIBE, 
CREATE_TOKENS, DESCRIBE_TOKENS)

Review Comment:
   Do we need this? We have not defined these operations in KIP 
https://cwiki.apache.org/confluence/display/KAFKA/KIP-373%3A+Allow+users+to+create+delegation+tokens+for+other+users#KIP373:Allowuserstocreatedelegationtokensforotherusers-Operations



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

Reply via email to