use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class CugConfiguration method activate.
//----------------------------------------------------< SCR Integration >---
@SuppressWarnings("UnusedDeclaration")
@Activate
protected void activate(Map<String, Object> properties) {
ConfigurationParameters params = ConfigurationParameters.of(properties);
setParameters(params);
supportedPaths = CugUtil.getSupportedPaths(params, mountInfoProvider);
}
use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class CugConfigurationTest method testGetPermissionProviderSupportedPaths.
@Test
public void testGetPermissionProviderSupportedPaths() {
ConfigurationParameters params = ConfigurationParameters.of(CugConstants.PARAM_CUG_ENABLED, true, CugConstants.PARAM_CUG_SUPPORTED_PATHS, "/content");
CugConfiguration cc = createConfiguration(params);
PermissionProvider pp = cc.getPermissionProvider(root, "default", ImmutableSet.<Principal>of(EveryonePrincipal.getInstance()));
assertTrue(pp instanceof CugPermissionProvider);
}
use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class CugConfigurationTest method testGetAccessControlManagerSupportedPaths.
@Test
public void testGetAccessControlManagerSupportedPaths() {
ConfigurationParameters params = ConfigurationParameters.of(CugConstants.PARAM_CUG_ENABLED, true, CugConstants.PARAM_CUG_SUPPORTED_PATHS, "/content");
CugConfiguration cc = createConfiguration(params);
AccessControlManager acMgr = cc.getAccessControlManager(root, NamePathMapper.DEFAULT);
assertTrue(acMgr instanceof CugAccessControlManager);
}
use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class CugConfigurationWithMountsTest method testDefaultMountInfoProvider.
@Test
public void testDefaultMountInfoProvider() {
CugConfiguration configuration = createConfiguration(Mounts.defaultMountInfoProvider());
ConfigurationParameters params = configuration.getParameters();
assertSame(Mounts.defaultMountInfoProvider(), params.get(CugConstants.PARAM_MOUNT_PROVIDER));
}
use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class SecurityProviderRegistration method createSecurityProvider.
private SecurityProvider createSecurityProvider(@Nonnull BundleContext context) {
InternalSecurityProvider securityProvider = new InternalSecurityProvider();
// Static, mandatory references
securityProvider.setAuthenticationConfiguration(ConfigurationInitializer.initializeConfiguration(securityProvider, authenticationConfiguration));
securityProvider.setPrivilegeConfiguration(ConfigurationInitializer.initializeConfiguration(securityProvider, privilegeConfiguration));
ConfigurationParameters userParams = ConfigurationParameters.of(ConfigurationParameters.of(UserConstants.PARAM_AUTHORIZABLE_ACTION_PROVIDER, createWhiteboardAuthorizableActionProvider()), ConfigurationParameters.of(UserConstants.PARAM_AUTHORIZABLE_NODE_NAME, createWhiteboardAuthorizableNodeName()), ConfigurationParameters.of(UserConstants.PARAM_USER_AUTHENTICATION_FACTORY, createWhiteboardUserAuthenticationFactory()));
securityProvider.setUserConfiguration(ConfigurationInitializer.initializeConfiguration(securityProvider, userConfiguration, userParams));
// Multiple, dynamic references
ConfigurationParameters restrictionParams = ConfigurationParameters.of(AccessControlConstants.PARAM_RESTRICTION_PROVIDER, createWhiteboardRestrictionProvider());
ConfigurationInitializer.initializeConfigurations(securityProvider, authorizationConfiguration, restrictionParams);
securityProvider.setAuthorizationConfiguration(authorizationConfiguration);
ConfigurationInitializer.initializeConfigurations(securityProvider, principalConfiguration, ConfigurationParameters.EMPTY);
securityProvider.setPrincipalConfiguration(principalConfiguration);
ConfigurationInitializer.initializeConfigurations(securityProvider, tokenConfiguration, ConfigurationParameters.EMPTY);
securityProvider.setTokenConfiguration(tokenConfiguration);
// Whiteboard
securityProvider.setWhiteboard(new OsgiWhiteboard(context));
return securityProvider;
}
Aggregations