Commit Graph

38 Commits

Author SHA1 Message Date
898c891bd5 chore: remediate pygienium audit findings
Dead code: 77 verified-unused exports, files (BackArrow, MenuBars,
cookies.ts, db/create.ts, schemas/comment.ts, security-headers.ts) and
12 unused dependencies removed
Comments: ~370 RESTATE comments stripped across 53 files; 2 verbose
blocks tightened; dead commented-out config removed
Complexity: bulkUpsert extracted into 11 per-entity helpers (CCN 156->~10);
login formHandler split into 3 submitters (CCN 63->~5); account page render
split into 8 section components (CCN 40); updatePost SQL builder rebuilt;
assert*Owned consolidated behind generic assertOwnedBy
Defensive guards: 4 redundant rethrow/nullish guards removed
2026-08-11 13:36:18 -04:00
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
d48bbc0fc3 security cleanup, fix turnstile 2026-05-28 16:48:06 -04:00
cda7784298 fix email link 2026-01-25 09:41:50 -05:00
7b60494d6d fix: duplication error 2026-01-21 12:57:58 -05:00
58d48dac70 checkpoint 2026-01-21 12:22:19 -05:00
1d8ec7a375 temp 2026-01-21 11:29:07 -05:00
48f01b6171 fix: safari cookie issue 2026-01-13 19:19:00 -05:00
4d35935462 remember me fix 2026-01-12 16:17:22 -05:00
f68f1f462a session state simplification 2026-01-12 09:24:58 -05:00
ed16b277f7 general: console cleanup 2026-01-12 00:24:24 -05:00
f056cf05d3 hopeful 2026-01-07 20:19:26 -05:00
244c8b6fb5 callback change 2026-01-07 18:53:41 -05:00
1b3c832fc3 change template loading 2026-01-07 18:17:58 -05:00
6a934880f9 mostly working 2026-01-07 17:53:21 -05:00
0a0c0e313e migrated 2026-01-07 16:22:31 -05:00
041b2f8dc2 oof 2026-01-07 14:37:40 -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
0fb071a5d7 password validation meter 2026-01-01 14:51:23 -05:00
8e77727148 config centralized 2026-01-01 02:22:33 -05:00
6e31246060 lockout 2025-12-30 09:50:04 -05:00
f5abf77454 idk h3 at all 2025-12-28 21:56:34 -05:00
4892dff38e style changes, and password login fix 2025-12-28 21:27:28 -05:00
1ba20339a8 security hardening 2025-12-28 20:04:29 -05:00
b412db92e5 validation 2025-12-26 15:04:18 -05:00
8ca8e6f712 remove excess comments 2025-12-23 10:30:51 -05:00
236555e41e zod fix 2025-12-23 10:23:43 -05:00
1dd852795e login fixes 2025-12-22 10:55:08 -05:00
9970c69872 conflict warning 2025-12-21 13:16:52 -05:00
f22e9c925b flow update 2025-12-21 13:10:58 -05:00
89e9a2ee45 protections 2025-12-20 23:41:50 -05:00
ee9db9f674 undone 2025-12-19 22:41:13 -05:00
3e606d2354 client->server stuff, nav on mobile improvements 2025-12-19 20:35:21 -05:00
3d55dab7b5 pre-tiptap 2025-12-19 12:04:18 -05:00
81969ae907 migrating 2025-12-17 00:23:13 -05:00
b3df3eedd2 continued migration 2025-12-16 23:31:12 -05:00
8fb748f401 init 2025-12-16 22:42:05 -05:00