Class APIKeyHandler
java.lang.Object
io.vertx.reactivex.ext.web.handler.APIKeyHandler
- All Implemented Interfaces:
Handler<RoutingContext>, io.vertx.lang.rx.RxDelegate, AuthenticationHandler
public class APIKeyHandler
extends Object
implements io.vertx.lang.rx.RxDelegate, AuthenticationHandler, Handler<RoutingContext>
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 RX-ified interface using Vert.x codegen.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSpecify the source for the api key extraction as an HTTP cookie with the given name.static APIKeyHandlercreate(AuthenticationProvider authProvider) Create an API Key authentication handlerbooleanvoidhandle(RoutingContext event) Something has happened, so handle it.inthashCode()Specify the source for the api key extraction as an HTTP header with the given name.static APIKeyHandlernewInstance(APIKeyHandler arg) Specify the source for the api key extraction as an HTTP query parameter with the given name.tokenExtractor(Function<String, Single<String>> tokenExtractor) Transform from user's token format to the AuthenticationHandler's format.tokenExtractor(Function<String, Future<String>> tokenExtractor) Transform from user's token format to the AuthenticationHandler's format.toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
APIKeyHandler
-
APIKeyHandler
-
-
Method Details
-
toString
-
equals
-
hashCode
-
getDelegate
- Specified by:
getDelegatein interfaceAuthenticationHandler- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
handle
Something has happened, so handle it.- Specified by:
handlein interfaceAuthenticationHandler- Specified by:
handlein interfaceHandler<RoutingContext>- Parameters:
event- the event to handle
-
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
-
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
-