ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Credential.Refresh

Description

Cached credentials with serial minting and one recovery owner per provider. Valid tokens remain available during outages. Expired callers wait for healthy mints, but receive BreakerOpen during owned recovery. Cancellation releases ownership without counting a mint failure. See docsarchitecturecloud-backends.md for operator policy.

Synopsis

Configuration

data RefreshConfig Source #

Refresh policy with injected mint, clock, jitter and observers.

Constructors

RefreshConfig 

Fields

defaultRefreshConfig :: RefreshConfig Source #

Default policy knobs. Unwired rcMint and rcClock throw Unconfigured.

The refreshing provider

refreshingProvider :: RefreshConfig -> IO CredentialProvider Source #

Build a cached provider, minting eagerly so an initial mint failure aborts construction.

Telemetry reporters

data RefreshReporter Source #

Observe refresh outcomes with the active token's absolute expiry, absent for non-expiring tokens.

Constructors

RefreshReporter 

Fields

noRefreshReporter :: RefreshReporter Source #

The inert refresh reporter: records nothing on either outcome.

data CredentialReporters Source #

The telemetry observers a refreshing provider records through, bundled into one value.

Constructors

CredentialReporters 

Fields

noCredentialReporters :: CredentialReporters Source #

The inert pair: a provider built with it records nothing on either signal.

Failure

data CredentialError Source #

A failure from credential minting or refresh policy.

Constructors

BreakerOpen

The token expired with the mint breaker open, so no mint was attempted.

Unconfigured Text

An effectful leaf still holds its defaultRefreshConfig placeholder.

MintedTokenAlreadyExpired

An already-expired mint is treated as a mint failure.