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 |
---|---|
java.util.Collection<org.apache.kafka.common.acl.AclBinding> |
aclBindings(io.confluent.security.authorizer.Scope scope,
org.apache.kafka.common.acl.AclBindingFilter aclBindingFilter,
java.util.function.Predicate<io.confluent.security.authorizer.ResourcePattern> resourceAccess)
Returns ACL bindings which match the provided filter.
|
java.util.Map<io.confluent.security.authorizer.ResourcePattern,java.util.Set<io.confluent.security.authorizer.AccessRule>> |
aclRules(io.confluent.security.authorizer.Scope scope)
Returns the ACL rules for all resources of given scope
|
java.util.Set<io.confluent.security.authorizer.AccessRule> |
aclRules(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 ACL rules corresponding to the provided principal that match
the specified resource.
|
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.Set<io.confluent.security.authorizer.Scope> |
knownScopes()
Returns all Scopes known by the backend, regardless of whether or not they actually exist.
|
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(org.apache.kafka.common.security.auth.KafkaPrincipal principal)
Returns role bindings for the given principal and the principals groups across all
known scopes.
|
java.util.Set<io.confluent.security.rbac.RoleBinding> |
rbacRoleBindings(org.apache.kafka.common.security.auth.KafkaPrincipal principal,
java.util.Set<io.confluent.security.authorizer.Scope> scopes)
Returns role bindings for the given principal and the principals groups limited to the
defined set of Scopes.
|
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 java.util.Set<io.confluent.security.rbac.RoleBinding> rbacRoleBindings(org.apache.kafka.common.security.auth.KafkaPrincipal principal)
AuthCache
rbacRoleBindings
in interface AuthCache
principal
- The the principal to lookup rolebindings forpublic java.util.Set<io.confluent.security.rbac.RoleBinding> rbacRoleBindings(org.apache.kafka.common.security.auth.KafkaPrincipal principal, java.util.Set<io.confluent.security.authorizer.Scope> scopes)
AuthCache
rbacRoleBindings
in interface AuthCache
principal
- The the principal to lookup rolebindings forpublic 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 java.util.Set<io.confluent.security.authorizer.Scope> knownScopes()
AuthCache
knownScopes
in interface AuthCache
Scopes
known by this AuthCachepublic io.confluent.security.authorizer.Scope rootScope()
AuthCache
public io.confluent.security.rbac.RbacRoles rbacRoles()
AuthCache
public java.util.Set<io.confluent.security.authorizer.AccessRule> aclRules(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)
AuthCache
public java.util.Map<io.confluent.security.authorizer.ResourcePattern,java.util.Set<io.confluent.security.authorizer.AccessRule>> aclRules(io.confluent.security.authorizer.Scope scope)
AuthCache
public java.util.Collection<org.apache.kafka.common.acl.AclBinding> aclBindings(io.confluent.security.authorizer.Scope scope, org.apache.kafka.common.acl.AclBindingFilter aclBindingFilter, java.util.function.Predicate<io.confluent.security.authorizer.ResourcePattern> resourceAccess)
AuthCache
aclBindings
in interface AuthCache
scope
- Scope of the acl search.aclBindingFilter
- AclBindingFilter to matchresourceAccess
- predicate to check resource access permissionpublic 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>