Package io.vertx.mutiny.ext.web.handler
Class AuthorizationHandler
java.lang.Object
io.vertx.mutiny.ext.web.handler.AuthorizationHandler
- All Implemented Interfaces:
MutinyDelegate,io.vertx.core.Handler<RoutingContext>,Consumer<RoutingContext>
public class AuthorizationHandler
extends Object
implements io.vertx.core.Handler<RoutingContext>, Consumer<RoutingContext>, MutinyDelegate
Base interface for authorization handlers that provide authorization support.
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
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Stephane Bastian
- See Also:
-
AuthorizationHandler
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAuthorizationHandler(io.vertx.ext.web.handler.AuthorizationHandler delegate) Create a new instance ofAuthorizationHandlerdelegating to the given (non-null) instance ofAuthorizationHandler.AuthorizationHandler(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(RoutingContext item) Handle an item.addAuthorizationProvider(AuthorizationProvider authorizationProvider) Adds a provider that shall be used to retrieve the required authorizations for the user to attest.static AuthorizationHandlercreate()create the handler that will check the attribute based authorization.static AuthorizationHandlercreate(Authorization authorization) create the handler that will check the specified authorization Note that to check several authorizations, you can specify a sub-interface such asAndAuthorizationorOrAuthorizationbooleanio.vertx.ext.web.handler.AuthorizationHandlerGet the delegate instance.voidhandle(RoutingContext item) Handle an item.inthashCode()static AuthorizationHandlernewInstance(io.vertx.ext.web.handler.AuthorizationHandler delegate) Creates a new instance of theAuthorizationHandler.toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
AuthorizationHandler
public AuthorizationHandler(io.vertx.ext.web.handler.AuthorizationHandler delegate) Create a new instance ofAuthorizationHandlerdelegating to the given (non-null) instance ofAuthorizationHandler. -
AuthorizationHandler
-
-
Method Details
-
accept
Handle an item. This method is generated from theoriginalmethod."- Specified by:
acceptin interfaceConsumer<RoutingContext>
-
handle
Handle an item. This method is generated from theoriginalmethod."- Specified by:
handlein interfaceio.vertx.core.Handler<RoutingContext>
-
getDelegate
public io.vertx.ext.web.handler.AuthorizationHandler getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
create
create the handler that will check the specified authorization Note that to check several authorizations, you can specify a sub-interface such asAndAuthorizationorOrAuthorization- Parameters:
authorization- the authorization to attest.- Returns:
- fluent self.
-
create
create the handler that will check the attribute based authorization. In this mode, the required authorization is computed from the request itself or the metadata of the route. The important keys are:X-ABAC-Domain- The domain of the permission, a domain is a the first segment ofdomain:operationX-ABAC-Operation- The operation of the permission, the operation is a the second segment ofdomain:operationX-ABAC-Resource- This is usually is a opaque string to mark the resource to access
X-ABAC-Domain- AlwayswebX-ABAC-Operation- The request HTTPHttpMethodfromHttpServerRequest#method()X-ABAC-Resource- The normalized request path fromRoutingContext.normalizedPath()
- Returns:
- fluent self.
-
addAuthorizationProvider
Adds a provider that shall be used to retrieve the required authorizations for the user to attest. Multiple calls are allowed to retrieve authorizations from many sources.- Parameters:
authorizationProvider- a provider.- Returns:
- fluent self.
-
newInstance
public static AuthorizationHandler newInstance(io.vertx.ext.web.handler.AuthorizationHandler delegate) Creates a new instance of theAuthorizationHandler. -
hashCode
public int hashCode() -
equals
-
toString
-