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

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

soenkeliebau closed pull request #4571: KAFKA-6561: Change visibility of 
aclMatch in SimpleAclAuthorizer to allow access from subclasses
URL: https://github.com/apache/kafka/pull/4571
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core/src/main/scala/kafka/security/auth/SimpleAclAuthorizer.scala 
b/core/src/main/scala/kafka/security/auth/SimpleAclAuthorizer.scala
index c439f5e15af..0d65c957e8c 100644
--- a/core/src/main/scala/kafka/security/auth/SimpleAclAuthorizer.scala
+++ b/core/src/main/scala/kafka/security/auth/SimpleAclAuthorizer.scala
@@ -143,7 +143,7 @@ class SimpleAclAuthorizer extends Authorizer with Logging {
     } else false
   }
 
-  private def aclMatch(operations: Operation, resource: Resource, principal: 
KafkaPrincipal, host: String, permissionType: PermissionType, acls: Set[Acl]): 
Boolean = {
+  protected def aclMatch(operations: Operation, resource: Resource, principal: 
KafkaPrincipal, host: String, permissionType: PermissionType, acls: Set[Acl]): 
Boolean = {
     acls.find { acl =>
       acl.permissionType == permissionType &&
         (acl.principal == principal || acl.principal == Acl.WildCardPrincipal) 
&&


 

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


> Change visibility of aclMatch in SimpleAclAuthorizer to protected to allow 
> overriding in subclasses
> ---------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-6561
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6561
>             Project: Kafka
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.0.0
>            Reporter: Sönke Liebau
>            Assignee: Sönke Liebau
>            Priority: Minor
>
> Currently the visibility of the 
> [aclMatch|https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/security/auth/SimpleAclAuthorizer.scala#L146]
>  function in the SimpleAclAuthorizer class is set to private, thus 
> prohibiting subclasses from overriding this method. I think this was 
> originally done as this function is not supposed to be part of the public Api 
> of this class, which makes sense.
> However when creating a custom authorizer this would be a very useful method 
> to override, as it allows to reuse a large amount of boilerplate code around 
> loading and applying ACLs and simply changing the way that ACLs are matched.
> Could we change the visibility of this method to protected, thus still 
> keeping it out of the public interface but allowing for subclasses to 
> override it?



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

Reply via email to