Workspaces & roles
A workspace is the tenant boundary. A user can belong to many; each session has one active workspace.
Accounts and sign-in#
/register/ creates the user, a personal workspace and an owner membership, then signs the user in. /login/ selects the default active workspace. Five failed password attempts lock the account for 15 minutes; failed attempts and successes are written to LoginEvent.
- Two-factor challenges are single-use, expire quickly, allow five invalid codes and are rate-limited.
- Email verification links are signed and expire after 48 hours. Signed-in users can resend from Settings.
- Password reset links use Django's signed token generator; completing a reset writes a security audit entry and a
LoginEvent. - Google and GitHub sign-in are optional; see Configuration → Social sign-in.
- Production login never pre-fills credentials. Demo builds (
ZEPHAI_ENV=demo) show the documented demo accounts.
Create and switch#
Registered users get a personal workspace. Dashboard → Workspaces → New workspace creates a team. The sidebar switcher and account menu post to /dashboard/workspace/<uuid>/switch/, which validates membership before writing the session.
Roles#
| Role | Can do |
|---|---|
| Owner | Everything, including workspace deletion and billing identity. |
| Admin | Invite/remove members, keys, subscriptions, settings except owner transfer. |
| Developer | Keys, subscriptions, playground, logs, alerts. |
| Analyst | Usage, logs, exports, alerts read. |
| Viewer | Read-only console. |
| Vendor roles | Scoped to the vendor workspace: owner, admin, editor, analyst. |
Vendor workspaces#
/org/onboarding/ creates a pending Vendor, a vendor workspace and an owner membership. Staff verify the vendor before listings can go live. The vendor workspace is linked one-to-one to the vendor organisation.
Default workspace#
Sign-in and registration choose the membership marked default (or the earliest active membership). The console always renders that workspace until the user switches.