Attesto.CredentialOfferStore behaviour (Attesto v1.8.0)

Copy Markdown View Source

Storage seam for by-reference OID4VCI credential offers.

An issuer stores a credential offer under an opaque id and gives the wallet a URI containing that id. The wallet retrieves the offer through fetch/1. Retrieval is non-consuming: the pre-authorized code inside the offer is the single-use gate for the issuance flow.

Summary

Callbacks

Fetch a live offer without consuming it, or return :error.

Persist a credential-offer record.

Types

entry()

@type entry() :: %{id: String.t(), offer: map(), expires_at: integer()}

Callbacks

fetch(id)

@callback fetch(id :: String.t()) :: {:ok, map()} | :error

Fetch a live offer without consuming it, or return :error.

put(entry)

@callback put(entry()) :: :ok

Persist a credential-offer record.