normogen/web/normogen-web/src
goose b55b7c34f8 feat: rate limiting + E2E crypto lifecycle test
Rate limiting (closes the last security gap #3):
- New RateLimiter: in-memory fixed-window IP-based limiter (std::sync::Mutex
  HashMap, no new deps). Configurable via RATE_LIMIT_MAX (default 100) +
  RATE_LIMIT_WINDOW_SECS (default 60) env vars.
- general_rate_limit_middleware now reads ClientIp from request extensions and
  rejects with 429 + Retry-After header when over the limit. Wired via
  from_fn_with_state in app.rs. Lived on AppState as Arc<RateLimiter>.
- Deleted the dead auth_rate_limit_middleware (never wired).
- 3 unit tests (allows up to N, independent IPs, window reset).

E2E crypto lifecycle test:
- Full zero-knowledge round-trip against jsdom's real Web Crypto: setup →
  encrypt → verify ciphertext → unlock with password → decrypt → recover via
  phrase → rewrap under new password → decrypt. Plus wrong-password/wrong-phrase
  failures and cross-user key isolation.
- Fixed wrapDek/unwrapDek: base64-encode raw DEK bytes (was using TextDecoder
  which produced non-base64), and make unwrapped DEK extractable (needed for
  rewrapDek to export).

Verified: backend 24 tests 0 warnings; frontend 24 tests, build clean.
2026-07-03 21:57:39 -03:00
..
components feat(web): unlock UX — re-derive DEK on page reload 2026-07-03 20:21:15 -03:00
crypto feat: rate limiting + E2E crypto lifecycle test 2026-07-03 21:57:39 -03:00
pages feat(web): unlock UX — re-derive DEK on page reload 2026-07-03 20:21:15 -03:00
services feat: zero-knowledge recovery (Phase 2) — wrapped-DEK model 2026-06-29 03:34:24 -03:00
store feat(web): unlock UX — re-derive DEK on page reload 2026-07-03 20:21:15 -03:00
test feat: Phase 3c — dose logging + adherence, profile management, tests 2026-06-28 10:32:28 -03:00
types feat: zero-knowledge recovery (Phase 2) — wrapped-DEK model 2026-06-29 03:34:24 -03:00
App.tsx feat(web): unlock UX — re-derive DEK on page reload 2026-07-03 20:21:15 -03:00
index.css docs(ai): reorganize documentation and update product docs 2026-03-09 11:04:44 -03:00
main.tsx feat(web): Phase 3a — migrate CRA to Vite + make the app runnable 2026-06-28 00:47:19 -03:00
setupTests.ts feat: Phase 3c — dose logging + adherence, profile management, tests 2026-06-28 10:32:28 -03:00
theme.ts feat(web): Phase 3a — migrate CRA to Vite + make the app runnable 2026-06-28 00:47:19 -03:00
vite-env.d.ts feat(web): Phase 3a — migrate CRA to Vite + make the app runnable 2026-06-28 00:47:19 -03:00