Package org.wildfly.security.authz
Interface RoleDecoder
- All Known Implementing Classes:
SourceAddressRoleDecoder
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A decoder to extract role information from an identity's attributes.
- Author:
- David M. Lloyd
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RoleDecoderA role decoder which always decodes roles from the attribute called "Roles".static final RoleDecoderA role decoder which decodes no roles.static final StringA key whose value is the string "Roles", to provide a standard/default location at which roles may be found.static final StringA key whose value is the string "Source-Address". -
Method Summary
Modifier and TypeMethodDescriptionstatic RoleDecoderaggregate(RoleDecoder... decoders) Create an aggregate role decoder.decodeRoles(AuthorizationIdentity authorizationIdentity) Decode the role set from the given authorization identity.static RoleDecoderCreate a simple role decoder which returns the values of the given attribute.
-
Field Details
-
KEY_ROLES
A key whose value is the string "Roles", to provide a standard/default location at which roles may be found.- See Also:
-
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:
-
EMPTY
A role decoder which decodes no roles. -
DEFAULT
A role decoder which always decodes roles from the attribute called "Roles".
-
-
Method Details
-
decodeRoles
Decode the role set from the given authorization identity.- Parameters:
authorizationIdentity- the authorization identity (notnull)- Returns:
- the role set (must not be
null)
-
simple
Create a simple role decoder which returns the values of the given attribute.- Parameters:
attribute- the attribute- Returns:
- the roles
-
aggregate
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.- Parameters:
decoders- the role decoders to apply (must not benullor containnullelements)- Returns:
- the aggregate role decoder (not
null)
-