Search in sources :

Example 1 with Group

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

the class LdapUserGroupProviderTest method testSearchGroupsWithFilter.

@Test
public void testSearchGroupsWithFilter() throws Exception {
    final AuthorizerConfigurationContext configurationContext = getBaseConfiguration(null, GROUP_SEARCH_BASE);
    when(configurationContext.getProperty(PROP_GROUP_MEMBER_ATTRIBUTE)).thenReturn(new StandardPropertyValue("member"));
    when(configurationContext.getProperty(PROP_GROUP_SEARCH_FILTER)).thenReturn(new StandardPropertyValue("(cn=admins)"));
    ldapUserGroupProvider.onConfigured(configurationContext);
    final Set<Group> groups = ldapUserGroupProvider.getGroups();
    assertEquals(1, groups.size());
    assertEquals(1, groups.stream().filter(group -> "cn=admins,ou=groups,o=nifi".equals(group.getName())).count());
}
Also used : Group(org.apache.nifi.registry.security.authorization.Group) StandardPropertyValue(org.apache.nifi.registry.util.StandardPropertyValue) AuthorizerConfigurationContext(org.apache.nifi.registry.security.authorization.AuthorizerConfigurationContext) Test(org.junit.Test)

Example 2 with Group

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

the class LdapUserGroupProviderTest method testSearchUsersAndGroupsNoMembership.

@Test
public void testSearchUsersAndGroupsNoMembership() throws Exception {
    final AuthorizerConfigurationContext configurationContext = getBaseConfiguration(USER_SEARCH_BASE, GROUP_SEARCH_BASE);
    ldapUserGroupProvider.onConfigured(configurationContext);
    assertEquals(8, ldapUserGroupProvider.getUsers().size());
    final Set<Group> groups = ldapUserGroupProvider.getGroups();
    assertEquals(4, groups.size());
    groups.forEach(group -> assertTrue(group.getUsers().isEmpty()));
}
Also used : Group(org.apache.nifi.registry.security.authorization.Group) AuthorizerConfigurationContext(org.apache.nifi.registry.security.authorization.AuthorizerConfigurationContext) Test(org.junit.Test)

Example 3 with Group

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

the class LdapUserGroupProviderTest method testSearchUsersAndGroupsMembershipThroughUsersAndGroups.

@Test
public void testSearchUsersAndGroupsMembershipThroughUsersAndGroups() throws Exception {
    final AuthorizerConfigurationContext configurationContext = getBaseConfiguration(USER_SEARCH_BASE, GROUP_SEARCH_BASE);
    when(configurationContext.getProperty(PROP_USER_IDENTITY_ATTRIBUTE)).thenReturn(new StandardPropertyValue("uid"));
    // using description in lieu of memberof
    when(configurationContext.getProperty(PROP_USER_GROUP_ATTRIBUTE)).thenReturn(new StandardPropertyValue("description"));
    when(configurationContext.getProperty(PROP_GROUP_MEMBER_ATTRIBUTE)).thenReturn(new StandardPropertyValue("member"));
    when(configurationContext.getProperty(PROP_GROUP_NAME_ATTRIBUTE)).thenReturn(new StandardPropertyValue("cn"));
    ldapUserGroupProvider.onConfigured(configurationContext);
    assertEquals(8, ldapUserGroupProvider.getUsers().size());
    final Set<Group> groups = ldapUserGroupProvider.getGroups();
    assertEquals(4, groups.size());
    final Group admins = groups.stream().filter(group -> "admins".equals(group.getName())).findFirst().orElse(null);
    assertNotNull(admins);
    assertEquals(2, admins.getUsers().size());
    assertEquals(2, admins.getUsers().stream().map(userIdentifier -> ldapUserGroupProvider.getUser(userIdentifier)).filter(user -> "user1".equals(user.getIdentity()) || "user3".equals(user.getIdentity())).count());
    final Group readOnly = groups.stream().filter(group -> "read-only".equals(group.getName())).findFirst().orElse(null);
    assertNotNull(readOnly);
    assertEquals(1, readOnly.getUsers().size());
    assertEquals(1, readOnly.getUsers().stream().map(userIdentifier -> ldapUserGroupProvider.getUser(userIdentifier)).filter(user -> "user2".equals(user.getIdentity())).count());
    final Group team1 = groups.stream().filter(group -> "team1".equals(group.getName())).findFirst().orElse(null);
    assertNotNull(team1);
    assertEquals(3, team1.getUsers().size());
    assertEquals(3, team1.getUsers().stream().map(userIdentifier -> ldapUserGroupProvider.getUser(userIdentifier)).filter(user -> "user1".equals(user.getIdentity()) || "user4".equals(user.getIdentity()) || "user5".equals(user.getIdentity())).count());
    final Group team2 = groups.stream().filter(group -> "team2".equals(group.getName())).findFirst().orElse(null);
    assertNotNull(team2);
    assertEquals(3, team2.getUsers().size());
    assertEquals(3, team2.getUsers().stream().map(userIdentifier -> ldapUserGroupProvider.getUser(userIdentifier)).filter(user -> "user1".equals(user.getIdentity()) || "user6".equals(user.getIdentity()) || "user7".equals(user.getIdentity())).count());
}
Also used : CreateTransport(org.apache.directory.server.annotations.CreateTransport) PROP_URL(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_URL) PROP_USER_GROUP_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_GROUP_ATTRIBUTE) PROP_USER_IDENTITY_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_IDENTITY_ATTRIBUTE) PROP_CONNECT_TIMEOUT(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_CONNECT_TIMEOUT) PROP_USER_SEARCH_FILTER(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_SEARCH_FILTER) CreateLdapServer(org.apache.directory.server.annotations.CreateLdapServer) CreatePartition(org.apache.directory.server.core.annotations.CreatePartition) Set(java.util.Set) PROP_PAGE_SIZE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_PAGE_SIZE) LdapAuthenticationStrategy(org.apache.nifi.registry.security.ldap.LdapAuthenticationStrategy) PROP_GROUP_SEARCH_SCOPE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_SEARCH_SCOPE) PROP_GROUP_OBJECT_CLASS(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_OBJECT_CLASS) Assert.assertFalse(org.junit.Assert.assertFalse) PROP_GROUP_MEMBER_REFERENCED_USER_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_MEMBER_REFERENCED_USER_ATTRIBUTE) PROP_SYNC_INTERVAL(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_SYNC_INTERVAL) Mockito.mock(org.mockito.Mockito.mock) ReferralStrategy(org.apache.nifi.registry.security.ldap.ReferralStrategy) PROP_GROUP_SEARCH_FILTER(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_SEARCH_FILTER) PROP_USER_SEARCH_SCOPE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_SEARCH_SCOPE) RunWith(org.junit.runner.RunWith) CreateDS(org.apache.directory.server.core.annotations.CreateDS) Matchers.anyString(org.mockito.Matchers.anyString) PROP_GROUP_MEMBER_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_MEMBER_ATTRIBUTE) ApplyLdifFiles(org.apache.directory.server.core.annotations.ApplyLdifFiles) Group(org.apache.nifi.registry.security.authorization.Group) PROP_GROUP_NAME_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_NAME_ATTRIBUTE) PROP_USER_GROUP_REFERENCED_GROUP_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_GROUP_REFERENCED_GROUP_ATTRIBUTE) PROP_USER_SEARCH_BASE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_SEARCH_BASE) UserGroupProviderInitializationContext(org.apache.nifi.registry.security.authorization.UserGroupProviderInitializationContext) NiFiRegistryProperties(org.apache.nifi.registry.properties.NiFiRegistryProperties) UserAndGroups(org.apache.nifi.registry.security.authorization.UserAndGroups) FrameworkRunner(org.apache.directory.server.core.integ.FrameworkRunner) Before(org.junit.Before) PROP_AUTHENTICATION_STRATEGY(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_AUTHENTICATION_STRATEGY) Properties(java.util.Properties) PROP_USER_OBJECT_CLASS(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_OBJECT_CLASS) SecurityProviderCreationException(org.apache.nifi.registry.security.exception.SecurityProviderCreationException) Assert.assertNotNull(org.junit.Assert.assertNotNull) PROP_MANAGER_DN(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_MANAGER_DN) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) StandardPropertyValue(org.apache.nifi.registry.util.StandardPropertyValue) PROP_MANAGER_PASSWORD(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_MANAGER_PASSWORD) Mockito(org.mockito.Mockito) AuthorizerConfigurationContext(org.apache.nifi.registry.security.authorization.AuthorizerConfigurationContext) PROP_REFERRAL_STRATEGY(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_REFERRAL_STRATEGY) PROP_READ_TIMEOUT(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_READ_TIMEOUT) AbstractLdapTestUnit(org.apache.directory.server.core.integ.AbstractLdapTestUnit) PROP_GROUP_SEARCH_BASE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_SEARCH_BASE) Assert.assertEquals(org.junit.Assert.assertEquals) Group(org.apache.nifi.registry.security.authorization.Group) StandardPropertyValue(org.apache.nifi.registry.util.StandardPropertyValue) AuthorizerConfigurationContext(org.apache.nifi.registry.security.authorization.AuthorizerConfigurationContext) Test(org.junit.Test)

Example 4 with Group

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

the class LdapUserGroupProviderTest method testReferencedUserUsingReferencedAttribute.

@Test
public void testReferencedUserUsingReferencedAttribute() throws Exception {
    final AuthorizerConfigurationContext configurationContext = getBaseConfiguration("ou=users-2,o=nifi", "ou=groups-2,o=nifi");
    when(configurationContext.getProperty(PROP_USER_IDENTITY_ATTRIBUTE)).thenReturn(new StandardPropertyValue("sn"));
    // using room due to reqs of groupOfNames
    when(configurationContext.getProperty(PROP_GROUP_OBJECT_CLASS)).thenReturn(new StandardPropertyValue("room"));
    // using description in lieu of member
    when(configurationContext.getProperty(PROP_GROUP_MEMBER_ATTRIBUTE)).thenReturn(new StandardPropertyValue("description"));
    when(configurationContext.getProperty(PROP_GROUP_NAME_ATTRIBUTE)).thenReturn(new StandardPropertyValue("cn"));
    // does not need to be the same as user id attr
    when(configurationContext.getProperty(PROP_GROUP_MEMBER_REFERENCED_USER_ATTRIBUTE)).thenReturn(new StandardPropertyValue("uid"));
    ldapUserGroupProvider.onConfigured(configurationContext);
    final Set<Group> groups = ldapUserGroupProvider.getGroups();
    assertEquals(1, groups.size());
    final Group team3 = groups.stream().filter(group -> "team3".equals(group.getName())).findFirst().orElse(null);
    assertNotNull(team3);
    assertEquals(1, team3.getUsers().size());
    assertEquals(1, team3.getUsers().stream().map(userIdentifier -> ldapUserGroupProvider.getUser(userIdentifier)).filter(user -> "User9".equals(user.getIdentity())).count());
}
Also used : CreateTransport(org.apache.directory.server.annotations.CreateTransport) PROP_URL(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_URL) PROP_USER_GROUP_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_GROUP_ATTRIBUTE) PROP_USER_IDENTITY_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_IDENTITY_ATTRIBUTE) PROP_CONNECT_TIMEOUT(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_CONNECT_TIMEOUT) PROP_USER_SEARCH_FILTER(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_SEARCH_FILTER) CreateLdapServer(org.apache.directory.server.annotations.CreateLdapServer) CreatePartition(org.apache.directory.server.core.annotations.CreatePartition) Set(java.util.Set) PROP_PAGE_SIZE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_PAGE_SIZE) LdapAuthenticationStrategy(org.apache.nifi.registry.security.ldap.LdapAuthenticationStrategy) PROP_GROUP_SEARCH_SCOPE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_SEARCH_SCOPE) PROP_GROUP_OBJECT_CLASS(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_OBJECT_CLASS) Assert.assertFalse(org.junit.Assert.assertFalse) PROP_GROUP_MEMBER_REFERENCED_USER_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_MEMBER_REFERENCED_USER_ATTRIBUTE) PROP_SYNC_INTERVAL(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_SYNC_INTERVAL) Mockito.mock(org.mockito.Mockito.mock) ReferralStrategy(org.apache.nifi.registry.security.ldap.ReferralStrategy) PROP_GROUP_SEARCH_FILTER(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_SEARCH_FILTER) PROP_USER_SEARCH_SCOPE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_SEARCH_SCOPE) RunWith(org.junit.runner.RunWith) CreateDS(org.apache.directory.server.core.annotations.CreateDS) Matchers.anyString(org.mockito.Matchers.anyString) PROP_GROUP_MEMBER_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_MEMBER_ATTRIBUTE) ApplyLdifFiles(org.apache.directory.server.core.annotations.ApplyLdifFiles) Group(org.apache.nifi.registry.security.authorization.Group) PROP_GROUP_NAME_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_NAME_ATTRIBUTE) PROP_USER_GROUP_REFERENCED_GROUP_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_GROUP_REFERENCED_GROUP_ATTRIBUTE) PROP_USER_SEARCH_BASE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_SEARCH_BASE) UserGroupProviderInitializationContext(org.apache.nifi.registry.security.authorization.UserGroupProviderInitializationContext) NiFiRegistryProperties(org.apache.nifi.registry.properties.NiFiRegistryProperties) UserAndGroups(org.apache.nifi.registry.security.authorization.UserAndGroups) FrameworkRunner(org.apache.directory.server.core.integ.FrameworkRunner) Before(org.junit.Before) PROP_AUTHENTICATION_STRATEGY(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_AUTHENTICATION_STRATEGY) Properties(java.util.Properties) PROP_USER_OBJECT_CLASS(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_OBJECT_CLASS) SecurityProviderCreationException(org.apache.nifi.registry.security.exception.SecurityProviderCreationException) Assert.assertNotNull(org.junit.Assert.assertNotNull) PROP_MANAGER_DN(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_MANAGER_DN) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) StandardPropertyValue(org.apache.nifi.registry.util.StandardPropertyValue) PROP_MANAGER_PASSWORD(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_MANAGER_PASSWORD) Mockito(org.mockito.Mockito) AuthorizerConfigurationContext(org.apache.nifi.registry.security.authorization.AuthorizerConfigurationContext) PROP_REFERRAL_STRATEGY(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_REFERRAL_STRATEGY) PROP_READ_TIMEOUT(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_READ_TIMEOUT) AbstractLdapTestUnit(org.apache.directory.server.core.integ.AbstractLdapTestUnit) PROP_GROUP_SEARCH_BASE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_SEARCH_BASE) Assert.assertEquals(org.junit.Assert.assertEquals) Group(org.apache.nifi.registry.security.authorization.Group) StandardPropertyValue(org.apache.nifi.registry.util.StandardPropertyValue) AuthorizerConfigurationContext(org.apache.nifi.registry.security.authorization.AuthorizerConfigurationContext) Test(org.junit.Test)

Example 5 with Group

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

the class LdapUserGroupProviderTest method testSearchUsersAndGroupsMembershipThroughGroups.

@Test
public void testSearchUsersAndGroupsMembershipThroughGroups() throws Exception {
    final AuthorizerConfigurationContext configurationContext = getBaseConfiguration(USER_SEARCH_BASE, GROUP_SEARCH_BASE);
    when(configurationContext.getProperty(PROP_USER_IDENTITY_ATTRIBUTE)).thenReturn(new StandardPropertyValue("uid"));
    when(configurationContext.getProperty(PROP_GROUP_MEMBER_ATTRIBUTE)).thenReturn(new StandardPropertyValue("member"));
    when(configurationContext.getProperty(PROP_GROUP_NAME_ATTRIBUTE)).thenReturn(new StandardPropertyValue("cn"));
    ldapUserGroupProvider.onConfigured(configurationContext);
    assertEquals(8, ldapUserGroupProvider.getUsers().size());
    final Set<Group> groups = ldapUserGroupProvider.getGroups();
    assertEquals(4, groups.size());
    final Group admins = groups.stream().filter(group -> "admins".equals(group.getName())).findFirst().orElse(null);
    assertNotNull(admins);
    assertEquals(2, admins.getUsers().size());
    assertEquals(2, admins.getUsers().stream().map(userIdentifier -> ldapUserGroupProvider.getUser(userIdentifier)).filter(user -> "user1".equals(user.getIdentity()) || "user3".equals(user.getIdentity())).count());
    final Group readOnly = groups.stream().filter(group -> "read-only".equals(group.getName())).findFirst().orElse(null);
    assertNotNull(readOnly);
    assertEquals(1, readOnly.getUsers().size());
    assertEquals(1, readOnly.getUsers().stream().map(userIdentifier -> ldapUserGroupProvider.getUser(userIdentifier)).filter(user -> "user2".equals(user.getIdentity())).count());
    final Group team1 = groups.stream().filter(group -> "team1".equals(group.getName())).findFirst().orElse(null);
    assertNotNull(team1);
    assertEquals(1, team1.getUsers().size());
    assertEquals(1, team1.getUsers().stream().map(userIdentifier -> ldapUserGroupProvider.getUser(userIdentifier)).filter(user -> "user1".equals(user.getIdentity())).count());
    final Group team2 = groups.stream().filter(group -> "team2".equals(group.getName())).findFirst().orElse(null);
    assertNotNull(team2);
    assertEquals(1, team2.getUsers().size());
    assertEquals(1, team2.getUsers().stream().map(userIdentifier -> ldapUserGroupProvider.getUser(userIdentifier)).filter(user -> "user1".equals(user.getIdentity())).count());
}
Also used : CreateTransport(org.apache.directory.server.annotations.CreateTransport) PROP_URL(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_URL) PROP_USER_GROUP_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_GROUP_ATTRIBUTE) PROP_USER_IDENTITY_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_IDENTITY_ATTRIBUTE) PROP_CONNECT_TIMEOUT(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_CONNECT_TIMEOUT) PROP_USER_SEARCH_FILTER(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_SEARCH_FILTER) CreateLdapServer(org.apache.directory.server.annotations.CreateLdapServer) CreatePartition(org.apache.directory.server.core.annotations.CreatePartition) Set(java.util.Set) PROP_PAGE_SIZE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_PAGE_SIZE) LdapAuthenticationStrategy(org.apache.nifi.registry.security.ldap.LdapAuthenticationStrategy) PROP_GROUP_SEARCH_SCOPE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_SEARCH_SCOPE) PROP_GROUP_OBJECT_CLASS(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_OBJECT_CLASS) Assert.assertFalse(org.junit.Assert.assertFalse) PROP_GROUP_MEMBER_REFERENCED_USER_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_MEMBER_REFERENCED_USER_ATTRIBUTE) PROP_SYNC_INTERVAL(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_SYNC_INTERVAL) Mockito.mock(org.mockito.Mockito.mock) ReferralStrategy(org.apache.nifi.registry.security.ldap.ReferralStrategy) PROP_GROUP_SEARCH_FILTER(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_SEARCH_FILTER) PROP_USER_SEARCH_SCOPE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_SEARCH_SCOPE) RunWith(org.junit.runner.RunWith) CreateDS(org.apache.directory.server.core.annotations.CreateDS) Matchers.anyString(org.mockito.Matchers.anyString) PROP_GROUP_MEMBER_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_MEMBER_ATTRIBUTE) ApplyLdifFiles(org.apache.directory.server.core.annotations.ApplyLdifFiles) Group(org.apache.nifi.registry.security.authorization.Group) PROP_GROUP_NAME_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_NAME_ATTRIBUTE) PROP_USER_GROUP_REFERENCED_GROUP_ATTRIBUTE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_GROUP_REFERENCED_GROUP_ATTRIBUTE) PROP_USER_SEARCH_BASE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_SEARCH_BASE) UserGroupProviderInitializationContext(org.apache.nifi.registry.security.authorization.UserGroupProviderInitializationContext) NiFiRegistryProperties(org.apache.nifi.registry.properties.NiFiRegistryProperties) UserAndGroups(org.apache.nifi.registry.security.authorization.UserAndGroups) FrameworkRunner(org.apache.directory.server.core.integ.FrameworkRunner) Before(org.junit.Before) PROP_AUTHENTICATION_STRATEGY(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_AUTHENTICATION_STRATEGY) Properties(java.util.Properties) PROP_USER_OBJECT_CLASS(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_USER_OBJECT_CLASS) SecurityProviderCreationException(org.apache.nifi.registry.security.exception.SecurityProviderCreationException) Assert.assertNotNull(org.junit.Assert.assertNotNull) PROP_MANAGER_DN(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_MANAGER_DN) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) StandardPropertyValue(org.apache.nifi.registry.util.StandardPropertyValue) PROP_MANAGER_PASSWORD(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_MANAGER_PASSWORD) Mockito(org.mockito.Mockito) AuthorizerConfigurationContext(org.apache.nifi.registry.security.authorization.AuthorizerConfigurationContext) PROP_REFERRAL_STRATEGY(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_REFERRAL_STRATEGY) PROP_READ_TIMEOUT(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_READ_TIMEOUT) AbstractLdapTestUnit(org.apache.directory.server.core.integ.AbstractLdapTestUnit) PROP_GROUP_SEARCH_BASE(org.apache.nifi.registry.security.ldap.tenants.LdapUserGroupProvider.PROP_GROUP_SEARCH_BASE) Assert.assertEquals(org.junit.Assert.assertEquals) Group(org.apache.nifi.registry.security.authorization.Group) StandardPropertyValue(org.apache.nifi.registry.util.StandardPropertyValue) AuthorizerConfigurationContext(org.apache.nifi.registry.security.authorization.AuthorizerConfigurationContext) Test(org.junit.Test)

Aggregations

Group (org.apache.nifi.registry.security.authorization.Group)26 AuthorizerConfigurationContext (org.apache.nifi.registry.security.authorization.AuthorizerConfigurationContext)14 Test (org.junit.Test)13 StandardPropertyValue (org.apache.nifi.registry.util.StandardPropertyValue)12 Set (java.util.Set)11 UserAndGroups (org.apache.nifi.registry.security.authorization.UserAndGroups)11 NiFiRegistryProperties (org.apache.nifi.registry.properties.NiFiRegistryProperties)9 User (org.apache.nifi.registry.security.authorization.User)9 UserGroupProviderInitializationContext (org.apache.nifi.registry.security.authorization.UserGroupProviderInitializationContext)9 SecurityProviderCreationException (org.apache.nifi.registry.security.exception.SecurityProviderCreationException)9 LdapAuthenticationStrategy (org.apache.nifi.registry.security.ldap.LdapAuthenticationStrategy)9 ReferralStrategy (org.apache.nifi.registry.security.ldap.ReferralStrategy)9 Properties (java.util.Properties)8 CreateLdapServer (org.apache.directory.server.annotations.CreateLdapServer)8 CreateTransport (org.apache.directory.server.annotations.CreateTransport)8 ApplyLdifFiles (org.apache.directory.server.core.annotations.ApplyLdifFiles)8 CreateDS (org.apache.directory.server.core.annotations.CreateDS)8 CreatePartition (org.apache.directory.server.core.annotations.CreatePartition)8 AbstractLdapTestUnit (org.apache.directory.server.core.integ.AbstractLdapTestUnit)8 FrameworkRunner (org.apache.directory.server.core.integ.FrameworkRunner)8