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.
  • Method Details

    • 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