Package org.apache.nifi.authorization
Interface Authorizer
- All Known Subinterfaces:
ManagedAuthorizer
- All Known Implementing Classes:
AbstractPolicyBasedAuthorizer
public interface Authorizer
Authorizes user requests.
-
Method Summary
Modifier and TypeMethodDescriptionauthorize(AuthorizationRequest request) Determines if the specified user/entity is authorized to access the specified resource within the given context.voidinitialize(AuthorizerInitializationContext initializationContext) Called immediately after instance creation for implementers to perform additional setupvoidonConfigured(AuthorizerConfigurationContext configurationContext) Called to configure the Authorizer.voidCalled immediately before instance destruction for implementers to release resources.
-
Method Details
-
authorize
Determines if the specified user/entity is authorized to access the specified resource within the given context. These details are all contained in the AuthorizationRequest. NOTE: This method 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.- Parameters:
request- The authorization request- Returns:
- the authorization result
- Throws:
AuthorizationAccessException- if unable to access the policies
-
initialize
void initialize(AuthorizerInitializationContext 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.
-