public interface AuthorizationHandler extends Handler<RoutingContext>
AuthorizationHandlerImpl usually requires a AuthenticationHandler
to be on the routing chain before it
or a custom handler that has previously set a User
in the RoutingContext
Modifier and Type | Method and Description |
---|---|
AuthorizationHandler |
addAuthorizationProvider(AuthorizationProvider authorizationProvider)
Adds a provider that shall be used to retrieve the required authorizations for the user to attest.
|
static AuthorizationHandler |
create(Authorization authorization)
create the the handler that will check the specified authorization
Note that to check several authorizations, you can specify a sub-interface such as
AndAuthorization or OrAuthorization |
AuthorizationHandler |
variableConsumer(java.util.function.BiConsumer<RoutingContext,AuthorizationContext> handler)
Provide a simple handler to extract needed variables.
|
static AuthorizationHandler create(Authorization authorization)
AndAuthorization
or OrAuthorization
authorization
- the authorization to attest.AuthorizationHandler addAuthorizationProvider(AuthorizationProvider authorizationProvider)
authorizationProvider
- a provider.AuthorizationHandler variableConsumer(java.util.function.BiConsumer<RoutingContext,AuthorizationContext> handler)
(routingCtx, authCtx) -> authCtx.variables().addAll(routingCtx.request().params())
Or for example the remote address:
(routingCtx, authCtx) -> authCtx.result.variables().add(VARIABLE_REMOTE_IP, routingCtx.request().connection().remoteAddress())
handler
- a bi consumer.Copyright © 2024 Eclipse. All rights reserved.