Package org.wildfly.security.authz
Class SourceAddressRoleDecoder
java.lang.Object
org.wildfly.security.authz.SourceAddressRoleDecoder
- All Implemented Interfaces:
RoleDecoder
A decoder to obtain role information using the source IP address runtime attribute from the identity.
- Author:
- Farah Juma
-
Field Summary
Fields inherited from interface org.wildfly.security.authz.RoleDecoder
DEFAULT, EMPTY, KEY_ROLES, KEY_SOURCE_ADDRESS -
Constructor Summary
ConstructorsConstructorDescriptionSourceAddressRoleDecoder(String sourceAddress, Roles roles) Construct a new instance.SourceAddressRoleDecoder(Pattern sourceAddressPattern, Roles roles) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptiondecodeRoles(AuthorizationIdentity authorizationIdentity) Decode the role set using the source IP address runtime attribute from the given authorization identity.
-
Constructor Details
-
SourceAddressRoleDecoder
Construct a new instance.- Parameters:
sourceAddress- the source IP address to match (cannot benull)roles- the roles to associate with the identity if the actual source IP address matches the given source IP address
-
SourceAddressRoleDecoder
Construct a new instance.- Parameters:
sourceAddressPattern- the source IP address pattern to match (cannot benull)roles- the roles to associate with the identity if the actual source IP address matches the given pattern
-
-
Method Details
-
decodeRoles
Decode the role set using the source IP address runtime attribute from the given authorization identity.- Specified by:
decodeRolesin interfaceRoleDecoder- Parameters:
authorizationIdentity- the authorization identity (notnull)- Returns:
- the role set (must not be
null)
-