Package org.wildfly.security.authz
Class SourceAddressRoleDecoder
- java.lang.Object
-
- org.wildfly.security.authz.SourceAddressRoleDecoder
-
- All Implemented Interfaces:
RoleDecoder
public class SourceAddressRoleDecoder extends Object implements 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
Constructors Constructor Description SourceAddressRoleDecoder(String sourceAddress, Roles roles)
Construct a new instance.SourceAddressRoleDecoder(Pattern sourceAddressPattern, Roles roles)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Roles
decodeRoles(AuthorizationIdentity authorizationIdentity)
Decode the role set using the source IP address runtime attribute from the given authorization identity.
-
-
-
Constructor Detail
-
SourceAddressRoleDecoder
public SourceAddressRoleDecoder(String sourceAddress, Roles roles)
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
public SourceAddressRoleDecoder(Pattern sourceAddressPattern, Roles roles)
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 Detail
-
decodeRoles
public Roles decodeRoles(AuthorizationIdentity authorizationIdentity)
Decode the role set using the source IP address runtime attribute from the given authorization identity.- Specified by:
decodeRoles
in interfaceRoleDecoder
- Parameters:
authorizationIdentity
- the authorization identity (notnull
)- Returns:
- the role set (must not be
null
)
-
-