Search in sources :

Example 1 with AccessPolicyProviderLookup

use of org.apache.nifi.registry.security.authorization.AccessPolicyProviderLookup in project nifi-registry by apache.

the class FileAuthorizer method initialize.

@Override
public void initialize(final AuthorizerInitializationContext initializationContext) throws SecurityProviderCreationException {
    // initialize the user group provider
    userGroupProvider.initialize(new UserGroupProviderInitializationContext() {

        @Override
        public String getIdentifier() {
            return FILE_USER_GROUP_PROVIDER_ID;
        }

        @Override
        public UserGroupProviderLookup getUserGroupProviderLookup() {
            return (identifier) -> null;
        }
    });
    // initialize the access policy provider
    accessPolicyProvider.initialize(new AccessPolicyProviderInitializationContext() {

        @Override
        public String getIdentifier() {
            return FILE_ACCESS_POLICY_PROVIDER_ID;
        }

        @Override
        public UserGroupProviderLookup getUserGroupProviderLookup() {
            return (identifier) -> {
                if (FILE_USER_GROUP_PROVIDER_ID.equals(identifier)) {
                    return userGroupProvider;
                }
                return null;
            };
        }

        @Override
        public AccessPolicyProviderLookup getAccessPolicyProviderLookup() {
            return (identifier) -> null;
        }
    });
}
Also used : AccessPolicyProviderInitializationContext(org.apache.nifi.registry.security.authorization.AccessPolicyProviderInitializationContext) UserGroupProviderLookup(org.apache.nifi.registry.security.authorization.UserGroupProviderLookup) UserGroupProviderInitializationContext(org.apache.nifi.registry.security.authorization.UserGroupProviderInitializationContext) AccessPolicyProviderLookup(org.apache.nifi.registry.security.authorization.AccessPolicyProviderLookup)

Aggregations

AccessPolicyProviderInitializationContext (org.apache.nifi.registry.security.authorization.AccessPolicyProviderInitializationContext)1 AccessPolicyProviderLookup (org.apache.nifi.registry.security.authorization.AccessPolicyProviderLookup)1 UserGroupProviderInitializationContext (org.apache.nifi.registry.security.authorization.UserGroupProviderInitializationContext)1 UserGroupProviderLookup (org.apache.nifi.registry.security.authorization.UserGroupProviderLookup)1