public class RoleMapper extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
RoleMapper.MappedRole |
| 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,
Map<String,Object> properties)
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.
|
Map<String,RoleMapper.MappedRole> |
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 according to the given mapping rule sets.
|
public static final org.slf4j.Logger log
public static final String ROLEMAPPER
public RoleMapper(org.swisspush.gateleen.core.storage.ResourceStorage storage,
String securityRoot,
Map<String,Object> properties)
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)properties - The system properties given to the application, used to exctract the Environement where we are running inpublic void checkConfigResource(io.vertx.core.buffer.Buffer buffer)
throws ValidationException
buffer - The resource to be checkedValidationException - Thrown if the validation failspublic void configUpdate()
public Map<String,RoleMapper.MappedRole> mapRoles(Set<String> roles)
roles - The roles to be mapped and enriched according to the rolemapper objectCopyright © 2016–2021. All rights reserved.