MutableApiKeyProvider

Thread-safe rotatable credential provider whose value is redacted in logs.

Constructors

Link copied to clipboard
constructor(initialKey: String)

Functions

Link copied to clipboard
fun clear()

Removes the credential so subsequent access fails with AuthError.

Link copied to clipboard
open override fun close()

Clears the credential when the provider is closed.

Link copied to clipboard
open override fun current(): String

Returns the current credential or throws AuthError when unavailable.

Link copied to clipboard
fun rotate(newKey: String)

Replaces the current credential after validation.

Link copied to clipboard
open override fun toString(): String

Returns a representation that never reveals the credential.