[ 
https://issues.apache.org/jira/browse/KAFKA-7185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16550022#comment-16550022
 ] 

ASF GitHub Bot commented on KAFKA-7185:
---------------------------------------

dhruvilshah3 opened a new pull request #5400: KAFKA-7185: Allow empty group id 
when matching ACLs
URL: https://github.com/apache/kafka/pull/5400
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


> getMatchingAcls throws StringIndexOutOfBoundsException for empty resource name
> ------------------------------------------------------------------------------
>
>                 Key: KAFKA-7185
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7185
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Dhruvil Shah
>            Assignee: Dhruvil Shah
>            Priority: Blocker
>
> KIP-290 introduced a way to match ACLs based on prefix. Certain resource 
> names like that for group id can be empty strings. When an empty string is 
> passed into `getMatchingAcls`, it would throw a 
> `StringIndexOutOfBoundsException` because of the following logic:
> {noformat}
> val prefixed = aclCache.range(
>  Resource(resourceType, resourceName, PatternType.PREFIXED),
>  Resource(resourceType, resourceName.substring(0, Math.min(1, 
> resourceName.length)), PatternType.PREFIXED)
>  )
>  .filterKeys(resource => resourceName.startsWith(resource.name))
>  .flatMap { case (resource, versionedAcls) => versionedAcls.acls }
>  .toSet{noformat}
> This is a regression introduced in 2.0.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to