use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class CugConfigurationWithMountsTest method createConfiguration.
private static CugConfiguration createConfiguration(MountInfoProvider mip) {
ConfigurationParameters params = ConfigurationParameters.of(AbstractCugTest.CUG_CONFIG, ConfigurationParameters.of(CugConstants.PARAM_MOUNT_PROVIDER, mip));
SecurityProvider sp = new CugSecurityProvider(ConfigurationParameters.of(ImmutableMap.of(AuthorizationConfiguration.NAME, params)));
return new CugConfiguration(sp);
}
use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class CugAccessControlManagerTest method testGetEffectivePoliciesNotEnabled.
@Test
public void testGetEffectivePoliciesNotEnabled() throws Exception {
cugAccessControlManager.setPolicy(SUPPORTED_PATH, createCug(SUPPORTED_PATH));
root.commit();
ConfigurationParameters config = ConfigurationParameters.of(AuthorizationConfiguration.NAME, ConfigurationParameters.of(CugConstants.PARAM_CUG_SUPPORTED_PATHS, SUPPORTED_PATHS, CugConstants.PARAM_CUG_ENABLED, false));
CugAccessControlManager acMgr = new CugAccessControlManager(root, NamePathMapper.DEFAULT, new CugSecurityProvider(config), ImmutableSet.copyOf(SUPPORTED_PATHS));
AccessControlPolicy[] policies = acMgr.getEffectivePolicies(SUPPORTED_PATH);
assertEquals(0, policies.length);
AccessControlPolicy[] effectiveOnChild = acMgr.getEffectivePolicies(SUPPORTED_PATH + "/subtree");
assertEquals(0, policies.length);
assertEquals(policies.length, effectiveOnChild.length);
}
use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class CugConfigurationTest method testGetPermissionProviderDisabled2.
@Test
public void testGetPermissionProviderDisabled2() {
ConfigurationParameters params = ConfigurationParameters.of(CugConstants.PARAM_CUG_ENABLED, false, CugConstants.PARAM_CUG_SUPPORTED_PATHS, "/content");
CugConfiguration cc = createConfiguration(params);
PermissionProvider pp = cc.getPermissionProvider(root, "default", ImmutableSet.<Principal>of(EveryonePrincipal.getInstance()));
assertSame(EmptyPermissionProvider.getInstance(), pp);
}
use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class DefaultSyncHandler method activate.
@SuppressWarnings("UnusedDeclaration")
@Activate
private void activate(Map<String, Object> properties) {
ConfigurationParameters cfg = ConfigurationParameters.of(properties);
config = DefaultSyncConfigImpl.of(cfg);
}
use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class LoginContextProviderImplTest method testGetLoginContextWithInvalidProviderConfig.
@Test
public void testGetLoginContextWithInvalidProviderConfig() throws Exception {
ConfigurationParameters params = ConfigurationParameters.of(AuthenticationConfiguration.PARAM_CONFIG_SPI_NAME, "invalid");
LoginContextProvider provider = new LoginContextProviderImpl(AuthenticationConfiguration.DEFAULT_APP_NAME, params, getContentRepository(), getSecurityProvider(), new DefaultWhiteboard());
// invalid configuration falls back to default configuration
LoginContext ctx = provider.getLoginContext(new SimpleCredentials(getTestUser().getID(), getTestUser().getID().toCharArray()), null);
ctx.login();
}
Aggregations