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 1f9b39d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(auth): hold the remove door to pending people at the row delete, and refuse it when the host is unreachable
Delta review round on the reshaped door:
- The sys_user delete carries `source: idp_pending` (a predicate delete,
which honours deleteBehavior like the by-id one); a zero-row delete
throws NoLongerPending, so a first sign-in committing inside the unit of
work is answered 409 and the child deletes roll back.
- A host that cannot be reached refuses the removal with 503 and nothing
removed, as it refuses a deactivation: with no framework record nothing
could ask the host again. The "not confirmed" sentence is gone with the
path that produced it.
- takeBackPerson's doc and throw text now hold for both callers.
- A banned column read back as '1' or 'true' counts as deactivated.
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjPP1zuWBNq3nBXVei9
Copy file name to clipboardExpand all lines: .changeset/33228-remove-pending-sso-user.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,9 @@ On a cloud-managed environment, a person added to sign in through the hosting or
13
13
14
14
- The host is told through `userRemoved`. A host without it is told through `userDeactivated` with `source: 'idp_pending'`, which already means "cancel the invitation". A host should implement `userRemoved`.
15
15
- A host refusal (403/409) answers with the host's sentence, and no one is removed.
16
-
- A host that cannot be reached does not block the removal; the answer says `host: { notified: false, reason: 'host_failed' }`. The door calls the host once: durable retry is the host's job.
16
+
- A host that cannot be reached refuses the removal with `503 SERVICE_UNAVAILABLE`, and no one is removed: the door calls the host once and keeps no record to ask again from, so try again. Durable retry is the host's job.
17
17
- With no host wired, the person is removed and the answer says `host: { notified: false, reason: 'no_host' }`.
18
-
- A person who is not pending answers `409`: deactivate them instead. This holds at the removal itself, so a person who signs in while the host is asked is not removed.
18
+
- A person who is not pending answers `409`: deactivate them instead. This holds at the removal itself (the row's delete carries the pending marker), so a person whose first sign-in lands while the host is asked or while the removal is written is not removed.
19
19
- A person that other records still point at (`deleteBehavior: 'restrict'`) answers the engine's refusal, and nothing is removed. If the host had already cancelled the invitation of a person who is still pending and not deactivated, the door sends it again through `userAdded`, once, and the answer says whether that worked.
20
20
- An unknown id answers `404`; a body with any key but `userId` answers `400`. Off a cloud-managed environment the door answers `409` and removes no one.
{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; the environment-user host is told after the write commits, and its answer rides host; platform-admin gated (ADR-0068)'},
262
262
{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; 409 RESOURCE_CONFLICT off a managed environment; platform-admin gated (ADR-0068)'},
263
-
{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 does not block it and the answer says host_failed (the door calls the host once; retrying belongs to the host); a removal that fails after the host took the cancellation sends the invitation again once through userAdded and says so; body { userId }; 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)'},
263
+
{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 row delete carries the pending marker, so a person who signs in meanwhile is kept with 409; a removal that fails after the host took the cancellation sends the invitation again once through userAdded and says so; body { userId }; 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)'},
264
264
{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'},
265
265
{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)'},
266
266
// #30958 — the tracker id stays HERE and never in the `note` string, per the
0 commit comments