api

http4k / org.http4k.contract.security / ApiKeySecurity / <init>

<init>

ApiKeySecurity(param: Lens<Request, T>, validateKey: (T) -> Boolean, authorizeOptionsRequests: Boolean = true, name: String = "api_key")

Checks the presence of the named Api Key parameter. Filter returns 401 if Api-Key is not found in request.

Default implementation of ApiKey. Includes an option to NOT authorise OPTIONS requests, which is currently not enabled for OpenAPI.