Sigra.Plug.PasskeyChallenge (Sigra v0.2.2)

Copy Markdown View Source

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

ceremony()

@type ceremony() :: :registration | :authentication

verifier()

@type verifier() :: (Wax.Challenge.t() -> {:ok, term()} | {:error, term()})

Functions

issue(conn, ceremony, config, opts \\ [])

verify(conn, ceremony, config, opts \\ [], callback)

@spec verify(Plug.Conn.t(), ceremony(), Sigra.Config.t(), keyword(), verifier()) ::
  {:ok, Plug.Conn.t(), term()} | {:error, Plug.Conn.t(), term()}