Launch hardening II: critical security fix, perf budget gate, status uptime, SOC 2 groundwork #4084
Cross-repo impact
See what breaks downstream if this PR merges.
⮌ Merged
This pull request was merged into main.
c comment · e edit title · m merge · a approve · r request changes · ? shortcuts
Originally written by @ccantynz-alt on GitHub.
Imported from https://github.com/ccantynz-alt/AlecRae.com/pull/47
Summary
Four parallel launch-hardening tranches. Verified locally: lint ✓, typecheck ✓, test ✓ (61/61), web build ✓ (admin's only build failure is the sandbox blocking Google Fonts — green in CI).
🔴 Security (G7) — the headline
middleware/auth.ts,routes/auth.ts/me+/logout) decoded JWTs withatob()and trusted them without verifying the signature — anyone could forge a token for any account. Now verified via jose (signature + expiry).jwt.test.ts6/6 confirms legit login still works.tracking.ts).📈 Status uptime (G6)
GET /v1/uptime: real probe-derived uptime (24h/7d/90d) from a Redis-backed sample ledger; honest "unknown" when no history. Replaces the status page's previously fabricated uptime numbers. No invented data.⚡ Bundle/perf (P1-P3, P5)
Reveal— exact visuals/copy preserved.optionalDependencies+ named lazy chunk;CollaborativeDraftViewDynamickeeps yjs out of the initial bundle.📋 SOC 2 groundwork (C4)
docs/compliance/soc2/: README, controls matrix (47 implemented / 14 partial / 19 missing), gap analysis, and 6 policy templates pre-filled from real controls.⚠️ Decisions needed before public traffic (tracked in GO_LIVE_GAPS.md)
The security review flagged these but did not auto-fix — each needs a design call:
stateunsigned (account-linking CSRF)sso.ts/collaborate.tsfallback secretsencryption.ts:18) — undermines zero-knowledge claimKnown issue
dunning.test.ts(merged earlier) is occasionally flaky under turbo concurrency due to module-level mock state. Passes reliably in isolation. Follow-up: isolate the mock.https://claude.ai/code/session_01CQjWseikSJdamHS8W6Kygz
Generated by Claude Code