docs: add WebAuthn passkey auth roadmap#104
Conversation
Greptile SummaryThis PR appends a post-v0.4.9 WebAuthn/passkey phase to DD-043, decomposed into four WA-PRs covering foundation/storage, registration helpers, authentication/session completion, and template UX/policy hardening. The security constraints recorded (server-side ceremony state, credential-ID uniqueness, sign-counter rejection semantics, RP/origin config, non-PII user handles, and optional attestation) are consistent with the WebAuthn Level 2 spec and Confidence Score: 5/5Documentation-only change; safe to merge. No P0 or P1 findings. The design posture is spec-conformant (server-side ceremony state, counter rejection semantics, credential-ID uniqueness, non-PII user handles). Previously reviewed issues are fully addressed. No code is introduced. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Browser
participant App
participant std/auth WebAuthn
participant ServerStorage
Note over Browser,ServerStorage: WA-PR 2 — Passkey Registration
Browser->>App: POST /passkey/register/begin
App->>std/auth WebAuthn: begin_passkey_registration(req, user)
std/auth WebAuthn->>ServerStorage: store ceremony state (TTL, one-time)
std/auth WebAuthn-->>App: PublicKeyCredentialCreationOptions
App-->>Browser: JSON creation options
Browser->>Browser: navigator.credentials.create({ publicKey })
Browser->>App: POST /passkey/register/finish (credential response)
App->>std/auth WebAuthn: finish_passkey_registration(req, credential_response)
std/auth WebAuthn->>ServerStorage: consume ceremony state (replay check)
std/auth WebAuthn->>ServerStorage: enforce credential-ID uniqueness
std/auth WebAuthn->>ServerStorage: store passkey record
std/auth WebAuthn-->>App: Result<Map, String>
Note over Browser,ServerStorage: WA-PR 3 — Passkey Authentication
Browser->>App: POST /passkey/auth/begin
App->>std/auth WebAuthn: begin_passkey_authentication(req, identifier?)
std/auth WebAuthn->>ServerStorage: store challenge state (TTL, one-time)
std/auth WebAuthn-->>App: PublicKeyCredentialRequestOptions
App-->>Browser: JSON request options
Browser->>Browser: navigator.credentials.get({ publicKey })
Browser->>App: POST /passkey/auth/finish (assertion response)
App->>std/auth WebAuthn: finish_passkey_authentication(req, credential_response)
std/auth WebAuthn->>ServerStorage: consume challenge state
std/auth WebAuthn->>ServerStorage: validate sign counter (reject if equal/lower non-zero)
std/auth WebAuthn->>ServerStorage: update counter + last-used
std/auth WebAuthn-->>App: Result<Map, String> (subject/session data)
App->>std/auth WebAuthn: sign_in_session(response, req, session)
std/auth WebAuthn-->>Browser: session cookie (rotation/migration applied)
Reviews (5): Last reviewed commit: "docs: align passkey finish helper shape" | Re-trigger Greptile |
Summary
Verification
git diff --checkcargo fmt -- --checkcargo test auth -- --test-threads=1Notes
NTNT_AUTH_TEST_POSTGRES_URLandNTNT_AUTH_TEST_REDIS_URLwere set during auth test verification.