cards/packages/cards-domain/src
Till JS e1ddbf34b3
Some checks are pending
CI / validate (push) Waiting to run
security(cards): fail-secure dev-stub, headers, rate-limit, dsgvo audit
Behebt live verifiziertes Auth-Bypass auf cardecky-api.mana.how
(X-User-Id → founder-Tier) und zieht im selben Patch das fehlende
Operations-/Compliance-Fundament nach.

* Auth-Middleware fail-secure: opt-in via CARDS_AUTH_DEV_STUB="true"
  (war opt-out, Default true). Compose-Default flipped auf "false",
  NODE_ENV="production" für cards-api ergänzt, env-Template
  dokumentiert. vitest.config.ts + tests/setup.ts aktivieren den
  Stub gezielt für Test-Suiten.
* Security-Headers: Hono secureHeaders() in apps/api,
  SvelteKit hooks.server.ts mit X-Frame/X-Content-Type/Referrer/
  HSTS in apps/web. CSP bewusst ausgelassen — eigener Sprint.
* CORS-localhost-Whitelist nur außerhalb Prod.
* Rate-Limiting (in-memory sliding window, dependency-frei) auf
  share.receive 60/min/IP, media.upload 30/min/user,
  decks.generate + decks.from-image 10/min/user, dsgvo.* 10/min/IP.
* Health-Endpoint mit echter DB- und MinIO-Probe; /healthz bleibt
  Liveness, /healthz/details ist Readiness mit 503 bei Failure.
* DSGVO-Honesty: storage_ok + storage_error im Response (statt
  schluckend console.warn), Account-UI zeigt Fehler-Toast.
* Audit-Log: strukturierte JSON-Zeile (kind: "audit") auf stdout
  für /dsgvo/export, /dsgvo/delete, /me/export, /me/delete.
* Bug-Fix: duplizierte case "multiple-choice"-Clause in fsrs.ts.

Verifiziert: apps/api 17 Files / 104 Tests grün, apps/web check
0 errors. Deploy auf Mac Mini steht noch aus.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 16:56:03 +02:00
..
protocol Phase 9d: Pre-Flight — Protocol-Mirror durch upstream ersetzt 2026-05-08 18:00:56 +02:00
schemas feat(cards): deck management UI + production auth portal wiring 2026-05-11 18:50:27 +02:00
cloze.ts Phase 9i: Cloze-Hint-Anzeige 2026-05-08 18:26:00 +02:00
content-hash.ts Phase 9j: Anki-Re-Import-Dedupe via content_hash 2026-05-08 18:29:56 +02:00
fsrs.ts security(cards): fail-secure dev-stub, headers, rate-limit, dsgvo audit 2026-05-12 16:56:03 +02:00
image-occlusion.ts Phase 9l: Image-Occlusion als 4. MVP-CardType 2026-05-08 18:50:45 +02:00
index.ts feat(cards): typing Card-Type mit Fuzzy-Match 2026-05-10 15:23:58 +02:00
typing.ts feat(cards): typing Card-Type mit Fuzzy-Match 2026-05-10 15:23:58 +02:00