Interface RoleDecoder

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

    public interface RoleDecoder
    A decoder to extract role information from an identity's attributes.
    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

        static final String KEY_SOURCE_ADDRESS
        A key whose value is the string "Source-Address". This is where the IP address of a remote client 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.
        authorizationIdentity - the authorization identity (not null)
        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.
        attribute - the attribute
        the roles
      • aggregate

        static RoleDecoder aggregate​(RoleDecoder... decoders)
        Create an aggregate role decoder. Each role decoder is applied in order and the returned value is a union of the roles returned by each decoder.
        decoders - the role decoders to apply (must not be null or contain null elements)
        the aggregate role decoder (not null)