public class RoleMapper extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
log |
static String |
ROLEMAPPER |
| Constructor and Description |
|---|
RoleMapper(org.swisspush.gateleen.core.storage.ResourceStorage storage,
String securityRoot)
Holds the list of all configured RoleMappings and executes the mapping
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkConfigResource(io.vertx.core.buffer.Buffer buffer)
Check if the given resource in the buffer is valid
|
void |
configUpdate()
Retrieve the configured RoleMapper from Storage and populate the corresponding List of mappers.
|
Set<String> |
mapRoles(Set<String> roles)
Maps the received roles from http header according the rolemapper rules and return the set of
mapped roles including the initial list of roles.
|
public static final org.slf4j.Logger log
public static final String ROLEMAPPER
public RoleMapper(org.swisspush.gateleen.core.storage.ResourceStorage storage,
String securityRoot)
storage - Reference to the storage to retrieve the RoleMappings fromsecurityRoot - Base url to retrieve the rolemapper config resource from (no trailing slash expected nor necessary)public void checkConfigResource(io.vertx.core.buffer.Buffer buffer)
throws ValidationException
buffer - The resource to be checkedValidationException - Thrown if the validation failspublic void configUpdate()
public Set<String> mapRoles(Set<String> roles)
roles - The roles to be mapped and enriched according to the rolemapper objectCopyright © 2016–2019. All rights reserved.