log4j.logger.kafka.authorizer.logger=ALL
AclAuthorizer
AclAuthorizer
(kafka.security.authorizer.AclAuthorizer
) is an Authorizer that uses Apache ZooKeeper to persist ACLs.
Note
|
AclAuthorizer is available since Apache Kafka 2.4.0 (KIP-504 - Add new Java Authorizer Interface).
|
AclAuthorizer
uses properties for configuration (when KafkaServer
is requested to start up).
AclAuthorizer
may use its own dedicated ZooKeeper for ACLs per authorizer.zookeeper.url configuration property (that could be separate from the cluster’s ZooKeeper).
AclAuthorizer
uses a dedicated KafkaZkClient to access ZooKeeper.
Tip
|
Consult Demo: ACL Authorization. |
Name | Description |
---|---|
|
Allows all users to access resources with no ACL Default: |
|
Default: zkConnectionTimeoutMs |
|
Default: zookeeper.max.in.flight.requests |
|
Default: zookeeper.session.timeout.ms |
|
URL of the dedicated Zookeeper to store ACLs (that can be different from zookeeper.connect) Default: zookeeper.connect |
|
Semicolon-separated list of Kafka principals that are super users and have access to all the resources for all actions from all hosts. Default: (empty) |
Tip
|
Enable Add the following line to Refer to Logging. Please note that Kafka comes with a preconfigured
That means that the logs of |
configure
Method
configure(
javaConfigs: util.Map[String, _]): Unit
Note
|
configure is part of the Configurable contract to pass configurations.
|
configure
creates a KafkaZkClient (using the properties in the given javaConfigs
) with kafka.security
metric group and AclAuthorizer
metric type, and ACL authorizer
logger prefix.
configure
requests the KafkaZkClient to createAclPaths.
configure
startZkChangeListeners and then loadCache.
start
Method
start(
serverInfo: AuthorizerServerInfo): util.Map[Endpoint, _ <: CompletionStage[Void]]
Note
|
start is part of the Authorizer contract to…FIXME.
|
start
…FIXME
authorize
Method
authorize(
requestContext: AuthorizableRequestContext,
actions: List[Action]): List[AuthorizationResult]
Note
|
authorize is part of the Authorizer contract to…FIXME.
|
authorize
…FIXME
createAcls
Method
createAcls(
requestContext: AuthorizableRequestContext,
aclBindings: util.List[AclBinding]): util.List[_ <: CompletionStage[AclCreateResult]]
Note
|
createAcls is part of the Authorizer contract to…FIXME.
|
createAcls
…FIXME
deleteAcls
Method
deleteAcls(
requestContext: AuthorizableRequestContext,
aclBindingFilters: util.List[AclBindingFilter]): util.List[_ <: CompletionStage[AclDeleteResult]]
Note
|
deleteAcls is part of the Authorizer contract to…FIXME.
|
deleteAcls
…FIXME
acls
Method
acls(
filter: AclBindingFilter): lang.Iterable[AclBinding]
Note
|
acls is part of the Authorizer contract to…FIXME.
|
acls
…FIXME
isSuperUser
Method
isSuperUser(
principal: KafkaPrincipal): Boolean
isSuperUser
…FIXME
Note
|
isSuperUser is used when AclAuthorizer is requested to authorizeAction.
|
authorizeAction
Internal Method
authorizeAction(
requestContext: AuthorizableRequestContext,
action: Action): AuthorizationResult
authorizeAction
…FIXME
Note
|
authorizeAction is used when AclAuthorizer is requested to authorize.
|
aclsAllowAccess
Internal Helper Method
aclsAllowAccess: Boolean
aclsAllowAccess
is positive (true
) when…FIXME
isEmptyAclAndAuthorized
Internal Helper Method
isEmptyAclAndAuthorized(acls: Set[Acl]): Boolean
isEmptyAclAndAuthorized
is positive (true
) when the given acls are empty and the shouldAllowEveryoneIfNoAclIsFound internal flag is positive. Otherwise, isEmptyAclAndAuthorized
is negative (false
).
isEmptyAclAndAuthorized
prints out the following DEBUG message when positive:
No acl found for resource [resource], authorized = [shouldAllowEveryoneIfNoAclIsFound]
AclAuthorizer and KafkaZkClient
zkClient: KafkaZkClient
zkClient
is a KafkaZkClient that is created and requested to createAclPaths when AclAuthorizer
is requested to configure.
AclAuthorizer
uses the KafkaZkClient
for the following:
startZkChangeListeners
Internal Method
startZkChangeListeners(): Unit
startZkChangeListeners
…FIXME
Note
|
startZkChangeListeners is used when AclAuthorizer is requested to configure.
|
loadCache
Internal Method
loadCache(): Unit
loadCache
…FIXME
Note
|
loadCache is used when AclAuthorizer is requested to configure.
|
updateResourceAcls
Internal Method
updateResourceAcls(
resource: Resource)(
getNewAcls: Set[Acl] => Set[Acl]): Boolean
updateResourceAcls
…FIXME
Note
|
updateResourceAcls is used when AclAuthorizer is requested to createAcls and deleteAcls.
|
updateAclChangedFlag
Internal Method
updateAclChangedFlag(
resource: Resource): Unit
updateAclChangedFlag
…FIXME
Note
|
updateAclChangedFlag is used when AclAuthorizer is requested to updateResourceAcls.
|