View Source Dynamo.Credentials.Cache (Dynamo v0.2.0)

Long-lived owner of resolved credentials for a repo. Started by the repo supervisor.

The read path is lock-free: fresh credentials are published to :persistent_term and get/1 returns them without touching the process. Only when they are missing or stale does the caller go through the GenServer, which refreshes once for all concurrent callers (single-flight).

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns current (fresh) credentials, refreshing if needed.

Drops cached credentials so the next get/1 re-resolves.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get(server)

@spec get(GenServer.server()) ::
  {:ok, Dynamo.Credentials.t()} | {:error, Dynamo.Error.t()}

Returns current (fresh) credentials, refreshing if needed.

invalidate(server)

Drops cached credentials so the next get/1 re-resolves.