feat(webauthn): enforce per-device credential policy and document hybrid auth flow (SRV-046, SRV-047, SRV-048) - S11 - #38
Merged
Conversation
20 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #33
PR title
Description
Implements the S11 WebAuthn hardening deliverable: per-device credential limit policy, supporting DTOs and constants, e2e/unit test coverage with mocks, and documentation of the hybrid Supabase + WebAuthn authorization flow in ARCHITECTURE.
Type of change
feat)fix)Changes made
src/webauthn/webauthn.constants.ts— new constants for the per-device credential policy (SRV-046).src/webauthn/webauthn.service.ts— enforces the credential limit and last-credential protection; updated unit tests inwebauthn.service.spec.ts.src/webauthn/webauthn.repository.ts— repository support for the new credential policy checks.src/webauthn/webauthn.controller.ts— exposes the updated registration/credential routes with the new error codes.src/webauthn/dto/registration-response.dto.ts,webauthn-credential.dto.ts,dto/index.ts— DTOs for the credential list and registration response shapes.test/webauthn-payments.e2e-spec.ts— e2e coverage for the full WebAuthn + payments authorize HTTP surface, run against the real Supabase auth guard (SRV-047).docs/architecture.md— documents the hybrid Supabase + WebAuthn authorization flow (SRV-048).Test plan
npx jest --config ./test/jest-e2e.json webauthn-payments— 15/15 passingnpm run start:dev(or the relevant command)Migrations / database
N/A
Checklist
Closes #with the correct issue numbernpm run lintandnpm run testpass without errors