Fix auth gaps, FR24 import guards, and email safety; add audit doc #3

Merged
ronnyandre merged 1 commit from fix/audit-quick-wins into main 2026-06-02 23:13:38 +02:00
Owner

Quick-win fixes from a deep code audit (see docs/audit-2026-06.md).

Fixes

  • C1 (critical): enrichFlight now requires auth — anonymous callers could previously drain the shared AeroDataBox monthly quota.
  • H3 (high): reference search fns (searchAirports/searchAirlines/searchAircraftTypes/getAirportById) now gate on requireUserId().
  • H1 (high): FR24 import guards optional CSV columns (Flight number, Registration, Seat number, Note) with ?? — a missing header no longer throws on every row.
  • H2 (high): notifyAdmin + verification email now .catch send rejections (no more unhandled rejections); new-flight email HTML-escapes user freeform values.

Docs

  • Adds docs/audit-2026-06.md (full findings + competitive roadmap), linked from CLAUDE.md.

Verified: pnpm typecheck, pnpm lint, pnpm test (23/23) all pass.

Quick-win fixes from a deep code audit (see `docs/audit-2026-06.md`). **Fixes** - **C1 (critical):** `enrichFlight` now requires auth — anonymous callers could previously drain the shared AeroDataBox monthly quota. - **H3 (high):** reference search fns (`searchAirports`/`searchAirlines`/`searchAircraftTypes`/`getAirportById`) now gate on `requireUserId()`. - **H1 (high):** FR24 import guards optional CSV columns (`Flight number`, `Registration`, `Seat number`, `Note`) with `?? ` — a missing header no longer throws on every row. - **H2 (high):** `notifyAdmin` + verification email now `.catch` send rejections (no more unhandled rejections); new-flight email HTML-escapes user freeform values. **Docs** - Adds `docs/audit-2026-06.md` (full findings + competitive roadmap), linked from `CLAUDE.md`. Verified: `pnpm typecheck`, `pnpm lint`, `pnpm test` (23/23) all pass.
- enrichFlight: require auth so anonymous callers can't drain the shared
  AeroDataBox quota (matches enrichAircraftByReg)
- reference search fns: gate searchAirports/airlines/aircraftTypes and
  getAirportById behind requireUserId
- import-fr24: guard optional CSV columns (Flight number, Registration,
  Seat number, Note) with ?? '' so a missing header no longer fails every row
- notifyAdmin + verification email: catch send rejections instead of leaving
  them unhandled; HTML-escape user freeform values in the new-flight email
- docs/audit-2026-06.md: code-audit findings + competitive roadmap, linked
  from CLAUDE.md
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ronnyandre/fliary!3
No description provided.