Skip to content

v1 design

The full design lives in docs/v1-design.md (the source of truth). The headline decisions:

  • Stateful sessions, not JWT — tracking activity, tenant-wide sign-off, and immediate role/privilege changes all need per-request server authority.
  • One seam: the library owns identity + tenant + federation; each app owns its intra-tenant authorization scope (its RLS model) — see Authorization scope.
  • Privileges = roles.is_privilege — one roles table, one user_roles assignment, a flag.
  • Identity GUC contract: app.actor_id / app.session_id / app.active_role / app.privileges. Scope GUCs are app-owned.
  • Session tokens hashed at rest.
  • Generic schema consumed from @smplcty/schema-std (audit, soft_delete); the transaction primitive from @smplcty/db.
  • Sign-in methods are pluggable — OTP/dev-OTP via the router; OIDC via a dedicated handler (see ADR-0001).

For the per-app convergence plan (productionnow, salez1) and the full rationale, read the design doc.