Auth and Session
Implemented:
AuthProviderseam with dev-token and OIDC implementations.AuthContextwith actor, role, tenant, allowed tenants, session/token IDs, provider, and expiry metadata.- OIDC JWT verification with issuer, audience, expiration, signature, and JWKS cache checks.
- OIDC accepts only configured asymmetric
RS*/PS*algorithms. - Role claim mapping must resolve to exactly one OneProtect role.
- Centralized role helpers for read/write enforcement.
/api/v1/sessionfor frontend-visible actor/role/tenant context. For auditors with an active OP-057 access window, the response also includes redaction-safeactive_auditor_sessionmetadata used by OP-066n countdown UX; JWTexpires_atremains token expiry, not auditor access expiry.- Optional local Keycloak profile with realm
oneprotect-dev, clientoneprotect-console, and tenant/role/actor claim mappers.
Local/dev:
ONEPROTECT_AUTH_MODE=dev-tokenis allowed only in local/dev/test unless explicitly overridden.- Raw header auth is disabled by default and exists only as local/dev compatibility.
docker compose --profile auth up -d keycloakimportsdeploy/keycloak/realm-oneprotect-dev.json.- Local Keycloak users are
tenant-admin@example.test,operator@example.test, andauditor@example.test; all use placeholder passwordlocal-only-password. - Local Keycloak tokens map
tenant_id,role, andpreferred_usernameintoAuthContext.
Planned:
- Service-account token conventions for automation.
- Production Keycloak/managed OIDC realm lifecycle and secret handling.
- OPA-backed ABAC/policy decisions.
Source architecture note: docs/architecture/auth-session-seam.md.