use of org.infinispan.configuration.cache.AuthorizationConfigurationBuilder in project infinispan by infinispan.
the class SecureListenerTest method createCacheManager.
@Override
protected EmbeddedCacheManager createCacheManager() throws Exception {
GlobalConfigurationBuilder global = new GlobalConfigurationBuilder();
GlobalAuthorizationConfigurationBuilder globalRoles = global.security().authorization().enable().principalRoleMapper(new IdentityRoleMapper());
ConfigurationBuilder config = TestCacheManagerFactory.getDefaultCacheConfiguration(true);
AuthorizationConfigurationBuilder authConfig = config.security().authorization().enable();
globalRoles.role("listener").permission(AuthorizationPermission.LISTEN).role("admin").permission(AuthorizationPermission.ALL);
authConfig.role("listener").role("admin");
return TestCacheManagerFactory.createCacheManager(global, config);
}
use of org.infinispan.configuration.cache.AuthorizationConfigurationBuilder in project infinispan by infinispan.
the class BaseAuthorizationTest method createCacheConfiguration.
protected ConfigurationBuilder createCacheConfiguration(GlobalConfigurationBuilder global) {
final ConfigurationBuilder config = TestCacheManagerFactory.getDefaultCacheConfiguration(true);
config.transaction().lockingMode(LockingMode.PESSIMISTIC).invocationBatching().enable();
AuthorizationConfigurationBuilder authConfig = config.security().authorization().enable();
for (AuthorizationPermission perm : AuthorizationPermission.values()) {
authConfig.role(perm.toString());
}
return config;
}
use of org.infinispan.configuration.cache.AuthorizationConfigurationBuilder in project infinispan by infinispan.
the class DynamicRBACTest method getConfigurationBuilder.
private ConfigurationBuilder getConfigurationBuilder() {
ConfigurationBuilder config = TestCacheManagerFactory.getDefaultCacheConfiguration(true);
config.clustering().cacheMode(CacheMode.DIST_SYNC);
AuthorizationConfigurationBuilder authConfig = config.security().authorization().enable();
authConfig.role("reader").role("writer").role("admin");
return config;
}
use of org.infinispan.configuration.cache.AuthorizationConfigurationBuilder in project infinispan by infinispan.
the class RolePermissionNoACLCacheTest method createCacheManager.
@Override
protected EmbeddedCacheManager createCacheManager() throws Exception {
GlobalConfigurationBuilder global = new GlobalConfigurationBuilder();
GlobalAuthorizationConfigurationBuilder globalRoles = global.security().securityCacheTimeout(0, TimeUnit.SECONDS).authorization().enable().principalRoleMapper(new IdentityRoleMapper());
ConfigurationBuilder config = TestCacheManagerFactory.getDefaultCacheConfiguration(true);
AuthorizationConfigurationBuilder authConfig = config.security().authorization().enable();
globalRoles.role("role1").permission(AuthorizationPermission.EXEC).role("role2").permission(AuthorizationPermission.EXEC).role("admin").permission(AuthorizationPermission.ALL);
authConfig.role("role1").role("role2").role("admin");
return TestCacheManagerFactory.createCacheManager(global, config);
}
use of org.infinispan.configuration.cache.AuthorizationConfigurationBuilder in project infinispan by infinispan.
the class SecureScriptingTaskManagerTest method createCacheManager.
@Override
protected EmbeddedCacheManager createCacheManager() throws Exception {
GlobalConfigurationBuilder global = new GlobalConfigurationBuilder();
GlobalAuthorizationConfigurationBuilder globalRoles = global.security().authorization().enable().principalRoleMapper(new IdentityRoleMapper());
ConfigurationBuilder config = TestCacheManagerFactory.getDefaultCacheConfiguration(true);
AuthorizationConfigurationBuilder authConfig = config.security().authorization().enable();
globalRoles.role("runner").permission(AuthorizationPermission.EXEC).permission(AuthorizationPermission.READ).permission(AuthorizationPermission.WRITE).role("pheidippides").permission(AuthorizationPermission.EXEC).permission(AuthorizationPermission.READ).permission(AuthorizationPermission.WRITE).role("admin").permission(AuthorizationPermission.ALL);
authConfig.role("runner").role("pheidippides").role("admin");
return TestCacheManagerFactory.createCacheManager(global, config);
}
Aggregations