Class RoleMapper


  • public class RoleMapper
    extends Object
    Holds and maintains the RoleMapper configuration and performs the mapping.
    • Constructor Detail

      • RoleMapper

        public RoleMapper​(org.swisspush.gateleen.core.storage.ResourceStorage storage,
                          String securityRoot,
                          Map<String,​Object> properties)
        Holds the list of all configured RoleMappings and executes the mapping
        Parameters:
        storage - Reference to the storage to retrieve the RoleMappings from
        securityRoot - Base url to retrieve the rolemapper config resource from (no trailing slash expected nor necessary)
        properties - The system properties given to the application, used to exctract the Environement where we are running in
    • Method Detail

      • configUpdate

        public void configUpdate()
        Retrieve the configured RoleMapper from Storage and populate the corresponding List of mappers.
      • mapRoles

        public Map<String,​RoleMapper.MappedRole> mapRoles​(Set<String> roles)
        Maps the received roles from http header according the rolemapper rules and return the set of mapped roles including the initial list of roles according to the given mapping rule sets.
        Parameters:
        roles - The roles to be mapped and enriched according to the rolemapper object
        Returns:
        The resulting list of initial plus mapped roles