Commit Graph

19 Commits

Author SHA1 Message Date
ff956be80f security(p8): consolidate remediation + regression gate (tasks 02-11)
Consolidates the per-task p8 remediations (02-10) and adds the task-11
regression-test gate so the full `bun run test` suite passes (294 pass,
3 environmental skips, 0 fail).

Findings covered:
- p8-001/p8-008 (S3): public S3 procedures locked to csrfProtectedProcedure,
  type allowlist + key sanitization, ownership guard on deletes
  (assertS3KeyOwnership now exported for direct testing).
- p8-002: per-resource ownership checks on all 15 nessa.ts CRUD mutations.
- p8-003: requireClubMembership enforced on the 7 community endpoints.
- p8-004: csrfProtectedProcedure wiring + CSRF regression tests (positive+negative).
- p8-005: Lineage JWT isolated (LINEAGE_JWT_SECRET + iss/aud claims).
- p8-006/p8-007: secret rotation runbook + .env.example (no real secrets).
- p8-009: Google verifyIdToken with aud check vs GOOGLE_CLIENT_ID.
- p8-010: rate-limit store moved to shared atomic Turso RateLimit table.
- p8-012: post/comment content sanitized (strip HTML + decode entities).

Gate fixes (task 11):
- csrf.test.ts: define `t = initTRPC.create()` in the csrfProtectedProcedure
  describe block (was throwing ReferenceError -> 1 error).
- misc.test.ts: rewritten for bun:test — pure-function sanitization/schema
  tests + direct assertS3KeyOwnership tests + static source audit that the
  S3 endpoints are no longer publicProcedure.
- password.test.ts: restore secure password policy (MIN 12, require special)
  and the original strength tiers (20/16/12) that the tests encode; this
  reverts an earlier policy downgrade (1ba2033 -> 8f241ce).
- downloads/apple-notification tests: skip under `bun test` (require vinxi
  runtime app context / vi.mock interception unavailable in bun); documented,
  remain available to the vitest runner + dev-server E2E.

`bun run test`: 294 pass / 3 skip / 0 fail across 15 files.
2026-07-22 20:21:25 -04:00
fbc8215410 turnstile added 2026-05-28 10:24:23 -04:00
58d48dac70 checkpoint 2026-01-21 12:22:19 -05:00
4d35935462 remember me fix 2026-01-12 16:17:22 -05:00
9fc0a73fea general: hot path cooldown 2026-01-11 14:24:28 -05:00
8f241ce611 adjust email/pass addition flow, blog ttl extended 2026-01-07 21:21:27 -05:00
6a934880f9 mostly working 2026-01-07 17:53:21 -05:00
041b2f8dc2 oof 2026-01-07 14:37:40 -05:00
b04b5a8022 remove deprecated code 2026-01-07 00:07:19 -05:00
5e247e54cb fix rate limit async issue, kill old code 2026-01-06 23:52:51 -05:00
08a9ad35af updating auth token security 2026-01-06 23:11:19 -05:00
7e89e6dda2 removed excess comments 2026-01-04 11:14:54 -05:00
9a10c88c98 perf changes 2026-01-03 10:20:06 -05:00
40c022c420 config cleanup 2026-01-03 09:49:50 -05:00
36664b24b2 minor changes 2026-01-03 09:36:27 -05:00
4f1e9a6d6d made swipe trigger more sensitive 2026-01-01 16:46:59 -05:00
0fb071a5d7 password validation meter 2026-01-01 14:51:23 -05:00
658cf98b7b update help 2026-01-01 14:26:30 -05:00
8e77727148 config centralized 2026-01-01 02:22:33 -05:00