feat(admin): manage organizations from /admin #41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/admin-organizations"
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?
Summary
Changes
/admin/organizations): list with search and paging (name, status, member/node/resource counts); create for a designated owner by email (an existing account becomes admin at once, anyone else gets an admin invitation whose link is shown once); assign an admin; replace an admin (only when another admin is left, so an invited replacement has to join first); suspend and reactivate; delete by typing the slug./admin/audit, newserver_audit_eventstable, reversible migration): written in the same transaction as each change, append-only, pruned with the other audit logs, never holds a secret. Identity provider create/update/delete are recorded in it too (Phase 1 left them unrecorded). Member-affecting actions (admin added, suspension) also land in the organization's own log.Admin.authorize_change/1in the context (second factor plus recent login) as well as the page. The owner is invited or promoted through the organization's own functions with an admin scope that exists only for that call./orgs/newstays forTRAEFIK_CONTROL_SIGNUP=open, because removing it would break self-service organizations; system administrators are sent to/admin/organizations/new, and the "New organization" button points there for them.Verification
mix precommit: exit 0.mix credo --strict: no issues.mix dialyzer: passed.mix test: 1670 passed on SQLite and on PostgreSQL; migration rollback and re-apply clean on both./api/traefik/v1/configwith the node token: active gave the routers, suspended gave{}with HTTP 200, reactivation restored it; a wrong slug was refused, the right one deleted the organization (the node's next poll then gets 401), and the audit page listed created, suspended, reactivated and deleted.Notes