Attesto.CIBAStore.ETS (Attesto v1.1.0)

Copy Markdown View Source

Single-node ETS implementation of Attesto.CIBAStore.

Authentication-request records live in an ETS table owned by a GenServer. The state-changing callbacks (approve/3, deny/2, poll/2, consume/2) run inside GenServer.call/2, so they are serialized through the owner process - that is how this reference store gets the atomic, single-winner state transitions Attesto.CIBAStore requires (a production multi-node deployment uses an Ecto store, whose transitions are single conditional UPDATE ... RETURNING statements). Reads that do not transition state (lookup/1) hit the table directly.

Start options

  • :sweep_interval_ms (default 30_000) - how often expired rows are bulk-deleted. Correctness does not depend on sweeping (redeem/4 re-checks expiry); the sweeper only bounds table size.

Wiring

children = [Attesto.CIBAStore.ETS]

Summary

Functions

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()