Class ConfigurationRoleMapping

  • All Implemented Interfaces:
    org.seedstack.seed.security.RoleMapping

    public class ConfigurationRoleMapping
    extends Object
    implements org.seedstack.seed.security.RoleMapping
    Resolve the role mappings from a Configuration:
         admin = ADMIN, DEV
     
    Means that the admin local role will be given to any identified subject to which the realm(s) have given the ADMIN or DEV role.

    Roles can be given automatically to any user (whatever their real authorizations given by the realms) by using the '*' wildcard:

         reader = *
     
    Means that every identified subject will have the reader role.

    This implementation handles simple scopes:

         admin = ADMIN.{SCOPE}, DEV
     
    Means that subjects having the ADMIN.FR role from the realm(s) (like an LDAP directory) will be given the titi local role within the FR scope only.
    • Constructor Detail

      • ConfigurationRoleMapping

        public ConfigurationRoleMapping()
    • Method Detail

      • resolveRoles

        public Collection<org.seedstack.seed.security.Role> resolveRoles​(Set<String> auths,
                                                                         Collection<org.seedstack.seed.security.principals.PrincipalProvider<?>> principalProviders)
        Specified by:
        resolveRoles in interface org.seedstack.seed.security.RoleMapping