Package io.helidon.security.abac.role
Class RoleValidator.RoleConfig
- java.lang.Object
-
- io.helidon.security.abac.role.RoleValidator.RoleConfig
-
- All Implemented Interfaces:
AbacValidatorConfig
- Enclosing class:
- RoleValidator
public static final class RoleValidator.RoleConfig extends Object implements AbacValidatorConfig
Attribute configuration class for Role validator.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RoleValidator.RoleConfig.Builder
A fluent API builder forRoleValidator.RoleConfig
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RoleValidator.RoleConfig.Builder
builder()
A new builder for this class instances.static RoleValidator.RoleConfig
create(Config config)
Will read roles allowed from configuration.static RoleValidator.RoleConfig
create(String... rolesAllowed)
Create roles config from an array of allowed roles.static RoleValidator.RoleConfig
create(Collection<String> rolesAllowed)
Create roles config from a collection of allowed roles.boolean
denyAll()
Returns true if access should be denied to all.boolean
permitAll()
Returns true if access should be permitted to all.Set<String>
serviceRolesAllowed()
Set of roles required for a service.Set<String>
userRolesAllowed()
Set of roles required for a user.
-
-
-
Method Detail
-
builder
public static RoleValidator.RoleConfig.Builder builder()
A new builder for this class instances.- Returns:
- builder
-
create
public static RoleValidator.RoleConfig create(Collection<String> rolesAllowed)
Create roles config from a collection of allowed roles.- Parameters:
rolesAllowed
- roles allowed- Returns:
- instance configured with the userRolesAllowed
-
create
public static RoleValidator.RoleConfig create(String... rolesAllowed)
Create roles config from an array of allowed roles.- Parameters:
rolesAllowed
- roles allowed- Returns:
- instance configured with the userRolesAllowed
-
create
public static RoleValidator.RoleConfig create(Config config)
Will read roles allowed from configuration. Format (yaml):roles-allowed: user: ["role1","role2"] service: ["role3]
- Parameters:
config
- configuration located on key "roles-allowed"- Returns:
- roles config for the configuration
-
serviceRolesAllowed
public Set<String> serviceRolesAllowed()
Set of roles required for a service.- Returns:
- set of roles
-
userRolesAllowed
public Set<String> userRolesAllowed()
Set of roles required for a user.- Returns:
- set of roles
-
permitAll
public boolean permitAll()
Returns true if access should be permitted to all.- Returns:
- permitted access to all
-
denyAll
public boolean denyAll()
Returns true if access should be denied to all.- Returns:
- denied access to all
-
-