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 2e868fa
Browse filesBrowse the repository at this point in the historyBrowse files
fix(auth): state the remove door's pending check as the engine delivers it, and prove the in-unit rollback
The row delete carries `source: 'idp_pending'`, but on an object with
cascading lookups the engine re-deletes by id after the cascade walk, so
a first sign-in committing in that window is not yet refused (#34373, an
engine defect). The docblocks, ledger note, docs and changeset now say
so instead of claiming the window is closed.
The in-unit sign-in test now runs the removal through the plugin's
transactional seam (a snapshot transaction on the memory engine) and
asserts the positions, permission sets and membership survive.
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
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ On a cloud-managed environment, a person added to sign in through the hosting or
15
15
- A host refusal (403/409) answers with the host's sentence, and no one is removed.
16
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 (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.
18
+
- A person who is not pending answers `409`: deactivate them instead. This holds at the removal itself: the person is re-checked inside the unit of work and the delete carries `source: 'idp_pending'`, so a person whose first sign-in lands while the host is asked is not removed. On an object with cascading lookups (such as `sys_user`) the engine re-deletes by id after the cascade, so a first sign-in committing in that narrow window is not yet refused.
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 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)'},
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 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 }; 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
it('a person whose first sign-in commits inside the unit of work, after the pending read, is not removed: 409',async()=>{
1445
+
it('a person whose first sign-in commits inside the unit of work, after the pending read, is not removed: 409, and the child deletes roll back',async()=>{
0 commit comments