Class IdRepoUtils


  • public class IdRepoUtils
    extends Object
    This class provides common utility functions for IdRepo.
    • Constructor Detail

      • IdRepoUtils

        public IdRepoUtils()
    • Method Detail

      • getAttrMapWithoutPasswordAttrs

        public static Map<String,​?> getAttrMapWithoutPasswordAttrs​(Map<String,​?> attrMap,
                                                                         Set<String> pwdAttrs)
        Returns an attribute map with all the password attributes being masked.
        Parameters:
        attrMap - an attribute map
        pwdAttrs - a set of password attribute names
        Returns:
        an attribute map with all the password attributes being masked.
      • hasIdRepoSchema

        public static boolean hasIdRepoSchema​(String idRepoType)
        Return true if specified IdRepo type has schemas.
        Parameters:
        idRepoType - IdRepo type
        Returns:
        true if specified IdRepo type has schemas
      • loadIdRepoSchema

        public static void loadIdRepoSchema​(SSOToken ssoToken,
                                            String idRepoName,
                                            String realm,
                                            jakarta.servlet.ServletContext servletCtx)
                                     throws IdRepoException
        Loads schema to specified IdRepo.
        Parameters:
        ssoToken - single sign on token of authenticated user identity
        idRepoName - IdRepo name
        realm - the realm
        servletCtx - the servlet context
        Throws:
        IdRepoException - If schema can't be loaded or there are repository related error conditions.
      • parseSupportedTypesAndOperations

        public static Map<IdType,​Set<IdOperation>> parseSupportedTypesAndOperations​(Set<String> typesAndOperations)
        Parses the incoming types and operations in string format to their domain object equivalent. For example: user=read,edit,service,delete will be turned into USER identity type with READ, EDIT, SERVICE, DELETE operations.
        Parameters:
        typesAndOperations - The parsable type and operation lines (each line represents an identity type.
        Returns:
        The parsed identity types and operation mappings.
      • parseAttributeMapping

        public static Map<String,​String> parseAttributeMapping​(Set<String> mappings)
        Parses attribute mapping settings in the format of "from=to". If there is no mapping provided, then this will be a mapping to itself.
        Parameters:
        mappings - A set of mappings that needs to be parsed
        Returns:
        The processed mappings returned as a map.