feat(web-next): resolve the session user + live compliance context

The tRPC createContext was () => ({}) — the mounted dsr/consent routers
401'd every call and the dsr singleton stub threw (audit finding A11).
createTrpcContext now accepts an app resolveUser hook; web-next resolves
the session cookie through the auth feature's validateSession (denylist
included) plus a role snapshot, and threads bindProductionDsr/Consent
(or dev-seed) bindings into every request. The dsr router resolves its
binding from ctx.dsrBinding per request instead of a throwing proxy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-10 17:55:05 +02:00
parent 8b78563881
commit 49241845b5
12 changed files with 453 additions and 48 deletions

9
pnpm-lock.yaml generated
View File

@@ -188,9 +188,18 @@ importers:
"@repo/core-api":
specifier: workspace:*
version: link:../../packages/core-api
"@repo/core-audit":
specifier: workspace:*
version: link:../../packages/core-audit
"@repo/core-cms":
specifier: workspace:*
version: link:../../packages/core-cms
"@repo/core-consent":
specifier: workspace:*
version: link:../../packages/core-consent
"@repo/core-dsr":
specifier: workspace:*
version: link:../../packages/core-dsr
"@repo/core-shared":
specifier: workspace:*
version: link:../../packages/core-shared