public class EmbeddedAuthorizer extends Object implements Authorizer
Modifier and Type | Class and Description |
---|---|
protected static class |
EmbeddedAuthorizer.AuthorizationContext |
static class |
EmbeddedAuthorizer.AuthorizerMetrics |
Modifier and Type | Field and Description |
---|---|
protected ConfluentAuthorizerConfig |
authorizerConfig |
protected Set<org.apache.kafka.common.security.auth.KafkaPrincipal> |
brokerUsers |
protected String |
interBrokerListener |
protected static org.slf4j.Logger |
log |
protected Set<Provider> |
providersCreated |
Constructor and Description |
---|
EmbeddedAuthorizer() |
Modifier and Type | Method and Description |
---|---|
AccessRuleProvider |
accessRuleProvider(String providerName) |
protected List<AccessRuleProvider> |
accessRuleProviders() |
org.apache.kafka.server.audit.AuditLogProvider |
auditLogProvider() |
List<AuthorizeResult> |
authorize(RequestContext requestContext,
List<Action> actions)
Performs authorization for each of the provided `actions` and returns the result of each
authorization.
|
protected AuthorizeResult |
authorizeByResourceType(RequestContext requestContext,
Operation op,
ResourceType resourceType) |
void |
close() |
void |
configure(Map<String,?> configs) |
protected void |
configureProviders(List<AccessRuleProvider> accessRuleProviders,
GroupProvider groupProvider,
MetadataProvider metadataProvider,
org.apache.kafka.server.audit.AuditLogProvider auditLogProvider) |
void |
configureServerInfo(org.apache.kafka.server.authorizer.internals.ConfluentAuthorizerServerInfo serverInfo) |
GroupProvider |
groupProvider() |
protected boolean |
isSuperUser(org.apache.kafka.common.security.auth.KafkaPrincipal sessionPrincipal,
org.apache.kafka.common.security.auth.KafkaPrincipal userOrGroupPrincipal,
Action action) |
protected void |
logAuditMessage(Scope sourceScope,
RequestContext requestContext,
Action action,
AuthorizeResult authorizeResult,
AuthorizePolicy authorizePolicy) |
MetadataProvider |
metadataProvider() |
protected org.apache.kafka.common.metrics.Metrics |
metrics() |
protected org.apache.kafka.common.utils.Time |
metricsTime() |
protected boolean |
ready() |
protected Scope |
scope() |
protected void |
setupAuthorizerMetrics(org.apache.kafka.common.metrics.Metrics metrics) |
CompletableFuture<Void> |
start(org.apache.kafka.server.authorizer.internals.ConfluentAuthorizerServerInfo serverInfo,
Map<String,?> interBrokerListenerConfigs,
Runnable initTask) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
authorize
protected static final org.slf4j.Logger log
protected ConfluentAuthorizerConfig authorizerConfig
protected Set<org.apache.kafka.common.security.auth.KafkaPrincipal> brokerUsers
protected String interBrokerListener
public void configure(Map<String,?> configs)
configure
in interface org.apache.kafka.common.Configurable
public void configureServerInfo(org.apache.kafka.server.authorizer.internals.ConfluentAuthorizerServerInfo serverInfo)
public List<AuthorizeResult> authorize(RequestContext requestContext, List<Action> actions)
Authorizer
authorize
in interface Authorizer
requestContext
- Request context including principal and additional context for auditingactions
- List of actions being authorized including the resource and operation
for each action.public GroupProvider groupProvider()
public AccessRuleProvider accessRuleProvider(String providerName)
public MetadataProvider metadataProvider()
protected List<AccessRuleProvider> accessRuleProviders()
public org.apache.kafka.server.audit.AuditLogProvider auditLogProvider()
public CompletableFuture<Void> start(org.apache.kafka.server.authorizer.internals.ConfluentAuthorizerServerInfo serverInfo, Map<String,?> interBrokerListenerConfigs, Runnable initTask)
protected void configureProviders(List<AccessRuleProvider> accessRuleProviders, GroupProvider groupProvider, MetadataProvider metadataProvider, org.apache.kafka.server.audit.AuditLogProvider auditLogProvider)
protected boolean ready()
protected boolean isSuperUser(org.apache.kafka.common.security.auth.KafkaPrincipal sessionPrincipal, org.apache.kafka.common.security.auth.KafkaPrincipal userOrGroupPrincipal, Action action)
protected AuthorizeResult authorizeByResourceType(RequestContext requestContext, Operation op, ResourceType resourceType)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
protected Scope scope()
protected void setupAuthorizerMetrics(org.apache.kafka.common.metrics.Metrics metrics)
protected void logAuditMessage(Scope sourceScope, RequestContext requestContext, Action action, AuthorizeResult authorizeResult, AuthorizePolicy authorizePolicy)
protected org.apache.kafka.common.metrics.Metrics metrics()
protected org.apache.kafka.common.utils.Time metricsTime()