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;
}
use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class AccessControlAction method isBuiltInUser.
private boolean isBuiltInUser(@Nonnull Authorizable authorizable) throws RepositoryException {
ConfigurationParameters userConfig = securityProvider.getConfiguration(UserConfiguration.class).getParameters();
String userId = authorizable.getID();
return UserUtil.getAdminId(userConfig).equals(userId) || UserUtil.getAnonymousId(userConfig).equals(userId);
}
use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class ReadPolicyTest method before.
@Override
@Before
public void before() throws Exception {
super.before();
ConfigurationParameters options = getConfig(AuthorizationConfiguration.class).getParameters();
readPaths = options.getConfigValue(PermissionConstants.PARAM_READ_PATHS, PermissionConstants.DEFAULT_READ_PATHS);
}
use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class TokenConfigurationImplOSGiTest method testGetParameters.
@Test
public void testGetParameters() {
ConfigurationParameters params = tokenConfiguration.getParameters();
assertEquals(25, params.getConfigValue(TokenProvider.PARAM_TOKEN_EXPIRATION, TokenProviderImpl.DEFAULT_TOKEN_EXPIRATION).longValue());
assertEquals(4, params.getConfigValue(TokenProvider.PARAM_TOKEN_LENGTH, TokenProviderImpl.DEFAULT_KEY_SIZE).intValue());
}
Aggregations