[ https://issues.apache.org/jira/browse/KAFKA-7011?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16504754#comment-16504754 ]
ASF GitHub Bot commented on KAFKA-7011: --------------------------------------- big-andy-coates opened a new pull request #5160: KAFKA-7011 - Remove ResourceNameType field from Java Resource class. URL: https://github.com/apache/kafka/pull/5160 Fix for KAFKA-7011. The initial PR for KIP-290 #5117 added a `ResourceNameType` field to the Java and Scala `Resource` classes to introduce the concept of Prefixed ACLS. This does not make a lot of sense as these classes are meant to represent cluster resources, which would not have a concept of 'name type' This PR looks to refactor the code to remove the name type field from the Java `Resource` class. (The Scala one will age out once KIP-290 is done, and removing it would involve changes to the `Authorizer` interface, so this class was not touched). This is achieved by replacing the use of `Resource` with `ResourcePattern` and `ResourceFilter` with `ResourceFilterPattern`. A `ResourcePattern` is a combination of resource type, name and name type, where each field needs to be defined. A `ResourcePatternFilter` is used to select patterns during describe and delete operations. The adminClient uses `AclBinding` and `AclBindingFilter`. These types have been switched over to use the new pattern types. The AclCommands class, used by Kafka-acls.sh, has been converted to use the new pattern types. The result is that the original `Resource` and `ResourceFilter` classes are not really used anywhere, except deprecated methods. However, the `Resource` class will be used if/when KIP-50 is done. cc @cmccabe, @junrao ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) ---------------------------------------------------------------- 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 > Investigate if its possible to drop the ResourceNameType field from Java > Resource class. > ---------------------------------------------------------------------------------------- > > Key: KAFKA-7011 > URL: https://issues.apache.org/jira/browse/KAFKA-7011 > Project: Kafka > Issue Type: Sub-task > Components: core, security > Reporter: Andy Coates > Assignee: Andy Coates > Priority: Major > Fix For: 2.0.0 > > > Following on from the PR [#5117|https://github.com/apache/kafka/pull/5117] > and discussions with Colin McCabe... > > Current placement of ResourceNameType as field in Resource class is ... less > than ideal. A Resource should be a concrete resource. Look to resolve this. > > Thoughts... > A. I guess you could subclass Resource and have ResourcePrefix - but there is > no 'is-a' relationship here and it would still allow > authorise(ResourcePrefix()) > B. You could move ResourceNameType into AccessControllEntryData - possible. > C. Move ResourceNameType directly into AclBinding / AclBindingFilter - > possible > -- This message was sent by Atlassian JIRA (v7.6.3#76005)