Stateful sessions
Opaque tokens, hashed at rest. Revocation is a row update; role/privilege changes apply on the next request. withSession resolves and validates in one indexed query folded into the RLS transaction.
Stateful sessions
Opaque tokens, hashed at rest. Revocation is a row update; role/privilege changes apply on the next request. withSession resolves and validates in one indexed query folded into the RLS transaction.
Identity GUC contract
Each request sets exactly app.actor_id / app.session_id / app.active_role / app.privileges, transaction-scoped so they can’t leak. current_user_id() reads the actor; your RLS keys on it.
App-owned scope
The library sets no tenant/scope GUC. Pass a scope hook (or the flat-tenant preset) so your RLS model — producer/region/plant, rep hierarchy, flat tenants — stays yours.
Pluggable sign-in
Tenant-centric discovery; OTP (Twilio + dev-OTP) via the router; OIDC via a dedicated oauth4webapi handler. Core pulls in neither oauth4webapi nor Twilio — they’re opt-in subpaths.