api

http4k / org.http4k.contract.security / ApiKeySecurity

ApiKeySecurity

class ApiKeySecurity<out T> : Security

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.

Constructors

Name Summary
<init> Checks the presence of the named Api Key parameter. Filter returns 401 if Api-Key is not found in request.ApiKeySecurity(param: Lens<Request, T>, validateKey: (T) -> Boolean, authorizeOptionsRequests: Boolean = true, name: String = "api_key")

Properties

Name Summary
filter val filter: <ERROR CLASS>
name val name: String
param val param: Lens<Request, T>

Extension Functions

Name Summary
and fun Security.and(that: Security): Security
or fun Security.or(that: Security): Security

Companion Object Extension Properties

Name Summary
renderer val ApiKeySecurity.Companion.renderer: SecurityRenderer
renderer val ApiKeySecurity.Companion.renderer: SecurityRenderer