public class AuthorizationHandlerImpl extends Object implements AuthorizationHandler
AuthorizationHandler| Constructor and Description |
|---|
AuthorizationHandlerImpl(Authorization authorization) |
| 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.
|
void |
handle(RoutingContext routingContext)
Something has happened, so handle it.
|
AuthorizationHandler |
variableConsumer(BiConsumer<RoutingContext,AuthorizationContext> handler)
Provide a simple handler to extract needed variables.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatepublic AuthorizationHandlerImpl(Authorization authorization)
public void handle(RoutingContext routingContext)
Handlerhandle in interface Handler<RoutingContext>routingContext - the event to handlepublic AuthorizationHandler variableConsumer(BiConsumer<RoutingContext,AuthorizationContext> handler)
AuthorizationHandler(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()) variableConsumer in interface AuthorizationHandlerhandler - a bi consumer.public AuthorizationHandler addAuthorizationProvider(AuthorizationProvider authorizationProvider)
AuthorizationHandleraddAuthorizationProvider in interface AuthorizationHandlerauthorizationProvider - a provider.Copyright © 2021. All rights reserved.