feat: tenant administration from the Studio, for instance administrators #23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/22-tenant-administration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #22
What
TenantAdministration(src/instance/tenant-admin.ts): list and create tenants, rename, suspend, reactivate, list members, add a member with roles, replace the roles, remove a member, list the accounts of the instance. It never deletes a tenant./api/admin/tenantsand/api/admin/accounts, through one guard (src/lib/tenant-admin-api.ts).TenantAdminPanel.tsx).Security
adminonly. They are refused under a tenant URL, where roles are those held in the tenant: an administrator of a tenant cannot create tenants nor see the accounts of the instance.SameSite=Lax).tenants: SELECT, INSERT, UPDATE;tenant_memberships: plus DELETE), which it could only read. It was already able to write the account table, roles included, so this does not give a compromised application a power it lacked, but the registry is no longer read-only for it.Deployment
Run
yarn admin migrateagain: it applies the new grants. An instance whose migrations run at each start gets them by itself.Verified
yarn test: 69 tests pass, 7 new (service on the in-memory store, the guard, the body reader) and the grant test updated./t/acme/…; once the tenant is suspended or the member removed, it gets 404;/t/acme/api/admin/tenants, 403 on/api/admin/tenants.Not verified
Out of scope
Per-tenant git repository, storage and AI provider: next part of the multi-tenant work. Until then, configuring a tenant means its name, its state and its members.
🤖 Generated with Claude Code