Skip to content

Commit 89ea9bf

Browse files
feat(platform-objects): Setup → Users can remove a pending person on a managed environment (#35487)
Fixes #35220 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:托管环境里,平台管理员在 Setup → Users 中对"尚未首次登录"的人员行,可以点"移除待登录用户",确认后该行被删除,其邀请随之取消。 - 为什么做:管理员填错邮箱或加错人后,此前没有任何按钮能把这条待登录记录撤回,陌生人手里的邀请会一直有效。 - 出错会怎样:按钮只在"托管环境 + 平台管理员 + 待登录行"三者同时成立时出现;服务端本身仍逐条把关,对方已登录或托管组织联系不上时不会删除任何人,回滚即撤下这个按钮。 - 要你做什么:无,席位落地。 ## What changes - `sys_user` gains the row action `remove_sso_user` (label "Remove Pending User", Users list row + record header). It posts the row id as `userId` to plugin-auth's existing `/api/v1/auth/admin/remove-sso-user`, behind a `confirmText` confirmation (no params, so the question rides `confirmText`, the `impersonate_user` precedent). - Visibility: the Add / Import standing and managed flag (`current_user.isPlatformAdmin == true && has(features.cloudManaged) && features.cloudManaged == true`), then `has(record.source) && record.source == 'idp_pending'`, the field the door itself checks (`isPendingSsoSource(target.source)`). - The confirmation promises no more than the door does: it says no one is removed if the person has signed in meanwhile or the hosting organization cannot be reached (the door's 409 and 503). - Labels through the regenerated translation bundles (`node scripts/check-i18n-bundles.mjs --write`), hand-translated for zh-CN, ja-JP and es-ES; the other seven locales carry the source copy with its source hash, as Add / Import do. - The server door is unchanged. ## Tests - New `packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts`: the predicate evaluated through `@objectstack/formula`. Offered on pending + managed + platform admin; CONTROLs hidden on an `idp_provisioned` row, an `env_native` row, a row with no `source`, flag off, no flag served, and an org owner below the rung. Also pins the target, `recordIdParam: 'userId'`, no params, no `requiresFeature`. - `pnpm --filter @objectstack/platform-objects exec vitest run`: Test Files 124 passed (124), Tests 2061 passed (2061). `pnpm --filter @objectstack/platform-objects typecheck`: exit 0. ## Acceptance notes - The live drive "dialog posts to the door and the row is gone" sits beside the door's own tests in plugin-auth `pending-sso-users.test.ts` (the `[#33186]` block drives Add / Import declared actions); that file is outside this claim's surface, so no live-drive pin for `remove_sso_user` was added there. The door's removal and invitation cancellation are already pinned by its own suites. ## 席位核对 - Deviation (approved by the seat before widening): `packages/platform-objects/src/feature-gate-guard.test.ts` gains one row, `['sys_user.actions.remove_sso_user', 'cloudManaged']` in `SHOWN_WHEN_ON`. The guard's reverse walk books every `features.*` reference in an action predicate, so without it the guard goes red. - A1: at origin/main no `sys_user` action targets `remove-sso-user` (grep: only plugin-auth tests and dogfood route rosters name it), and `userActions` opens `edit` only, so the standard delete is off. The gap holds. - A2: siblings use `MANAGED_ADD_PERSON_VISIBLE`; pending is `record.source == 'idp_pending'`, the value the door checks. - A3: no forward or allow entry. `buildApiActionRequest` is generic and stamps `organizationId`, which the door's `unknownBodyKeys` admits. The standing census in `platform-admin-affordance-standing.test.ts` is a floor that picks the action up by its target; it passes unchanged. `platform-objects.test.ts` rows are not exhaustive for `SysUser`; unchanged. - A4: body `{ userId }` (closed key set plus stamped `organizationId`); refusals 409 (not pending / not managed), 503 (host unreachable), 404, 400. The confirmation names only the 409 and 503 cases. <details><summary>Ablation (one-shot, restored, blob checked against HEAD)</summary> - Dropped the pending term (`node scripts/ablation-replace.mjs`, anchor 1 to 0): 3 failed, 5 passed; the three non-pending CONTROLs went red. Restored: blob == HEAD, `git diff HEAD` empty. - Replaced the standing and managed terms with `true`: the flag-off, no-flag and org-owner CONTROLs went red. Restored the same way. - The first pending-term attempt used a replacement that already occurred 684 times, so the tool refused it as unverifiable and restored. That run was a no-op. It was redone with a distinct marker. - The suite imports `./sys-user.object.js` from source, so no `dist/` leg applies. </details> <details><summary>Derived gates (dispatch-gates --commands, exit codes captured before any pipe)</summary> - 65 of 66 derived families ran, each exit 0 (including `check:i18n` "platform-objects in sync (32 bundle(s))", `check:i18n-stale-fill`, `check:nul-bytes`, `check:cross-package-test-inputs`, `check:type-check-coverage`, the changeset families). - NOT MEASURED: `check:dual-build-cjs-loads`, reason: PREREQUISITE NOT MET (exit 3). It needs a whole-workspace `pnpm build` and this container has partial `dist/`. Left to CI as a declared narrowing. - `test:repo` not run locally: no file of that project changed. CI's Test Core covers it. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent e2f3094 commit 89ea9bf

22 files changed

Lines changed: 210 additions & 0 deletions
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/platform-objects': patch
3+
---
4+
5+
feat(platform-objects): Setup → Users can take a pending person back out on a managed environment
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`sys_user` gains a row action, `remove_sso_user` (Remove Pending User), on the Users list row and the user record header. It posts the row's id as `userId` to plugin-auth's `admin/remove-sso-user`, which removes a person added ahead of their first sign-in and cancels their invitation at the hosting organization. It is offered only where that door answers: to a platform administrator, on a cloud-managed environment, on a row that is still pending (`source` is `idp_pending`). A confirmation dialog asks first and says that no one is removed when the person has signed in meanwhile or the hosting organization cannot be reached. The door itself is unchanged. Its labels are added to the translation bundles, translated for zh-CN, ja-JP and es-ES.

‎packages/platform-objects/src/apps/translations/ar.objects.generated.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ export const arObjects: NonNullable<TranslationData['objects']> = {
284284
}
285285
}
286286
},
287+
remove_sso_user: {
288+
label: "Remove Pending User",
289+
confirmText: "Remove this person, who has not signed in yet, and cancel their invitation? If they have signed in meanwhile, or the hosting organization cannot be reached, no one is removed.",
290+
successMessage: "Pending user removed"
291+
},
287292
set_user_password: {
288293
label: "تعيين كلمة المرور",
289294
successMessage: "تم تحديث كلمة المرور",

‎packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,8 @@ export const arGeneratedSourceHashes: Readonly<Record<string, string>> = {
8585
"objects.sys_sso_provider.fields.sign_out_of_idp.help": "ab8ff5fce3001c81",
8686
"objects.sys_sso_provider.fields.sign_out_of_idp.label": "212587b8191bb91b",
8787
"objects.sys_user._actions.import_sso_users.params.csv.label": "bfb77802b66a9222",
88+
"objects.sys_user._actions.remove_sso_user.confirmText": "843b7846781ae0eb",
89+
"objects.sys_user._actions.remove_sso_user.label": "27e40f055ed9dc98",
90+
"objects.sys_user._actions.remove_sso_user.successMessage": "45facf16a8b5ebc7",
8891
"objects.sys_user.fields.source.options.idp_pending": "3751093c5b65b072",
8992
};

‎packages/platform-objects/src/apps/translations/de.objects.generated.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ export const deObjects: NonNullable<TranslationData['objects']> = {
284284
}
285285
}
286286
},
287+
remove_sso_user: {
288+
label: "Remove Pending User",
289+
confirmText: "Remove this person, who has not signed in yet, and cancel their invitation? If they have signed in meanwhile, or the hosting organization cannot be reached, no one is removed.",
290+
successMessage: "Pending user removed"
291+
},
287292
set_user_password: {
288293
label: "Passwort festlegen",
289294
successMessage: "Passwort aktualisiert",

‎packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ export const deGeneratedSourceHashes: Readonly<Record<string, string>> = {
226226
"objects.sys_user._actions.add_sso_user.params.positions.label": "9a24c02e441eb0b4",
227227
"objects.sys_user._actions.import_sso_users.params.csv.label": "bfb77802b66a9222",
228228
"objects.sys_user._actions.register_service_account.params.name.label": "5274417ff1ccaf01",
229+
"objects.sys_user._actions.remove_sso_user.confirmText": "843b7846781ae0eb",
230+
"objects.sys_user._actions.remove_sso_user.label": "27e40f055ed9dc98",
231+
"objects.sys_user._actions.remove_sso_user.successMessage": "45facf16a8b5ebc7",
229232
"objects.sys_user.fields.name.label": "5274417ff1ccaf01",
230233
"objects.sys_user.fields.principal_kind.options.human": "ed18d3469e10aef2",
231234
"objects.sys_user.fields.source.options.idp_pending": "3751093c5b65b072",

‎packages/platform-objects/src/apps/translations/en.objects.generated.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
284284
}
285285
}
286286
},
287+
remove_sso_user: {
288+
label: "Remove Pending User",
289+
confirmText: "Remove this person, who has not signed in yet, and cancel their invitation? If they have signed in meanwhile, or the hosting organization cannot be reached, no one is removed.",
290+
successMessage: "Pending user removed"
291+
},
287292
set_user_password: {
288293
label: "Set Password",
289294
successMessage: "Password updated",

‎packages/platform-objects/src/apps/translations/es-ES.objects.generated.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ export const esESObjects: NonNullable<TranslationData['objects']> = {
284284
}
285285
}
286286
},
287+
remove_sso_user: {
288+
label: "Quitar usuario pendiente",
289+
confirmText: "¿Quitar a esta persona, que aún no ha iniciado sesión, y cancelar su invitación? Si ha iniciado sesión mientras tanto o no se puede contactar con la organización anfitriona, no se quita a nadie.",
290+
successMessage: "Usuario pendiente quitado"
291+
},
287292
set_user_password: {
288293
label: "Establecer contraseña",
289294
successMessage: "Contraseña actualizada",

‎packages/platform-objects/src/apps/translations/fr.objects.generated.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ export const frObjects: NonNullable<TranslationData['objects']> = {
284284
}
285285
}
286286
},
287+
remove_sso_user: {
288+
label: "Remove Pending User",
289+
confirmText: "Remove this person, who has not signed in yet, and cancel their invitation? If they have signed in meanwhile, or the hosting organization cannot be reached, no one is removed.",
290+
successMessage: "Pending user removed"
291+
},
287292
set_user_password: {
288293
label: "Définir le mot de passe",
289294
successMessage: "Mot de passe mis à jour",

‎packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,5 +253,8 @@ export const frGeneratedSourceHashes: Readonly<Record<string, string>> = {
253253
"objects.sys_sso_provider.fields.sign_out_of_idp.label": "212587b8191bb91b",
254254
"objects.sys_two_factor.fields.secret.label": "03cb32e33fa5cc45",
255255
"objects.sys_user._actions.import_sso_users.params.csv.label": "bfb77802b66a9222",
256+
"objects.sys_user._actions.remove_sso_user.confirmText": "843b7846781ae0eb",
257+
"objects.sys_user._actions.remove_sso_user.label": "27e40f055ed9dc98",
258+
"objects.sys_user._actions.remove_sso_user.successMessage": "45facf16a8b5ebc7",
256259
"objects.sys_user.fields.source.options.idp_pending": "3751093c5b65b072",
257260
};

‎packages/platform-objects/src/apps/translations/ja-JP.objects.generated.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ export const jaJPObjects: NonNullable<TranslationData['objects']> = {
284284
}
285285
}
286286
},
287+
remove_sso_user: {
288+
label: "保留中のユーザーを削除",
289+
confirmText: "まだサインインしていないこのユーザーを削除し、招待を取り消しますか?その間にサインインした場合、またはホスト組織に接続できない場合は、誰も削除されません。",
290+
successMessage: "保留中のユーザーを削除しました"
291+
},
287292
set_user_password: {
288293
label: "パスワードを設定",
289294
successMessage: "パスワードを更新しました",

0 commit comments

Comments
 (0)