InMemoryApiKeyAuthenticator

class InMemoryApiKeyAuthenticator(validApiKeys: Set<String>, val headerName: String = ApiKeyAuthenticator.DEFAULT_HEADER_NAME) : ApiKeyAuthenticator

Simple in-memory API key authenticator. Validates against a set of configured API keys.

For production, implement ApiKeyAuthenticator with database/vault lookup.

Constructors

Link copied to clipboard
constructor(validApiKeys: Set<String>, headerName: String = ApiKeyAuthenticator.DEFAULT_HEADER_NAME)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val headerName: String

The header name to look for the API key. Default is "X-API-Key".

Functions

Link copied to clipboard
open override fun authenticate(apiKey: String): AuthResult

Validate an API key.