public class EmbeddedAuthorizer extends java.lang.Object implements Authorizer, org.apache.kafka.common.ClusterResourceListener
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
log |
Constructor and Description |
---|
EmbeddedAuthorizer() |
Modifier and Type | Method and Description |
---|---|
AccessRuleProvider |
accessRuleProvider(java.lang.String providerName) |
protected java.util.List<AccessRuleProvider> |
accessRuleProviders() |
java.util.List<AuthorizeResult> |
authorize(org.apache.kafka.common.security.auth.KafkaPrincipal sessionPrincipal,
java.lang.String host,
java.util.List<Action> actions)
Performs authorization for each of the provided `actions` and returns the result of each
authorization.
|
void |
close() |
void |
configure(java.util.Map<java.lang.String,?> configs) |
protected void |
configureProviders(java.util.List<AccessRuleProvider> accessRuleProviders,
GroupProvider groupProvider,
MetadataProvider metadataProvider) |
GroupProvider |
groupProvider() |
protected void |
initializeAndValidateLicense(java.util.Map<java.lang.String,?> configs) |
protected boolean |
isSuperUser(org.apache.kafka.common.security.auth.KafkaPrincipal principal,
Action action) |
MetadataProvider |
metadataProvider() |
void |
onUpdate(org.apache.kafka.common.ClusterResource clusterResource) |
protected boolean |
ready() |
protected Scope |
scope() |
java.util.concurrent.CompletableFuture<java.lang.Void> |
start(java.util.Map<java.lang.String,?> interBrokerListenerConfigs) |
public void onUpdate(org.apache.kafka.common.ClusterResource clusterResource)
onUpdate
in interface org.apache.kafka.common.ClusterResourceListener
public void configure(java.util.Map<java.lang.String,?> configs)
configure
in interface org.apache.kafka.common.Configurable
public java.util.List<AuthorizeResult> authorize(org.apache.kafka.common.security.auth.KafkaPrincipal sessionPrincipal, java.lang.String host, java.util.List<Action> actions)
Authorizer
authorize
in interface Authorizer
sessionPrincipal
- Authenticated principal of the client being authorized.
For embedded authorizer used in brokers, this must be the session principal
created by KafkaPrincipalBuilder
.
For remote authorization, e.g using Metadata Service, this is a KafkaPrincipal
instance that represents the principal of the remote client being authorized.host
- The host IP of the client performing the actions being authorized.
This may be null if host-based access control is not enabled.actions
- List of actions being authorized including the resource and operation
for each action.public GroupProvider groupProvider()
public AccessRuleProvider accessRuleProvider(java.lang.String providerName)
public MetadataProvider metadataProvider()
public java.util.concurrent.CompletableFuture<java.lang.Void> start(java.util.Map<java.lang.String,?> interBrokerListenerConfigs)
protected java.util.List<AccessRuleProvider> accessRuleProviders()
protected void configureProviders(java.util.List<AccessRuleProvider> accessRuleProviders, GroupProvider groupProvider, MetadataProvider metadataProvider)
protected boolean ready()
protected boolean isSuperUser(org.apache.kafka.common.security.auth.KafkaPrincipal principal, Action action)
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
protected Scope scope()
protected void initializeAndValidateLicense(java.util.Map<java.lang.String,?> configs)