New phase from the 5-item analysis: linked showcase snippets + animations, runnable scaffolding generators (pages/wizards/context/SSP), dependency graph + declarative boundaries, PII hardening (branded Bsn VO + masked-value atom + persisted no-PII audit) doubling as a privacy showcase, and Vitest coverage. Goal: both a teaching showcase and a production starter template. Sequenced with priorities + dependencies in the README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1.5 KiB
1.5 KiB
WP-41 — Persisted, queryable authz/PII-reveal audit
Status: todo Phase: 8 — platform/DX/showcase Priority: P2 Depends on: WP-40
Why
The security-relevant events (authz denials via AuditAuthz, BIG-nummer reveal, step-up) are
log-only — never persisted, so there's no queryable trail. The one persisted AuditEntry table
covers document lifecycle only. PRD-0002 §8 calls for a persisted authorization audit. A register
(BIO) wants this queryable, and strictly data-minimised.
Decisions
- Persist authz/reveal/step-up events into a data-minimised EF table extending the existing
AuditEntry/AppDbContextpattern: role, action, resource-ref, decision, correlation-id, timestamp — never the value or any PII. - Wire
AuditAuthz+ the reveal endpoint to persist (in addition to the log line). - Optional thin admin read view — reuse
cases:manageor add anaudit:readcapability.
Files
backend/.../Data/— new audit entity +AppDbContextDbSet + EF migration.backend/.../Program.cs—AuditAuthz+ reveal endpoint persist.- Backend tests: events are persisted; no PII columns; correlation-id captured.
- (Optional) FE audit read page + adapter/store, gated by the capability.
Acceptance criteria
- Denials, reveals, and step-up attempts land as rows with no PII/value fields.
- A test asserts the schema carries no name/bsn/value column.
dotnet test+npm run cigreen; api-client drift clean if endpoints added.