Interface AuthorizationService
- All Known Implementing Classes:
AuthorizationServiceImpl,MockAuthorizationServiceImpl
public interface AuthorizationService
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetCurrent(String service, List<String> rawRoles) Returns all permitted functions by given roles at given service.getDefinition(String service) Returns the definition of given service.Returns the role mapping.identifyFunction(String service, String uri, String httpMethod) Returns a list of ServiceData.Function that match given uri and http method.booleanisGranted(Set<String> rawRoles, ServiceData.Function function) Returnstruefor given function if the one-of setting contains the role needed for the function to be accessed.booleanisUserPermitted(Collection<String> rawRoles) Returnstrueif the user based upon his roles is permitted to generally use the application.mapRawRoles(Collection<String> rawRoles) Returns a set with the role names as expected by the ServiceData.Function.
-
Field Details
-
SERVICE_WEB_UI
- See Also:
-
SERVICE_API_GATEWAY
- See Also:
-
SERVICE_MANAGEMENT
- See Also:
-
SERVICE_REPORT
- See Also:
-
SERVICE_NOTIFICATIONS
- See Also:
-
-
Method Details
-
getCurrent
Returns all permitted functions by given roles at given service. This permission is bound to time and may change during time.- Parameters:
service- the requesting servicerawRoles- the current roles of the user (either from eIAM or from Claim)- Returns:
- list of permitted functions
-
getDefinition
Returns the definition of given service.- Parameters:
service- the requesting service- Returns:
- the service's definition
-
getRoleMapping
Returns the role mapping.Roles consist of different perspectives. The mapping aligns them:
claim= role name used in JWT tokenseiam= role name used in eIAMintern= role name used in this libraries function permissions
- Returns:
- the mapping for the supported roles
-
isUserPermitted
Returnstrueif the user based upon his roles is permitted to generally use the application.- Parameters:
rawRoles- the current roles of the user (either from eIAM or from Claim)- Returns:
trueif permitted, otherwisefalse
-
identifyFunction
Returns a list of ServiceData.Function that match given uri and http method.A single entry is a trustful identification, more or less than that indicates that the identification is NOT trustworthy.
- Parameters:
service- identifies the current serviceuri- the uri the function has to matchhttpMethod- the http method the function has to match- Returns:
- List of ServiceData.Function that match given uri and http method
-
isGranted
Returnstruefor given function if the one-of setting contains the role needed for the function to be accessed. If one-of isn't configured false will be returned.- Parameters:
rawRoles- the current roles of the user (either from eIAM or from Claim)function- the function to check- Returns:
truefor given function if the one-of setting contains the role needed for the function to be accessed. If one-of isn't configured false will be returned.
-
mapRawRoles
Returns a set with the role names as expected by the ServiceData.Function.- Parameters:
rawRoles- the current roles of the user (either from eIAM or from Claim)- Returns:
- List with role names
-