Plug-edge session adapter for passkey ceremony challenges.
Challenges are stored as signed tokens in ceremony-specific Plug session
slots. Verification rebuilds the server-authoritative Wax.Challenge
from the signed session payload and only clears the slot after a
successful callback result.
Summary
Types
@type ceremony() :: :registration | :authentication
@type verifier() :: (Wax.Challenge.t() -> {:ok, term()} | {:error, term()})
Functions
@spec issue(Plug.Conn.t(), ceremony(), Sigra.Config.t(), keyword()) :: {Plug.Conn.t(), Wax.Challenge.t()}
@spec verify(Plug.Conn.t(), ceremony(), Sigra.Config.t(), keyword(), verifier()) :: {:ok, Plug.Conn.t(), term()} | {:error, Plug.Conn.t(), term()}