You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 64d7c50
Browse filesBrowse the repository at this point in the historyBrowse files
fix(plugin-auth): ban and unban write the admin audit row; name the remove-sso-user row in the ledger note and docs
A ban or an unban that committed now writes the sibling doors' admin audit row
(writeAdminAudit, action update, event user.admin_banned / user.admin_unbanned,
hostNotified). A refused one writes none. Measured: without the admin plugin the
engine ban writer carries no attributed user, so plugin-audit's mirror row names
no administrator.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibyy9KSA69EGZtjDj9c
`POST /api/v1/auth/admin/ban-user` and `POST /api/v1/auth/admin/unban-user` now write one `sys_audit_log` row for a change that committed, through the same writer the other admin user doors use: `action: 'update'` on the target `sys_user`, naming the administrator, with `metadata``{ event: 'user.admin_banned' | 'user.admin_unbanned', hostNotified }`. A refused ban or unban writes no row. Without the admin plugin, plugin-audit's own row for the ban columns names no administrator, so this row is the record of who banned. The ban reason and expiry stay on plugin-audit's row for the user's change, not in `metadata`. The route ledger note for `admin/remove-sso-user` and the authentication docs now name that door's `user.admin_removed_pending` row.
{route: 'POST /api/v1/auth/admin/add-sso-user',family: 'objectstack-mount',source: 'objectstack',disposition: 'server-only',note: 'no SDK method builds this URL — Setup → Users on a cloud-managed environment posts it; adds one person who signs in only through the hosting organisation identity provider: a sys_user row marked idp_pending (no password, refused a session) with optional positions, permission sets and manager, joined to the organization; 201, or 200 alreadyPending for a person already pending (the host is told again, unless the person is deactivated: then host reads deactivated and nothing is sent); 409 RESOURCE_CONFLICT off a managed environment or for an address already in use; closed body key set (email, name, positions, permissionSets, manager) plus an optional organizationId, admitted only when it equals the caller session active organization: a different organization is 400 INVALID_REQUEST naming both organizations, a non-string or empty value is 400 INVALID_REQUEST (a non-string value is checked before the session), a string organization with no session organization is 400 NO_ACTIVE_ORGANIZATION, and every refusal writes nothing and tells no host; it never widens scope (the joined organization is the session one); the environment-user host is told after the write commits, and its answer rides host; platform-admin gated (ADR-0068)'},
264
264
{route: 'POST /api/v1/auth/admin/import-sso-users',family: 'objectstack-mount',source: 'objectstack',disposition: 'server-only',note: 'no SDK method builds this URL — Setup → Users on a cloud-managed environment posts it; the CSV or JSON twin of admin/add-sso-user (columns email, name, positions, permission_sets, manager_id), at most 500 rows, each judged and written on its own so a bad row fails alone; answers a summary and one result per row; body { csv } or { rows } plus the same optional organizationId as admin/add-sso-user, admitted only when it equals the caller session active organization: a different organization is 400 INVALID_REQUEST naming both organizations, a non-string or empty value is 400 INVALID_REQUEST (a non-string value is checked before the session), a string organization with no session organization is 400 NO_ACTIVE_ORGANIZATION, and every refusal writes nothing and tells no host; it never widens scope; 409 RESOURCE_CONFLICT off a managed environment; platform-admin gated (ADR-0068)'},
265
-
{route: 'POST /api/v1/auth/admin/remove-sso-user',family: 'objectstack-mount',source: 'objectstack',disposition: 'server-only',note: 'no SDK method builds this URL — Setup → Users on a cloud-managed environment posts it; removes a person who is still pending (sys_user.source idp_pending: the email-typo case) with their positions, permission sets and membership, and cancels their invitation at the environment-user host (userRemoved, else userDeactivated), which is asked first so its typed refusal leaves the person as they are; a host that cannot be reached refuses it with 503 SERVICE_UNAVAILABLE and nothing is removed (the door calls the host once and keeps no record to retry from); the person is re-checked inside the unit of work and the row delete carries source idp_pending, so a person who signs in while the host is asked is kept with 409 (on an object with cascading lookups the engine re-deletes by id, so a first sign-in committing in that narrow window is not yet refused); a removal that fails after the host took the cancellation sends the invitation again once through userAdded and says so; body { userId } plus the same optional organizationId as admin/add-sso-user, admitted only when it equals the caller session active organization: a different organization is 400 INVALID_REQUEST naming both organizations, a non-string or empty value is 400 INVALID_REQUEST (a non-string value is checked before the session), a string organization with no session organization is 400 NO_ACTIVE_ORGANIZATION, and every refusal writes nothing and tells no host; it never widens scope; 404 RESOURCE_NOT_FOUND for an unknown id; 409 RESOURCE_CONFLICT off a managed environment or for a person who is not pending; a lookup that restricts the delete refuses it with the engine answer; platform-admin gated (ADR-0068)'},
265
+
{route: 'POST /api/v1/auth/admin/remove-sso-user',family: 'objectstack-mount',source: 'objectstack',disposition: 'server-only',note: 'no SDK method builds this URL — Setup → Users on a cloud-managed environment posts it; removes a person who is still pending (sys_user.source idp_pending: the email-typo case) with their positions, permission sets and membership, and cancels their invitation at the environment-user host (userRemoved, else userDeactivated), which is asked first so its typed refusal leaves the person as they are; a host that cannot be reached refuses it with 503 SERVICE_UNAVAILABLE and nothing is removed (the door calls the host once and keeps no record to retry from); the person is re-checked inside the unit of work and the row delete carries source idp_pending, so a person who signs in while the host is asked is kept with 409 (on an object with cascading lookups the engine re-deletes by id, so a first sign-in committing in that narrow window is not yet refused); a removal that fails after the host took the cancellation sends the invitation again once through userAdded and says so; body { userId } plus the same optional organizationId as admin/add-sso-user, admitted only when it equals the caller session active organization: a different organization is 400 INVALID_REQUEST naming both organizations, a non-string or empty value is 400 INVALID_REQUEST (a non-string value is checked before the session), a string organization with no session organization is 400 NO_ACTIVE_ORGANIZATION, and every refusal writes nothing and tells no host; it never widens scope; 404 RESOURCE_NOT_FOUND for an unknown id; 409 RESOURCE_CONFLICT off a managed environment or for a person who is not pending; a lookup that restricts the delete refuses it with the engine answer; a removal that committed writes one admin audit row (sys_audit_log action delete, metadata event user.admin_removed_pending with hostNotified), a refused one none; platform-admin gated (ADR-0068)'},
266
266
{route: 'POST /api/v1/auth/admin/list-platform-admins',family: 'objectstack-mount',source: 'objectstack',disposition: 'server-only',note: 'no SDK method builds this URL — the sys_user list_platform_admins action posts it directly from the Users list; answers who holds platform-admin standing (the last-admin guard\'s enumerator, each id confirmed by hasPlatformAdminStanding), served only to a caller who holds that standing; reads no body. ADR-0095 D3'},
267
267
{route: 'POST /api/v1/auth/admin/oauth2/toggle-disabled',family: 'objectstack-mount',source: 'objectstack',disposition: 'server-only',note: 'no SDK method builds this URL — the sys_oauth_application disable/enable actions post it directly; ObjectStack mount closing a vendor gap (better-auth\'s /admin/oauth2/update-client strips `disabled` from its body schema), platform-admin gated (ADR-0068)'},
268
268
// #30958 — the tracker id stays HERE and never in the `note` string, per the
0 commit comments