Package org.apache.nifi.authorization
Class AuthorizerFactory
java.lang.Object
org.apache.nifi.authorization.AuthorizerFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanallGroupUsersExist(UserGroupProvider userGroupProvider, Group group) Check that all users in the group exist.private static voidaudit(Authorizer authorizer, AuthorizationRequest request, AuthorizationResult result) private static booleangroupExists(UserGroupProvider userGroupProvider, String identifier, String identity) Checks if another group exists with the same identity.static AuthorizerinstallIntegrityChecks(Authorizer baseAuthorizer) private static booleanpolicyExists(AccessPolicyProvider accessPolicyProvider, AccessPolicy checkAccessPolicy) Checks if another policy exists with the same resource and action as the given policy.private static booleanuserExists(UserGroupProvider userGroupProvider, String identifier, String identity) Checks if another user exists with the same identity.static AuthorizerwithNarLoader(Authorizer baseAuthorizer, ClassLoader classLoader) Decorates the base authorizer to ensure the nar context classloader is used when invoking the underlying methods.
-
Constructor Details
-
AuthorizerFactory
private AuthorizerFactory()
-
-
Method Details
-
policyExists
private static boolean policyExists(AccessPolicyProvider accessPolicyProvider, AccessPolicy checkAccessPolicy) Checks if another policy exists with the same resource and action as the given policy.- Parameters:
checkAccessPolicy- an access policy being checked- Returns:
- true if another access policy exists with the same resource and action, false otherwise
-
userExists
private static boolean userExists(UserGroupProvider userGroupProvider, String identifier, String identity) Checks if another user exists with the same identity.- Parameters:
userGroupProvider- the userGroupProvider to use to lookup the useridentifier- identity of the useridentity- identity of the user- Returns:
- true if another user exists with the same identity, false otherwise
-
groupExists
private static boolean groupExists(UserGroupProvider userGroupProvider, String identifier, String identity) Checks if another group exists with the same identity.- Parameters:
userGroupProvider- the userGroupProvider to use to lookup the groupidentifier- identity of the groupidentity- identity of the group- Returns:
- true if another group exists with the same identity, false otherwise
-
allGroupUsersExist
Check that all users in the group exist.- Parameters:
userGroupProvider- the userGroupProvider to use to lookup the usersgroup- the group whose users will be checked for existence.- Returns:
- true if another user exists with the same identity, false otherwise
-
audit
private static void audit(Authorizer authorizer, AuthorizationRequest request, AuthorizationResult result) -
installIntegrityChecks
-
withNarLoader
Decorates the base authorizer to ensure the nar context classloader is used when invoking the underlying methods.- Parameters:
baseAuthorizer- base authorizer- Returns:
- authorizer
-