Interface RoleDecoder

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface RoleDecoder
    A decoder to extract role information from an identity's attributes.
    Author:
    David M. Lloyd
    • Field Detail

      • KEY_ROLES

        static final String KEY_ROLES
        A key whose value is the string "Roles", to provide a standard/default location at which roles may be found.
        See Also:
        Constant Field Values
      • EMPTY

        static final RoleDecoder EMPTY
        A role decoder which decodes no roles.
      • DEFAULT

        static final RoleDecoder DEFAULT
        A role decoder which always decodes roles from the attribute called "Roles".
    • Method Detail

      • decodeRoles

        Roles decodeRoles​(AuthorizationIdentity authorizationIdentity)
        Decode the role set from the given authorization identity.
        Parameters:
        authorizationIdentity - the authorization identity (not null)
        Returns:
        the role set (must not be null)
      • simple

        static RoleDecoder simple​(String attribute)
        Create a simple role decoder which returns the values of the given attribute.
        Parameters:
        attribute - the attribute
        Returns:
        the roles