Persistence contract used by WebAuthn ceremony finish functions.
Implementations own application identity and transaction policy. In particular,
update_credential/3 must persist the signature counter and backup state atomically.
Summary
Types
Application-defined callback context.
Stable failures understood by ExSwan.Plug.
Application-defined user or registration subject.
Callbacks
Persists a newly verified credential, returning :duplicate on conflict.
Fetches a stored credential by its unpadded base64url identifier.
Atomically persists authentication counter and backup-state changes.
Types
@type context() :: term()
Application-defined callback context.
@type error() :: :not_found | :duplicate | :stale_credential | term()
Stable failures understood by ExSwan.Plug.
@type user() :: term()
Application-defined user or registration subject.
Callbacks
@callback create_credential(user(), ExSwan.RegistrationResult.t(), context()) :: {:ok, term()} | {:error, error()}
Persists a newly verified credential, returning :duplicate on conflict.
@callback get_credential(ExSwan.Credential.credential_id(), context()) :: {:ok, ExSwan.Credential.t()} | {:error, error()}
Fetches a stored credential by its unpadded base64url identifier.
@callback update_credential( ExSwan.Credential.t(), ExSwan.AuthenticationResult.t(), context() ) :: {:ok, term()} | {:error, error()}
Atomically persists authentication counter and backup-state changes.