dorfteich/apps/api/src/notifications
Claude Fable 5 3d1f4fda53
All checks were successful
CI / Build container images (pull_request) Successful in 3m51s
CI / Auth e2e pack (pull_request) Successful in 7m49s
CI / Import/export fidelity gate (pull_request) Successful in 56s
CI / Lint, typecheck, test (pull_request) Successful in 4m43s
CD / Build and push images (push) Successful in 20s
CD / Deploy to Test (push) Successful in 16s
CD / Smoke tests against Test (push) Successful in 1m19s
CD / Promote to Int (push) Successful in 11s
CI / Lint, typecheck, test (push) Successful in 4m54s
CI / Build container images (push) Has been skipped
CI / Auth e2e pack (push) Successful in 7m39s
CI / Import/export fidelity gate (push) Successful in 59s
#188: purpose-bound token keys via HKDF, jose replaces the homegrown JWT
COLLAB_TOKEN_SECRET becomes a root key: every purpose derives its own
HKDF-SHA-256 subkey (deriveTokenKey), and no code path signs with the
root key directly. Collaboration tokens are signed and verified by jose
with HS256 as an explicit allowlist; the sign/verify API turns async at
its three call sites. Unsubscribe tokens move from a purpose-prefix
string to the structural subkey, with a documented dual-verify window
(legacy derivation accepted until 2026-11-01, covering the 90-day TTL
of links in already-sent mail).

The cross-runtime property that justified the homegrown implementation
is now proven by a test: the built CJS and ESM dist artefacts round-trip
tokens in both directions in child processes (jose v6 reaches CJS via
Node's require(esm), pinned Node 22 images). Negative tests cover
cross-purpose subkeys, root-key-signed tokens, alg:none and RS256.

Refs #188 (ADR 0020)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0168Ph5uBmHm8X28CSVpbpnJ
2026-07-30 06:41:11 +02:00
..
__snapshots__ Pin the comments/notifications semantics as a regression pack (#96) 2026-07-12 00:00:34 +02:00
digest.e2e.db.test.ts Batch notifications into localized e-mail digests with unsubscribe (#95) 2026-07-11 23:37:26 +02:00
digest.service.ts Batch notifications into localized e-mail digests with unsubscribe (#95) 2026-07-11 23:37:26 +02:00
digest.snapshot.db.test.ts Pin the comments/notifications semantics as a regression pack (#96) 2026-07-12 00:00:34 +02:00
mentions.e2e.db.test.ts #151: Mention-Benachrichtigungen über die Glocke 2026-07-20 01:25:16 +02:00
notifications.controller.ts Batch notifications into localized e-mail digests with unsubscribe (#95) 2026-07-11 23:37:26 +02:00
notifications.e2e.db.test.ts Notify watchers about page changes and comments, with an in-app center (#94) 2026-07-11 23:20:25 +02:00
notifications.module.ts Batch notifications into localized e-mail digests with unsubscribe (#95) 2026-07-11 23:37:26 +02:00
notifications.service.ts #151: Mention-Benachrichtigungen über die Glocke 2026-07-20 01:25:16 +02:00
unsubscribe-token.test.ts #188: purpose-bound token keys via HKDF, jose replaces the homegrown JWT 2026-07-30 06:41:11 +02:00
unsubscribe-token.ts #188: purpose-bound token keys via HKDF, jose replaces the homegrown JWT 2026-07-30 06:41:11 +02:00
version-event-listener.service.ts #151: Mention-Benachrichtigungen über die Glocke 2026-07-20 01:25:16 +02:00