Interface Authorization
-
- All Known Implementing Classes:
DefaultAuthorization
public interface Authorizationauthor Pascal Knueppel
created at: 27.11.2019 - 17:05
this interface may be used by the developer to pass authorization information about the user into this framework it will also be delivered into the handler implementations so that a developer is also able to pass arbitrary information's to the own implementation
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Loggerlog
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringgetClientId()this is just a marker for error messages that will be printed into the log for debug purposes to be able to identify the client that tried to do a forbidden actionSet<String>getClientRoles()default voidisAuthorized(ResourceType resourceType, EndpointType endpointType, Set<String> roles)checks if the current client is authorized to access the given endpointdefault voidisClientAuthorized(ResourceType resourceType, EndpointType endpointType)verifies if the client is authorized to access the given endpoint and will throw a forbidden except
-
-
-
Method Detail
-
getClientId
String getClientId()
this is just a marker for error messages that will be printed into the log for debug purposes to be able to identify the client that tried to do a forbidden action
-
getClientRoles
Set<String> getClientRoles()
- Returns:
- the roles that an authenticated client possesses
-
isClientAuthorized
default void isClientAuthorized(ResourceType resourceType, EndpointType endpointType)
verifies if the client is authorized to access the given endpoint and will throw a forbidden except- Parameters:
resourceType- the resource type that might hold information's about the needed authorization on the given endpointsendpointType- the endpoint type the client tries to access
-
isAuthorized
default void isAuthorized(ResourceType resourceType, EndpointType endpointType, Set<String> roles)
checks if the current client is authorized to access the given endpoint- Parameters:
resourceType- the resource type on which the endpoint is accessedendpointType- the method that was called by the clientroles- the required roles to access the given endpoint
-
-