Package org.apache.nifi.authorization
Interface UserGroupProvider
- All Known Subinterfaces:
ConfigurableUserGroupProvider
public interface UserGroupProvider
Provides access to Users and Groups.
NOTE: Extensions will be called often and frequently. Because of this, if the underlying implementation needs to
make remote calls or expensive calculations those should probably be done asynchronously and/or cache the results.
Additionally, extensions need to be thread safe.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves a Group by id.default Group
getGroupByName
(String name) Retrieves a Group by name.Retrieves all groups.Retrieves the user with the given identifier.getUserAndGroups
(String identity) Gets a user and their groups.getUserByIdentity
(String identity) Retrieves the user with the given identity.getUsers()
Retrieves all users.void
initialize
(UserGroupProviderInitializationContext initializationContext) Called immediately after instance creation for implementers to perform additional setupvoid
onConfigured
(AuthorizerConfigurationContext configurationContext) Called to configure the Authorizer.void
Called immediately before instance destruction for implementers to release resources.
-
Method Details
-
getUsers
Retrieves all users. Must be non null- Returns:
- a list of users
- Throws:
AuthorizationAccessException
- if there was an unexpected error performing the operation
-
getUser
Retrieves the user with the given identifier.- Parameters:
identifier
- the id of the user to retrieve- Returns:
- the user with the given id, or null if no matching user was found
- Throws:
AuthorizationAccessException
- if there was an unexpected error performing the operation
-
getUserByIdentity
Retrieves the user with the given identity.- Parameters:
identity
- the identity of the user to retrieve- Returns:
- the user with the given identity, or null if no matching user was found
- Throws:
AuthorizationAccessException
- if there was an unexpected error performing the operation
-
getGroups
Retrieves all groups. Must be non null- Returns:
- a list of groups
- Throws:
AuthorizationAccessException
- if there was an unexpected error performing the operation
-
getGroup
Retrieves a Group by id.- Parameters:
identifier
- the identifier of the Group to retrieve- Returns:
- the Group with the given identifier, or null if no matching group was found
- Throws:
AuthorizationAccessException
- if there was an unexpected error performing the operation
-
getGroupByName
Retrieves a Group by name.- Parameters:
name
- the name of the group to retrieve- Returns:
- the Group with the given name, or null if no matching group was found
- Throws:
AuthorizationAccessException
- if there was an unexpected error performing the operation
-
getUserAndGroups
Gets a user and their groups. Must be non null. If the user is not known the UserAndGroups.getUser() and UserAndGroups.getGroups() should return null- Returns:
- the UserAndGroups for the specified identity
- Throws:
AuthorizationAccessException
- if there was an unexpected error performing the operation
-
initialize
void initialize(UserGroupProviderInitializationContext initializationContext) throws AuthorizerCreationException Called immediately after instance creation for implementers to perform additional setup- Parameters:
initializationContext
- in which to initialize- Throws:
AuthorizerCreationException
-
onConfigured
void onConfigured(AuthorizerConfigurationContext configurationContext) throws AuthorizerCreationException Called to configure the Authorizer.- Parameters:
configurationContext
- at the time of configuration- Throws:
AuthorizerCreationException
- for any issues configuring the provider
-
preDestruction
Called immediately before instance destruction for implementers to release resources.- Throws:
AuthorizerDestructionException
- If pre-destruction fails.
-