public class DefaultAuthCache extends java.lang.Object implements AuthCache, KeyValueStore<AuthKey,AuthValue>
Constructor and Description |
---|
DefaultAuthCache(io.confluent.security.rbac.RbacRoles rbacRoles,
io.confluent.security.authorizer.Scope rootScope) |
Modifier and Type | Method and Description |
---|---|
void |
fail(int partition,
java.lang.String errorMessage)
Sets local error for the store with the specified error message.
|
AuthValue |
get(AuthKey key)
Returns the current value associated with key if it exists or null otherwise.
|
java.util.Set<org.apache.kafka.common.security.auth.KafkaPrincipal> |
groups(org.apache.kafka.common.security.auth.KafkaPrincipal userPrincipal)
Returns the groups of the provided user principal.
|
java.util.Map<? extends AuthKey,? extends AuthValue> |
map(java.lang.String type) |
AuthValue |
put(AuthKey key,
AuthValue value)
Updates the entry for key with the specified value.
|
java.util.Set<io.confluent.security.rbac.RoleBinding> |
rbacRoleBindings(io.confluent.security.rbac.RoleBindingFilter filter)
Returns role bindings that match the specified filter.
|
java.util.Set<io.confluent.security.rbac.RoleBinding> |
rbacRoleBindings(io.confluent.security.authorizer.Scope scope)
Returns the role bindings at the specified scope.
|
io.confluent.security.rbac.RbacRoles |
rbacRoles()
Returns the RBAC role definitions associated with this cache.
|
java.util.Set<io.confluent.security.authorizer.AccessRule> |
rbacRules(io.confluent.security.authorizer.Scope resourceScope,
io.confluent.security.authorizer.ResourcePattern resource,
org.apache.kafka.common.security.auth.KafkaPrincipal userPrincipal,
java.util.Collection<org.apache.kafka.common.security.auth.KafkaPrincipal> groupPrincipals)
Returns the RBAC rules corresponding to the provided principals that match
the specified resource.
|
AuthValue |
remove(AuthKey key)
Removes the entry corresponding to the key if it is present in the store.
|
io.confluent.security.authorizer.Scope |
rootScope()
Returns the root scope of this cache.
|
MetadataStoreStatus |
status(int partition)
Status of the metadata store for the specified partition
|
io.confluent.security.rbac.UserMetadata |
userMetadata(org.apache.kafka.common.security.auth.KafkaPrincipal userPrincipal)
Returns metadata for the specified user principal if available or null if user is not known.
|
java.util.Map<org.apache.kafka.common.security.auth.KafkaPrincipal,io.confluent.security.rbac.UserMetadata> |
users()
Returns user metadata for all users.
|
public DefaultAuthCache(io.confluent.security.rbac.RbacRoles rbacRoles, io.confluent.security.authorizer.Scope rootScope)
public java.util.Set<org.apache.kafka.common.security.auth.KafkaPrincipal> groups(org.apache.kafka.common.security.auth.KafkaPrincipal userPrincipal)
public java.util.Set<io.confluent.security.authorizer.AccessRule> rbacRules(io.confluent.security.authorizer.Scope resourceScope, io.confluent.security.authorizer.ResourcePattern resource, org.apache.kafka.common.security.auth.KafkaPrincipal userPrincipal, java.util.Collection<org.apache.kafka.common.security.auth.KafkaPrincipal> groupPrincipals)
public java.util.Set<io.confluent.security.rbac.RoleBinding> rbacRoleBindings(io.confluent.security.authorizer.Scope scope)
AuthCache
rbacRoleBindings
in interface AuthCache
scope
- Scope for which role bindings are requested.public java.util.Set<io.confluent.security.rbac.RoleBinding> rbacRoleBindings(io.confluent.security.rbac.RoleBindingFilter filter)
AuthCache
rbacRoleBindings
in interface AuthCache
filter
- The filter used for matching role bindingspublic io.confluent.security.rbac.UserMetadata userMetadata(org.apache.kafka.common.security.auth.KafkaPrincipal userPrincipal)
AuthCache
userMetadata
in interface AuthCache
userPrincipal
- KafkaPrincipal of userpublic java.util.Map<org.apache.kafka.common.security.auth.KafkaPrincipal,io.confluent.security.rbac.UserMetadata> users()
AuthCache
public io.confluent.security.authorizer.Scope rootScope()
AuthCache
public io.confluent.security.rbac.RbacRoles rbacRoles()
AuthCache
public AuthValue get(AuthKey key)
KeyValueStore
get
in interface KeyValueStore<AuthKey,AuthValue>
public AuthValue put(AuthKey key, AuthValue value)
KeyValueStore
put
in interface KeyValueStore<AuthKey,AuthValue>
public AuthValue remove(AuthKey key)
KeyValueStore
remove
in interface KeyValueStore<AuthKey,AuthValue>
public java.util.Map<? extends AuthKey,? extends AuthValue> map(java.lang.String type)
map
in interface KeyValueStore<AuthKey,AuthValue>
public void fail(int partition, java.lang.String errorMessage)
KeyValueStore
fail
in interface KeyValueStore<AuthKey,AuthValue>
public MetadataStoreStatus status(int partition)
KeyValueStore
status
in interface KeyValueStore<AuthKey,AuthValue>