c30b663c51
Lays the foundation for the `/api/admin/*` surface per ADR-0020.
This PR ships the guard, the `@RequireAdmin()` decorator, and a
self-test endpoint — no business routes yet.
- `AdminRoleGuard` (apps/portal-bff/src/admin/admin-role.guard.ts):
- No session → 401 (no audit; unauthenticated probes are noise).
- Session but `roles` lacks `admin` → 403 + `admin.access_denied`
audit row capturing actor hash, attempted route, and roles held.
- Session with `admin` → pass through.
- Audit-write failures propagate (no audit ⇒ no action,
consistent with the existing call sites in AuthController).
- `@RequireAdmin()` decorator wraps `@UseGuards(AdminRoleGuard)`
via `applyDecorators` so future composition (e.g. with the
upcoming `@RequireMfa()` for the admin entry route) is mechanical.
- `GET /api/admin/me` returns the public user payload + `roles` for
ops to verify the gate is wired correctly end-to-end. The handler
intentionally has no logic beyond the projection — the value of
the endpoint is the guard chain it forces traffic through.
- `AuditWriter.adminAccessDenied()` typed method keeps the salt
inside the audit module and matches the pattern of the existing
typed events. Uses the pre-existing `denied` outcome enum value.
Surface impact:
- No new env vars, no new dependencies.
- The shared portal-shell session is the auth source for this PR.
The distinct `__Host-portal_admin_session` cookie + admin auth
flow land in the next PR per the chantier sequence.
Tests: +11 specs (7 guard, 2 controller, 2 typed audit method).