• Middleware to inject the API key into the HTTP request.

    The middleware will inject the client's configured API key into the request as defined by the @httpApiKeyAuth trait. If the trait says to put the API key into a named header, that header will be used, optionally prefixed with a scheme. If the trait says to put the API key into a named query parameter, that query parameter will be used.

    Returns

    a function that processes the HTTP request and passes it on to the next handler

    Type Parameters

    • Input extends object

    • Output extends object

    Parameters

    • pluginConfig: HttpApiKeyAuthResolvedConfig

      the client configuration. Includes the function that will return the API key value.

    • middlewareConfig: HttpApiKeyAuthMiddlewareConfig

      the plugin options (location of the parameter, name, and optional scheme)

    Returns BuildMiddleware<Input, Output>