Interface Authorization

  • All Known Implementing Classes:
    DefaultAuthorization

    public interface Authorization
    author 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 Detail

      • log

        static final org.slf4j.Logger log
    • 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 endpoints
        endpointType - 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 accessed
        endpointType - the method that was called by the client
        roles - the required roles to access the given endpoint