public DelegatingConfigurableAuthorizer() { this.writableAuthorizerConfiguration = new WritableAuthorizerConfiguration(StandardRBACAuthorizer.AUTHORIZER_DESCRIPTION); this.delegate = StandardRBACAuthorizer.create(writableAuthorizerConfiguration, new SuperUserRoleMapper(writableAuthorizerConfiguration)); }
public static StandardRBACAuthorizer create(AuthorizerConfiguration configuration, final RoleMapper roleMapper) { final RunAsRoleMapper runAsRoleMapper = new RunAsRoleMapper(roleMapper); final DefaultPermissionFactory permissionFactory = new DefaultPermissionFactory( runAsRoleMapper, configuration); return new StandardRBACAuthorizer(configuration, permissionFactory, runAsRoleMapper); }
@Override public Set<String> getCallerRoles(Caller caller, Environment callEnvironment, Set<String> runAsRoles) { Set<String> mapped = roleMapper.mapRoles(caller, callEnvironment, runAsRoles); if (mapped == null) { return null; } else if (mapped.isEmpty()) { return mapped; } Set<String> result = new HashSet<String>(); for (String role : mapped) { result.add(getOfficialRoleForm(role)); } return result; }
public void shutdown() { if (delegate instanceof CustomAuthorizer) { ((CustomAuthorizer) delegate).shutdown(); } else if (delegate instanceof StandardRBACAuthorizer) { ((StandardRBACAuthorizer) delegate).shutdown(); } }
public void shutdown() { if (delegate instanceof CustomAuthorizer) { ((CustomAuthorizer) delegate).shutdown(); } else if (delegate instanceof StandardRBACAuthorizer) { ((StandardRBACAuthorizer) delegate).shutdown(); } }
public DelegatingConfigurableAuthorizer() { this.writableAuthorizerConfiguration = new WritableAuthorizerConfiguration(StandardRBACAuthorizer.AUTHORIZER_DESCRIPTION); this.delegate = StandardRBACAuthorizer.create(writableAuthorizerConfiguration, new SuperUserRoleMapper(writableAuthorizerConfiguration)); }
public void shutdown() { if (delegate instanceof CustomAuthorizer) { ((CustomAuthorizer) delegate).shutdown(); } else if (delegate instanceof StandardRBACAuthorizer) { ((StandardRBACAuthorizer) delegate).shutdown(); } }
public static StandardRBACAuthorizer create(AuthorizerConfiguration configuration, final RoleMapper roleMapper) { final RunAsRoleMapper runAsRoleMapper = new RunAsRoleMapper(roleMapper); final DefaultPermissionFactory permissionFactory = new DefaultPermissionFactory( runAsRoleMapper, configuration); return new StandardRBACAuthorizer(configuration, permissionFactory, runAsRoleMapper); }
@Override public Set<String> getCallerRoles(Caller caller, Environment callEnvironment, Set<String> runAsRoles) { Set<String> mapped = roleMapper.mapRoles(caller, callEnvironment, runAsRoles); if (mapped == null) { return null; } else if (mapped.isEmpty()) { return mapped; } Set<String> result = new HashSet<String>(); for (String role : mapped) { result.add(getOfficialRoleForm(role)); } return result; }
public DelegatingConfigurableAuthorizer() { this.writableAuthorizerConfiguration = new WritableAuthorizerConfiguration(StandardRBACAuthorizer.AUTHORIZER_DESCRIPTION); this.delegate = StandardRBACAuthorizer.create(writableAuthorizerConfiguration, new SuperUserRoleMapper(writableAuthorizerConfiguration)); }
public void setDelegate(Authorizer delegate) { assert delegate != null : "null delegate"; Authorizer currentDelegate = this.delegate; if (delegate instanceof CustomAuthorizer) { AuthorizerDescription description = ((CustomAuthorizer) delegate).setAuthorizerConfiguration(writableAuthorizerConfiguration); writableAuthorizerConfiguration.setAuthorizerDescription(description); } else { writableAuthorizerConfiguration.setAuthorizerDescription(delegate.getDescription()); } this.delegate = delegate; if (currentDelegate instanceof CustomAuthorizer) { ((CustomAuthorizer) currentDelegate).shutdown(); } else if (currentDelegate instanceof StandardRBACAuthorizer) { ((StandardRBACAuthorizer) currentDelegate).shutdown(); } }
public static StandardRBACAuthorizer create(AuthorizerConfiguration configuration, final RoleMapper roleMapper) { final RunAsRoleMapper runAsRoleMapper = new RunAsRoleMapper(roleMapper); final DefaultPermissionFactory permissionFactory = new DefaultPermissionFactory( runAsRoleMapper, configuration); return new StandardRBACAuthorizer(configuration, permissionFactory, runAsRoleMapper); }
@Override public Set<String> getCallerRoles(Caller caller, Environment callEnvironment, Set<String> runAsRoles) { Set<String> mapped = roleMapper.mapRoles(caller, callEnvironment, runAsRoles); if (mapped == null) { return null; } else if (mapped.isEmpty()) { return mapped; } Set<String> result = new HashSet<String>(); for (String role : mapped) { result.add(getOfficialRoleForm(role)); } return result; }
static void updateAuthorizer(final ModelNode value, final DelegatingConfigurableAuthorizer configurableAuthorizer) { ModelNode resolvedValue = value.isDefined() ? value : AccessAuthorizationResourceDefinition.PROVIDER.getDefaultValue(); String providerName = resolvedValue.asString().toUpperCase(Locale.ENGLISH); Provider provider = Provider.valueOf(providerName); AuthorizerConfiguration authorizerConfiguration = configurableAuthorizer.getWritableAuthorizerConfiguration(); RoleMapper roleMapper; if (provider == Provider.SIMPLE) { roleMapper = new SuperUserRoleMapper(authorizerConfiguration); } else { roleMapper = new StandardRoleMapper(configurableAuthorizer.getWritableAuthorizerConfiguration()); } Authorizer delegate = StandardRBACAuthorizer.create(configurableAuthorizer.getWritableAuthorizerConfiguration(), roleMapper); configurableAuthorizer.setDelegate(delegate); }
public void setDelegate(Authorizer delegate) { assert delegate != null : "null delegate"; Authorizer currentDelegate = this.delegate; if (delegate instanceof CustomAuthorizer) { AuthorizerDescription description = ((CustomAuthorizer) delegate).setAuthorizerConfiguration(writableAuthorizerConfiguration); writableAuthorizerConfiguration.setAuthorizerDescription(description); } else { writableAuthorizerConfiguration.setAuthorizerDescription(delegate.getDescription()); } this.delegate = delegate; if (currentDelegate instanceof CustomAuthorizer) { ((CustomAuthorizer) currentDelegate).shutdown(); } else if (currentDelegate instanceof StandardRBACAuthorizer) { ((StandardRBACAuthorizer) currentDelegate).shutdown(); } }
static void updateAuthorizer(final ModelNode value, final DelegatingConfigurableAuthorizer configurableAuthorizer) { ModelNode resolvedValue = value.isDefined() ? value : AccessAuthorizationResourceDefinition.PROVIDER.getDefaultValue(); String providerName = resolvedValue.asString().toUpperCase(Locale.ENGLISH); Provider provider = Provider.valueOf(providerName); AuthorizerConfiguration authorizerConfiguration = configurableAuthorizer.getWritableAuthorizerConfiguration(); RoleMapper roleMapper; if (provider == Provider.SIMPLE) { roleMapper = new SuperUserRoleMapper(authorizerConfiguration); } else { roleMapper = new StandardRoleMapper(configurableAuthorizer.getWritableAuthorizerConfiguration()); } Authorizer delegate = StandardRBACAuthorizer.create(configurableAuthorizer.getWritableAuthorizerConfiguration(), roleMapper); configurableAuthorizer.setDelegate(delegate); }
public void setDelegate(Authorizer delegate) { assert delegate != null : "null delegate"; Authorizer currentDelegate = this.delegate; if (delegate instanceof CustomAuthorizer) { AuthorizerDescription description = ((CustomAuthorizer) delegate).setAuthorizerConfiguration(writableAuthorizerConfiguration); writableAuthorizerConfiguration.setAuthorizerDescription(description); } else { writableAuthorizerConfiguration.setAuthorizerDescription(delegate.getDescription()); } this.delegate = delegate; if (currentDelegate instanceof CustomAuthorizer) { ((CustomAuthorizer) currentDelegate).shutdown(); } else if (currentDelegate instanceof StandardRBACAuthorizer) { ((StandardRBACAuthorizer) currentDelegate).shutdown(); } }