Class RoleValidator.RoleConfig

    • Method Detail

      • 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