Appearance
0002. Tenant provisioning and membership sync โ
Status: accepted. Applies to crates/doors and orbit tenant provision.
Decision โ
- Tenants are provisioned explicitly.
orbit tenant provision --org-id <sidecar org id> --name <name> [--module <id> ...]runs on the owner connection: it creates the tenant (Registry::provision_tenant), maps the sidecar organisation to it indoors.identitiesand writes the tenant's first audit entry with actor and doorSystem. That command is the only place a request-independentSystemaudit entry is written. No tenant is ever created from a token: a token whoseorg_idis not mapped isUNAUTHENTICATED. - Membership roles are synced from tokens, outside the bus. The web process sets a person's role to the token's
org_rolethroughdoors.set_role, a definer function onlyorbit_doorsmay execute. That role is held only by the web process (never by handlers, which run asorbit_runtime, nor by workers). Every change is audited in the same transaction (authz.membership.sync) and rate-limited per actor. The input is only ever a verified token. Moving it behind an audited bus command is tracked in issue #7. - Open sign-up is off by default. The sidecar refuses email sign-up unless
AUTH_ALLOW_SIGNUP=true(the dev stack sets it; the self-hosted stack does not). The first user and their organisation are created bydeploy/bootstrap.sh, which runs the sidecar'ssrc/bootstrap.tsin its container and thenorbit tenant provision. Users of the optional OIDC provider are still created on first sign-in: the provider decides who may sign in, and a user without a provisioned organisation reaches no tenant. - Any signed-in user can create organisations in the sidecar. That is harmless: an organisation reaches no tenant until an operator provisions it.
- The owner connection never reaches a serving process (ADR 0004):
orbit migrateandorbit tenant provisionare its only users.
Consequences โ
- An organisation created in the sidecar cannot use Orbit until an operator provisions it. Self-serve sign-up for the managed cloud needs a later decision (e.g. a provisioning service that holds the owner role and checks billing), not a token-triggered path.
- Anyone holding
orbit_doorscredentials can set any mapped person's role in any mapped tenant: treat its connection string like the owner's and give it to the web process only.