Class APIKeyHandler

java.lang.Object
io.vertx.mutiny.ext.web.handler.APIKeyHandler
All Implemented Interfaces:
io.smallrye.mutiny.vertx.MutinyDelegate, io.vertx.core.Handler<RoutingContext>, AuthenticationHandler, Consumer<RoutingContext>

public class APIKeyHandler extends Object implements io.smallrye.mutiny.vertx.MutinyDelegate, AuthenticationHandler, io.vertx.core.Handler<RoutingContext>, Consumer<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 Mutiny-ified interface using Vert.x codegen.

  • Field Details

    • __TYPE_ARG

      public static final io.smallrye.mutiny.vertx.TypeArg<APIKeyHandler> __TYPE_ARG
  • Constructor Details

    • APIKeyHandler

      public APIKeyHandler(io.vertx.ext.web.handler.APIKeyHandler delegate)
    • APIKeyHandler

      public APIKeyHandler(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.web.handler.APIKeyHandler getDelegate()
      Specified by:
      getDelegate in interface AuthenticationHandler
      Specified by:
      getDelegate in interface io.smallrye.mutiny.vertx.MutinyDelegate
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • handle

      public void handle(RoutingContext arg0)
      Specified by:
      handle in interface AuthenticationHandler
      Specified by:
      handle in interface io.vertx.core.Handler<RoutingContext>
    • create

      public static APIKeyHandler create(io.vertx.mutiny.ext.auth.authentication.AuthenticationProvider authProvider)
      Parameters:
      authProvider - the auth provider to use
      Returns:
      the auth handler
    • header

      public APIKeyHandler header(String headerName)
      Parameters:
      headerName - the header name containing the API key
      Returns:
      fluent self
    • parameter

      public APIKeyHandler parameter(String paramName)
      Parameters:
      paramName - the parameter name containing the API key
      Returns:
      fluent self
    • cookie

      public APIKeyHandler cookie(String cookieName)
      Parameters:
      cookieName - the cookie name containing the API key
      Returns:
      fluent self
    • accept

      public void accept(RoutingContext item)
      Specified by:
      accept in interface AuthenticationHandler
      Specified by:
      accept in interface Consumer<RoutingContext>
    • newInstance

      public static APIKeyHandler newInstance(io.vertx.ext.web.handler.APIKeyHandler arg)