SLICE-2: identity — email + one-time-code sign-up, sessions, Landing/Sign-in (SD-0001 §7.2) #6
Reference in New Issue
Block a user
Delete Branch "slice-2-identity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
SLICE-2 — Identity (SD-0001 §7.2)
Open, passwordless identity on top of the SLICE-1 walking skeleton. Completes PUC-1, PUC-2 (+a/b/c), PUC-3, PUC-9; realizes BUC-1/BUC-2.
What changed
accountsdomain —request_code/verify/get_account, enforcing INV-2 (email canonical key, no duplicate accounts;ON CONFLICTrace-safe) and INV-3 (one-time codes handled like secrets: HMAC-peppered hash only, 10-min TTL, single-use, ≤5 attempts, 60s resend cooldown). All rules in the domain once (INV-6); the BFF owns no logic.platform/mailer— one-methodsend()port +LogMailer(dev/test): the code lands in an in-memory outbox (tests) and the backend log (PUC-10 dev channel).SmtpMaileris SLICE-4.platform/session— stdlib-HMAC signed, stateless cookie sessions (no session table, §6.2); constant-time verify, tamper-proof./api/auth/*—request-code(uniform 204, no enumeration, §6.6),verify(200 + session cookie +{account, storefront, created}),me,logout(PUC-9). §6.4 error envelope;storefronthard-wirednullbehind a_storefront_forseam SLICE-3 fills.ecomm.*INFO so uvicorn shows the code (PUC-10).Tests / gate
scripts/check.shgreen: import-linter contract kept, 43 backend tests (scenario + INV-2/INV-3 invariants + no-enumeration), frontend build + 3 Vitest routing tests. Verified end-to-end on localhost over HTTP (request-code → code-in-log → verify+cookie → me → logout).Deferred to SLICE-4 (final review I-1/I-2; spec scopes
delivery_failedthere)When
SmtpMailerlands: send-before-commit (don't orphan a code / trip the cooldown on delivery failure) and add the502 delivery_failedhandler (INV-9). E2E browser tests deferred per spec §6.8.🤖 Generated with Claude Code