use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class QueryUtilTest method testGetSearchRootNoCommonAncestor.
@Test
public void testGetSearchRootNoCommonAncestor() {
ConfigurationParameters params = ConfigurationParameters.of(UserConstants.PARAM_USER_PATH, "/users", UserConstants.PARAM_GROUP_PATH, "/groups");
Map<AuthorizableType, String> paths = ImmutableMap.of(AuthorizableType.USER, "/users", AuthorizableType.GROUP, "/groups", AuthorizableType.AUTHORIZABLE, "/");
assertSearchRoot(paths, params);
}
use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class UserUtilTest method testGetAdminId.
@Test
public void testGetAdminId() {
String altAdminId = "test";
ConfigurationParameters config = ConfigurationParameters.of(UserConstants.PARAM_ADMIN_ID, altAdminId);
assertEquals(UserConstants.DEFAULT_ADMIN_ID, UserUtil.getAdminId(ConfigurationParameters.EMPTY));
assertEquals(altAdminId, UserUtil.getAdminId(config));
}
use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class UserUtilTest method testGetAuthorizableRootPath.
@Test
public void testGetAuthorizableRootPath() {
ConfigurationParameters config = ConfigurationParameters.of(UserConstants.PARAM_GROUP_PATH, "/groups", UserConstants.PARAM_USER_PATH, "/users");
assertEquals("/groups", UserUtil.getAuthorizableRootPath(config, AuthorizableType.GROUP));
assertEquals("/users", UserUtil.getAuthorizableRootPath(config, AuthorizableType.USER));
assertEquals("/", UserUtil.getAuthorizableRootPath(config, AuthorizableType.AUTHORIZABLE));
}
use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class CustomLoginModule method initialize.
@Override
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) {
if (options != null) {
ConfigurationParameters opts = ConfigurationParameters.of(options);
config = (config == null) ? opts : ConfigurationParameters.of(config, opts);
}
// EXERCISE
}
use of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters in project jackrabbit-oak by apache.
the class CustomExternalIdentityProvider method activate.
//----------------------------------------------------< SCR integration >---
@SuppressWarnings("UnusedDeclaration")
@Activate
public void activate(Map<String, Object> properties) {
ConfigurationParameters config = ConfigurationParameters.of(properties);
for (String entry : config.getConfigValue("externalidentities", Collections.<String>emptySet())) {
String[] strs = Text.explode(entry, ',', false);
String uid = strs[0].trim();
Set<String> declaredGroups = new HashSet<String>();
if (strs.length > 1) {
for (int i = 1; i < strs.length; i++) {
groupIds.add(strs[i]);
declaredGroups.add(strs[i]);
}
}
userGroupMap.put(uid, declaredGroups);
}
log.info("activated IDP: " + getName());
}
Aggregations