livery_s3_credentials_store (livery_s3 v0.1.0)
View SourceCache for refreshing credential providers.
A gen_server owns a public ETS table keyed by provider key, holding the last
fetched creds(). current/2 serves cached credentials directly (no process
round-trip) and only routes through the server to (re)fetch when the entry is
missing or within the refresh margin of expires_at (default 300 s). Fetches
are single-flighted by the server, so a thundering herd of expired reads triggers
one refresh. Started by the livery_s3 application; only refreshing providers
(imds, web-identity, custom funs) need it.
Summary
Functions
Return cached credentials for Key, refreshing via Provider if stale.
Types
Functions
-spec current(term(), livery_s3_credentials:provider()) -> {ok, livery_s3_credentials:creds()} | {error, term()}.
Return cached credentials for Key, refreshing via Provider if stale.
-spec init([]) -> {ok, state()}.