Package org.apache.nifi.authorization
Interface AccessPolicyProvider
- All Known Subinterfaces:
ConfigurableAccessPolicyProvider
public interface AccessPolicyProvider
Provides access to AccessPolicies and the configured UserGroupProvider.
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 all access policies.getAccessPolicy
(String identifier) Retrieves the policy with the given identifier.getAccessPolicy
(String resourceIdentifier, RequestAction action) Gets the access policies for the specified resource identifier and request action.Returns the UserGroupProvider for this managed Authorizer.void
initialize
(AccessPolicyProviderInitializationContext 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
-
getAccessPolicies
Retrieves all access policies. Must be non null- Returns:
- a list of policies
- Throws:
AuthorizationAccessException
- if there was an unexpected error performing the operation
-
getAccessPolicy
Retrieves the policy with the given identifier.- Parameters:
identifier
- the id of the policy to retrieve- Returns:
- the policy with the given id, or null if no matching policy exists
- Throws:
AuthorizationAccessException
- if there was an unexpected error performing the operation
-
getAccessPolicy
AccessPolicy getAccessPolicy(String resourceIdentifier, RequestAction action) throws AuthorizationAccessException Gets the access policies for the specified resource identifier and request action.- Parameters:
resourceIdentifier
- the resource identifieraction
- the request action- Returns:
- the policy matching the resouce and action, or null if no matching policy exists
- Throws:
AuthorizationAccessException
- if there was any unexpected error performing the operation
-
getUserGroupProvider
UserGroupProvider getUserGroupProvider()Returns the UserGroupProvider for this managed Authorizer. Must be non null- Returns:
- the UserGroupProvider
-
initialize
void initialize(AccessPolicyProviderInitializationContext 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.
-