Package io.vertx.mutiny.ext.web.handler
Class APIKeyHandler
java.lang.Object
io.vertx.mutiny.ext.web.handler.APIKeyHandler
- All Implemented Interfaces:
MutinyDelegate,io.vertx.core.Handler<RoutingContext>,AuthenticationHandler,Consumer<RoutingContext>
public class APIKeyHandler
extends Object
implements AuthenticationHandler, io.vertx.core.Handler<RoutingContext>, Consumer<RoutingContext>, MutinyDelegate
An authentication handler that provides API Key support.
API keys can be extracted from
HTTP headers/query parameters/cookies.
By default this handler will extract the API key from an HTTP header named X-API-KEY.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Paulo Lopes
- See Also:
-
APIKeyHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vertx.mutiny.ext.web.handler.AuthenticationHandler
AuthenticationHandler.AuthenticationHandlerImpl -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAPIKeyHandler(io.vertx.ext.web.handler.APIKeyHandler delegate) Create a new instance ofAPIKeyHandlerdelegating to the given (non-null) instance ofAPIKeyHandler.APIKeyHandler(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(RoutingContext item) Handle an item.Specify the source for the api key extraction as an HTTP cookie with the given name.static APIKeyHandlercreate(AuthenticationProvider authProvider) Create an API Key authentication handlerbooleanio.vertx.ext.web.handler.APIKeyHandlerGet the delegate instance.voidhandle(RoutingContext item) Handle an item.inthashCode()Specify the source for the api key extraction as an HTTP header with the given name.static APIKeyHandlernewInstance(io.vertx.ext.web.handler.APIKeyHandler delegate) Creates a new instance of theAPIKeyHandler.Specify the source for the api key extraction as an HTTP query parameter with the given name.tokenExtractor(Function<String, io.smallrye.mutiny.Uni<String>> tokenExtractor) Transform from user's token format to the AuthenticationHandler's format.toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
APIKeyHandler
public APIKeyHandler(io.vertx.ext.web.handler.APIKeyHandler delegate) Create a new instance ofAPIKeyHandlerdelegating to the given (non-null) instance ofAPIKeyHandler. -
APIKeyHandler
-
-
Method Details
-
accept
Handle an item. This method is generated from theoriginalmethod."- Specified by:
acceptin interfaceAuthenticationHandler- Specified by:
acceptin interfaceConsumer<RoutingContext>
-
handle
Handle an item. This method is generated from theoriginalmethod."- Specified by:
handlein interfaceAuthenticationHandler- Specified by:
handlein interfaceio.vertx.core.Handler<RoutingContext>
-
getDelegate
public io.vertx.ext.web.handler.APIKeyHandler 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 interfaceAuthenticationHandler- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
create
Create an API Key authentication handler- Parameters:
authProvider- the auth provider to use- Returns:
- the auth handler
-
header
Specify the source for the api key extraction as an HTTP header with the given name.- Parameters:
headerName- the header name containing the API key- Returns:
- fluent self
-
parameter
Specify the source for the api key extraction as an HTTP query parameter with the given name.- Parameters:
paramName- the parameter name containing the API key- Returns:
- fluent self
-
cookie
Specify the source for the api key extraction as an HTTP cookie with the given name.- Parameters:
cookieName- the cookie name containing the API key- Returns:
- fluent self
-
tokenExtractor
Transform from user's token format to the AuthenticationHandler's format.- Parameters:
tokenExtractor- extract the token from the origin payload- Returns:
- fluent self
-
newInstance
Creates a new instance of theAPIKeyHandler. -
hashCode
public int hashCode() -
equals
-
toString
-