Otp sanatization#43
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Also folds in follow-up work that previously landed in an unnamed WIP commit: - magic-link polling returns 204/403 instead of 500 on missing/mismatched token - unify OTP verify success response with the refresh response schema - add e2e/integration/unit tests (defineRoute auth, response-schema coverage) - coverage badge refresh + run coverage with --fileParallelism=false
- CLAUDE.md: imports AGENTS.md and adds a working agreement (verify loop, license-header/commit/changeset conventions, don't-touch list) - .claude/settings.json: allowlist safe project commands to reduce prompts - .gitignore: keep personal .claude/settings.local.json out of version control Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- docs/ecosystem.md: deep coupling map of Tier 1/2 sibling repos (seamless-auth-react/-server/-types, seamless-messaging, +consumers): endpoints, schema import sites, token/JWKS touchpoints, blast radius - CLAUDE.md: concise ecosystem section + ripple protocol for contract changes - .gitignore: allowlist docs/ecosystem.md past the docs/* rule Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- ci.yml: run `prettier --check` (new format:check script) instead of `--write`, so formatting diffs actually fail the build - vitest.config.ts: raise coverage thresholds to current floor (statements 80 / branches 70 / functions 90 / lines 80) so coverage cannot silently regress; will ratchet up as regression tests land - release.yml: align Node to 20 (matches CI) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…on tests - verifyMagicLink: remove dead no-op device-binding branches; device binding is correctly enforced at the poll step (the email may be opened on another device) - pollMagicLinkConfirmation: return 204 with no body (was 204 + JSON body that Express strips); status stays 204 for the server adapter - await the post-session user.update so failures surface - regression tests: full request -> verify -> poll -> session sequence (the path that broke), user-agent mismatch -> 403, 204-empty-body guard (was 500), verify stays device-agnostic Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rites - rate-limit the four OTP verify endpoints (otpIpLimiter + otpIdentityLimiter); they were previously unthrottled and brute-forceable once an ephemeral token was held - otpMatchesStoredValue: remove the transitional plaintext-OTP fallback; OTPs are hashed-only (sha256:) now. Any code issued before hashing (5-min TTL) simply expires — re-request to get a hashed one - await the post-session user.update(lastLogin) writes so failures surface - tests: flip legacy-plaintext-acceptance to rejection; add round-trip regression tests (email/phone generate->verify) and a hashed-at-rest format guard Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
No description provided.