feat(admin): add temporary admin access (break-glass) #42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/admin-break-glass"
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): a reason is required (shown to the members); it lastsTRAEFIK_CONTROL_BREAK_GLASS_MINUTES(default 60, 1 to 1440). It is an ordinary admin membership withexpires_atandreason(reversible migration), so every existing permission check works unchanged.member.break_glass_started,_endedand_expiredin the organization's audit log, andorganization.break_glass_*in the server audit log. Expiry is done by the system, so audit events gain asystemactor (listed in the API's audit event schema).Membership.active/2, so an expired membership is gone everywhere at once. A page left open re-checks the access on every event and message, and a reaper (every minute, safe with several instances) deletes expired rows and writes the audit event.Admin.authorize_change/1; refused on a suspended organization, for someone who already is a member, and without a reason; never counts as one of the organization's own admins (its last admin still cannot be removed because a temporary one is present); the system administrator can always end it early, and the organization's admins can remove it from their members page.Verification
mix precommit: exit 0.mix credo --strict: no issues.mix dialyzer: passed.mix test: 1704 passed on SQLite and on PostgreSQL; migration rollback and re-apply clean on both.created,break_glass_startedandbreak_glass_expired(actorsystem), and the organization's own log the same member events.Notes