Search in sources :

Example 26 with SecurityConfiguration

use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.

the class InternalSecurityProviderTest method testSetPrivilegeConfiguration.

@Test
public void testSetPrivilegeConfiguration() {
    PrivilegeConfiguration pc = Mockito.mock(PrivilegeConfiguration.class);
    when(pc.getParameters()).thenReturn(PARAMS);
    securityProvider.setPrivilegeConfiguration(pc);
    assertSame(pc, securityProvider.getConfiguration(PrivilegeConfiguration.class));
    for (SecurityConfiguration sc : securityProvider.getConfigurations()) {
        if (sc instanceof PrivilegeConfiguration) {
            assertSame(pc, sc);
        }
    }
    assertEquals(PARAMS, securityProvider.getParameters(PrivilegeConfiguration.NAME));
}
Also used : SecurityConfiguration(org.apache.jackrabbit.oak.spi.security.SecurityConfiguration) PrivilegeConfiguration(org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConfiguration) Test(org.junit.Test)

Example 27 with SecurityConfiguration

use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.

the class InternalSecurityProviderTest method testSetUserConfiguration.

@Test
public void testSetUserConfiguration() {
    UserConfiguration uc = Mockito.mock(UserConfiguration.class);
    when(uc.getParameters()).thenReturn(PARAMS);
    securityProvider.setUserConfiguration(uc);
    assertSame(uc, securityProvider.getConfiguration(UserConfiguration.class));
    for (SecurityConfiguration sc : securityProvider.getConfigurations()) {
        if (sc instanceof UserConfiguration) {
            assertSame(uc, sc);
        }
    }
    assertEquals(PARAMS, securityProvider.getParameters(UserConfiguration.NAME));
}
Also used : SecurityConfiguration(org.apache.jackrabbit.oak.spi.security.SecurityConfiguration) UserConfiguration(org.apache.jackrabbit.oak.spi.security.user.UserConfiguration) Test(org.junit.Test)

Aggregations

SecurityConfiguration (org.apache.jackrabbit.oak.spi.security.SecurityConfiguration)27 Test (org.junit.Test)21 PrivilegeConfiguration (org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConfiguration)4 UserConfiguration (org.apache.jackrabbit.oak.spi.security.user.UserConfiguration)4 CommitHook (org.apache.jackrabbit.oak.spi.commit.CommitHook)3 EditorHook (org.apache.jackrabbit.oak.spi.commit.EditorHook)3 ConfigurationParameters (org.apache.jackrabbit.oak.spi.security.ConfigurationParameters)3 AuthenticationConfiguration (org.apache.jackrabbit.oak.spi.security.authentication.AuthenticationConfiguration)3 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)2 ArrayList (java.util.ArrayList)2 CompositeIndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.CompositeIndexEditorProvider)2 IndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.IndexEditorProvider)2 WorkspaceInitializer (org.apache.jackrabbit.oak.spi.lifecycle.WorkspaceInitializer)2 PrincipalConfiguration (org.apache.jackrabbit.oak.spi.security.principal.PrincipalConfiguration)2 Stopwatch (com.google.common.base.Stopwatch)1 IOException (java.io.IOException)1 Executor (java.util.concurrent.Executor)1 ScheduledThreadPoolExecutor (java.util.concurrent.ScheduledThreadPoolExecutor)1 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)1 Nonnull (javax.annotation.Nonnull)1