From 2cbd04b27fdfab5bff5c6ad3534373f44aa6a30d Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 10:46:33 +0000 Subject: [PATCH 1/5] feat(platform-objects): Remove Pending User row action on Setup -> Users Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb --- .../src/feature-gate-guard.test.ts | 1 + ...remove-pending-sso-user-visibility.test.ts | 88 +++++++++++++++++++ .../src/identity/sys-user.object.ts | 34 +++++++ 3 files changed, 123 insertions(+) create mode 100644 packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts diff --git a/packages/platform-objects/src/feature-gate-guard.test.ts b/packages/platform-objects/src/feature-gate-guard.test.ts index 6747346bd4e..858b061277c 100644 --- a/packages/platform-objects/src/feature-gate-guard.test.ts +++ b/packages/platform-objects/src/feature-gate-guard.test.ts @@ -188,6 +188,7 @@ function resolveGatedInput(path: string): { visibleSource: string | undefined } const SHOWN_WHEN_ON: ReadonlyArray<[string, PublicAuthFeatureName]> = [ ['sys_user.actions.add_sso_user', 'cloudManaged'], ['sys_user.actions.import_sso_users', 'cloudManaged'], + ['sys_user.actions.remove_sso_user', 'cloudManaged'], ]; describe('feature-gate completeness guard (#2874)', () => { diff --git a/packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts b/packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts new file mode 100644 index 00000000000..feda4c6bcec --- /dev/null +++ b/packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts @@ -0,0 +1,88 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * Setup → Users' Remove Pending User (`sys_user.remove_sso_user`) takes back a + * person added on a cloud-managed environment who has not signed in yet, and + * so cancels their invitation. Its door, plugin-auth's + * `admin/remove-sso-user`, answers only a platform administrator, only on a + * cloud-managed environment, and only for a row that is still pending + * (`source == 'idp_pending'`). So the row action is offered exactly there: + * pending row AND managed flag on AND the platform-admin standing. Each + * CONTROL drops one of the three and the action is hidden, never faulted. + * + * The predicate is EVALUATED through the canonical engine the console + * delegates to (`@objectstack/formula`) on the parsed object, as its sibling + * `cloud-managed-visibility.test.ts` does for Add / Import. + */ + +import { describe, expect, it } from 'vitest'; +import { celEngine } from '@objectstack/formula'; +import { SysUser } from './sys-user.object.js'; + +const ADMIN = { id: 'u_admin', email: 'admin@example.com', positions: ['org_owner'], isPlatformAdmin: true }; +/** Every grade below the rung: the organization owner. */ +const ORG_OWNER = { id: 'u_owner', email: 'owner@example.com', positions: ['org_owner'], isPlatformAdmin: false }; + +const MANAGED = { organization: true, admin: true, cloudManaged: true }; +const PENDING_ROW = { id: 'usr_pending', email: 'typo@example.com', source: 'idp_pending' }; + +function declared(): Record { + const action = ((SysUser.actions ?? []) as Array>).find((a) => a.name === 'remove_sso_user'); + if (!action) throw new Error('sys_user declares no action named "remove_sso_user"'); + return action; +} + +function visibleSource(): string { + const raw = declared().visible; + const source = typeof raw === 'string' ? raw : (raw as { source?: unknown } | undefined)?.source; + if (typeof source !== 'string') throw new Error('remove_sso_user has no CEL source'); + return source; +} + +/** The verdict, or the fault spelled out so a faulting predicate fails loudly. */ +function offered(subject: typeof ADMIN, record: Record, features: Record): boolean | string { + const r = celEngine.evaluate( + { dialect: 'cel', source: visibleSource() }, + { record, extra: { current_user: subject, user: subject, ctx: { user: subject }, features } }, + ); + if (!r.ok) return `FAULT ${r.error.message.split('\n')[0].trim()}`; + return typeof r.value === 'boolean' ? r.value : `NON-BOOLEAN ${JSON.stringify(r.value)}`; +} + +describe('Setup → Users offers Remove Pending User on a pending row, managed, to a platform admin only', () => { + it('is a row action that posts the row id to the remove-sso-user door behind a confirmation', () => { + const action = declared(); + expect(action.type).toBe('api'); + expect(action.target).toBe('/api/v1/auth/admin/remove-sso-user'); + expect(action.recordIdParam).toBe('userId'); + expect(action.locations).toEqual(['list_item', 'record_header']); + expect(typeof action.confirmText).toBe('string'); + // The door mounts with or without the better-auth admin plugin, as Add / Import do. + expect(action.requiresFeature).toBeUndefined(); + // No params: the door's body is the closed key set `{ userId }`. + expect(action.params ?? []).toEqual([]); + }); + + it('is offered to the platform admin on a pending row while the environment is cloud-managed', () => { + expect(offered(ADMIN, PENDING_ROW, MANAGED)).toBe(true); + }); + + it.each([ + ['a person who has signed in (idp_provisioned)', { ...PENDING_ROW, source: 'idp_provisioned' }], + ['a local account (env_native)', { ...PENDING_ROW, source: 'env_native' }], + ['a row the console did not project source for', { id: 'usr_pending', email: 'typo@example.com' }], + ])('CONTROL: is hidden on %s', (_row, record) => { + expect(offered(ADMIN, record, MANAGED)).toBe(false); + }); + + it.each([ + ['the flag is off', { ...MANAGED, cloudManaged: false }], + ['no flag is served', { organization: true, admin: true }], + ])('CONTROL: is hidden on a pending row when %s', (_case, features) => { + expect(offered(ADMIN, PENDING_ROW, features)).toBe(false); + }); + + it('CONTROL: is hidden from an organization owner below the platform-admin rung, on a pending managed row', () => { + expect(offered(ORG_OWNER, PENDING_ROW, MANAGED)).toBe(false); + }); +}); diff --git a/packages/platform-objects/src/identity/sys-user.object.ts b/packages/platform-objects/src/identity/sys-user.object.ts index 61d6d694206..f058d18c77a 100644 --- a/packages/platform-objects/src/identity/sys-user.object.ts +++ b/packages/platform-objects/src/identity/sys-user.object.ts @@ -73,6 +73,16 @@ const SERVICE_ACCOUNT_ADMIN_VISIBLE = [ const MANAGED_ADD_PERSON_VISIBLE = 'current_user.isPlatformAdmin == true && has(features.cloudManaged) && features.cloudManaged == true'; +/** + * Who is offered `remove_sso_user`, and on which row: the same standing and + * managed flag as Add / Import, then a row that is still pending + * (`source == 'idp_pending'`), the one row its door removes. Any other row is + * answered `409` there (a person who has signed in is deactivated instead). + * `has()` keeps it hidden on a row the console did not project `source` for. + */ +const MANAGED_REMOVE_PENDING_PERSON_VISIBLE = + `${MANAGED_ADD_PERSON_VISIBLE} && has(record.source) && record.source == 'idp_pending'`; + const TEMPORARY_PASSWORD_LABEL = 'Temporary password: copy it now, it is shown only once and never stored'; /** @@ -583,6 +593,30 @@ export const SysUser = ObjectSchema.create({ ], }, }, + // The undo of the two above: take a pending person back out, which also + // cancels their invitation. The door is plugin-auth's + // `admin/remove-sso-user` (`{ userId }`), platform-admin gated, answering + // only on a managed environment and only for a row that is still pending; + // it asks the hosting organisation first and removes no one when that + // organisation cannot be reached or refuses. No params, so the question + // rides `confirmText`. No `ai` block, as for its siblings. + { + name: 'remove_sso_user', + label: 'Remove Pending User', + icon: 'user-minus', + variant: 'danger', + locations: ['list_item', 'record_header'], + type: 'api', + target: '/api/v1/auth/admin/remove-sso-user', + requiredPermissions: [...PLATFORM_ADMIN_USERS_GATE], + visible: MANAGED_REMOVE_PENDING_PERSON_VISIBLE, + recordIdParam: 'userId', + 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.', + successMessage: 'Pending user removed', + refreshAfter: true, + }, { name: 'set_user_password', label: 'Set Password', From 5fb9832c9673fd3e9c4f1fc31df7f79d51100b84 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 10:54:50 +0000 Subject: [PATCH 2/5] chore(platform-objects): regenerate translations for Remove Pending User Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb --- .../src/apps/translations/en.objects.generated.ts | 5 +++++ .../src/apps/translations/es-ES.objects.generated.ts | 5 +++++ .../src/apps/translations/ja-JP.objects.generated.ts | 5 +++++ .../src/apps/translations/zh-CN.objects.generated.ts | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/packages/platform-objects/src/apps/translations/en.objects.generated.ts b/packages/platform-objects/src/apps/translations/en.objects.generated.ts index 9ef9ed39551..64f13a0d72b 100644 --- a/packages/platform-objects/src/apps/translations/en.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/en.objects.generated.ts @@ -284,6 +284,11 @@ export const enObjects: NonNullable = { } } }, + remove_sso_user: { + label: "Remove Pending User", + 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.", + successMessage: "Pending user removed" + }, set_user_password: { label: "Set Password", successMessage: "Password updated", diff --git a/packages/platform-objects/src/apps/translations/es-ES.objects.generated.ts b/packages/platform-objects/src/apps/translations/es-ES.objects.generated.ts index 60fc990d601..4a7ef584e34 100644 --- a/packages/platform-objects/src/apps/translations/es-ES.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/es-ES.objects.generated.ts @@ -284,6 +284,11 @@ export const esESObjects: NonNullable = { } } }, + remove_sso_user: { + label: "Quitar usuario pendiente", + 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.", + successMessage: "Usuario pendiente quitado" + }, set_user_password: { label: "Establecer contraseña", successMessage: "Contraseña actualizada", diff --git a/packages/platform-objects/src/apps/translations/ja-JP.objects.generated.ts b/packages/platform-objects/src/apps/translations/ja-JP.objects.generated.ts index e5e867e6e27..5cd6eb158c0 100644 --- a/packages/platform-objects/src/apps/translations/ja-JP.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/ja-JP.objects.generated.ts @@ -284,6 +284,11 @@ export const jaJPObjects: NonNullable = { } } }, + remove_sso_user: { + label: "保留中のユーザーを削除", + confirmText: "まだサインインしていないこのユーザーを削除し、招待を取り消しますか?その間にサインインした場合、またはホスト組織に接続できない場合は、誰も削除されません。", + successMessage: "保留中のユーザーを削除しました" + }, set_user_password: { label: "パスワードを設定", successMessage: "パスワードを更新しました", diff --git a/packages/platform-objects/src/apps/translations/zh-CN.objects.generated.ts b/packages/platform-objects/src/apps/translations/zh-CN.objects.generated.ts index 08b8d27506f..314ed4ba79b 100644 --- a/packages/platform-objects/src/apps/translations/zh-CN.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/zh-CN.objects.generated.ts @@ -284,6 +284,11 @@ export const zhCNObjects: NonNullable = { } } }, + remove_sso_user: { + label: "移除待登录用户", + confirmText: "移除这位尚未登录的人员并取消其邀请?如果对方在此期间已经登录,或无法联系到托管组织,则不会移除任何人。", + successMessage: "已移除待登录用户" + }, set_user_password: { label: "设置密码", successMessage: "密码已更新", From aea1fd6c47a22a447642875848d4805d8140cc29 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 11:00:37 +0000 Subject: [PATCH 3/5] chore(platform-objects): regenerate the remaining locale bundles Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb --- .../src/apps/translations/ar.objects.generated.ts | 5 +++++ .../src/apps/translations/ar.source-hashes.generated.ts | 3 +++ .../src/apps/translations/de.objects.generated.ts | 5 +++++ .../src/apps/translations/de.source-hashes.generated.ts | 3 +++ .../src/apps/translations/fr.objects.generated.ts | 5 +++++ .../src/apps/translations/fr.source-hashes.generated.ts | 3 +++ .../src/apps/translations/ko.objects.generated.ts | 5 +++++ .../src/apps/translations/ko.source-hashes.generated.ts | 3 +++ .../src/apps/translations/pt-BR.objects.generated.ts | 5 +++++ .../src/apps/translations/pt-BR.source-hashes.generated.ts | 3 +++ .../src/apps/translations/ru.objects.generated.ts | 5 +++++ .../src/apps/translations/ru.source-hashes.generated.ts | 3 +++ .../src/apps/translations/zh-Hant.objects.generated.ts | 5 +++++ .../src/apps/translations/zh-Hant.source-hashes.generated.ts | 3 +++ 14 files changed, 56 insertions(+) diff --git a/packages/platform-objects/src/apps/translations/ar.objects.generated.ts b/packages/platform-objects/src/apps/translations/ar.objects.generated.ts index 716e4c0b1d1..1df359ee862 100644 --- a/packages/platform-objects/src/apps/translations/ar.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/ar.objects.generated.ts @@ -284,6 +284,11 @@ export const arObjects: NonNullable = { } } }, + remove_sso_user: { + label: "Remove Pending User", + 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.", + successMessage: "Pending user removed" + }, set_user_password: { label: "تعيين كلمة المرور", successMessage: "تم تحديث كلمة المرور", diff --git a/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts index 95fadcc230d..88e6df5d443 100644 --- a/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts @@ -85,5 +85,8 @@ export const arGeneratedSourceHashes: Readonly> = { "objects.sys_sso_provider.fields.sign_out_of_idp.help": "ab8ff5fce3001c81", "objects.sys_sso_provider.fields.sign_out_of_idp.label": "212587b8191bb91b", "objects.sys_user._actions.import_sso_users.params.csv.label": "bfb77802b66a9222", + "objects.sys_user._actions.remove_sso_user.confirmText": "843b7846781ae0eb", + "objects.sys_user._actions.remove_sso_user.label": "27e40f055ed9dc98", + "objects.sys_user._actions.remove_sso_user.successMessage": "45facf16a8b5ebc7", "objects.sys_user.fields.source.options.idp_pending": "3751093c5b65b072", }; diff --git a/packages/platform-objects/src/apps/translations/de.objects.generated.ts b/packages/platform-objects/src/apps/translations/de.objects.generated.ts index a3f0ab6903e..a83e2630d8e 100644 --- a/packages/platform-objects/src/apps/translations/de.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/de.objects.generated.ts @@ -284,6 +284,11 @@ export const deObjects: NonNullable = { } } }, + remove_sso_user: { + label: "Remove Pending User", + 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.", + successMessage: "Pending user removed" + }, set_user_password: { label: "Passwort festlegen", successMessage: "Passwort aktualisiert", diff --git a/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts index cf91687b0df..628a3fca820 100644 --- a/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts @@ -226,6 +226,9 @@ export const deGeneratedSourceHashes: Readonly> = { "objects.sys_user._actions.add_sso_user.params.positions.label": "9a24c02e441eb0b4", "objects.sys_user._actions.import_sso_users.params.csv.label": "bfb77802b66a9222", "objects.sys_user._actions.register_service_account.params.name.label": "5274417ff1ccaf01", + "objects.sys_user._actions.remove_sso_user.confirmText": "843b7846781ae0eb", + "objects.sys_user._actions.remove_sso_user.label": "27e40f055ed9dc98", + "objects.sys_user._actions.remove_sso_user.successMessage": "45facf16a8b5ebc7", "objects.sys_user.fields.name.label": "5274417ff1ccaf01", "objects.sys_user.fields.principal_kind.options.human": "ed18d3469e10aef2", "objects.sys_user.fields.source.options.idp_pending": "3751093c5b65b072", diff --git a/packages/platform-objects/src/apps/translations/fr.objects.generated.ts b/packages/platform-objects/src/apps/translations/fr.objects.generated.ts index 48dfd002fa6..8a974a89c8d 100644 --- a/packages/platform-objects/src/apps/translations/fr.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/fr.objects.generated.ts @@ -284,6 +284,11 @@ export const frObjects: NonNullable = { } } }, + remove_sso_user: { + label: "Remove Pending User", + 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.", + successMessage: "Pending user removed" + }, set_user_password: { label: "Définir le mot de passe", successMessage: "Mot de passe mis à jour", diff --git a/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts index 052e7f2ba4d..19e26f7989d 100644 --- a/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts @@ -253,5 +253,8 @@ export const frGeneratedSourceHashes: Readonly> = { "objects.sys_sso_provider.fields.sign_out_of_idp.label": "212587b8191bb91b", "objects.sys_two_factor.fields.secret.label": "03cb32e33fa5cc45", "objects.sys_user._actions.import_sso_users.params.csv.label": "bfb77802b66a9222", + "objects.sys_user._actions.remove_sso_user.confirmText": "843b7846781ae0eb", + "objects.sys_user._actions.remove_sso_user.label": "27e40f055ed9dc98", + "objects.sys_user._actions.remove_sso_user.successMessage": "45facf16a8b5ebc7", "objects.sys_user.fields.source.options.idp_pending": "3751093c5b65b072", }; diff --git a/packages/platform-objects/src/apps/translations/ko.objects.generated.ts b/packages/platform-objects/src/apps/translations/ko.objects.generated.ts index 66bfd4657b8..c9c54c6edd0 100644 --- a/packages/platform-objects/src/apps/translations/ko.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/ko.objects.generated.ts @@ -284,6 +284,11 @@ export const koObjects: NonNullable = { } } }, + remove_sso_user: { + label: "Remove Pending User", + 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.", + successMessage: "Pending user removed" + }, set_user_password: { label: "비밀번호 설정", successMessage: "비밀번호 업데이트됨", diff --git a/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts index f4542414298..f70c7e7adb7 100644 --- a/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts @@ -115,5 +115,8 @@ export const koGeneratedSourceHashes: Readonly> = { "objects.sys_sso_provider.fields.sign_out_of_idp.help": "ab8ff5fce3001c81", "objects.sys_sso_provider.fields.sign_out_of_idp.label": "212587b8191bb91b", "objects.sys_user._actions.import_sso_users.params.csv.label": "bfb77802b66a9222", + "objects.sys_user._actions.remove_sso_user.confirmText": "843b7846781ae0eb", + "objects.sys_user._actions.remove_sso_user.label": "27e40f055ed9dc98", + "objects.sys_user._actions.remove_sso_user.successMessage": "45facf16a8b5ebc7", "objects.sys_user.fields.source.options.idp_pending": "3751093c5b65b072", }; diff --git a/packages/platform-objects/src/apps/translations/pt-BR.objects.generated.ts b/packages/platform-objects/src/apps/translations/pt-BR.objects.generated.ts index 39782dc89f4..b9beef7b7b0 100644 --- a/packages/platform-objects/src/apps/translations/pt-BR.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/pt-BR.objects.generated.ts @@ -284,6 +284,11 @@ export const ptBRObjects: NonNullable = { } } }, + remove_sso_user: { + label: "Remove Pending User", + 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.", + successMessage: "Pending user removed" + }, set_user_password: { label: "Definir senha", successMessage: "Senha atualizada", diff --git a/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts index dc8b3f44160..c86d9109f75 100644 --- a/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts @@ -158,5 +158,8 @@ export const ptBRGeneratedSourceHashes: Readonly> = { "objects.sys_sso_provider.fields.sign_out_of_idp.help": "ab8ff5fce3001c81", "objects.sys_sso_provider.fields.sign_out_of_idp.label": "212587b8191bb91b", "objects.sys_user._actions.import_sso_users.params.csv.label": "bfb77802b66a9222", + "objects.sys_user._actions.remove_sso_user.confirmText": "843b7846781ae0eb", + "objects.sys_user._actions.remove_sso_user.label": "27e40f055ed9dc98", + "objects.sys_user._actions.remove_sso_user.successMessage": "45facf16a8b5ebc7", "objects.sys_user.fields.source.options.idp_pending": "3751093c5b65b072", }; diff --git a/packages/platform-objects/src/apps/translations/ru.objects.generated.ts b/packages/platform-objects/src/apps/translations/ru.objects.generated.ts index 1df5ada9c4d..a831dc63a37 100644 --- a/packages/platform-objects/src/apps/translations/ru.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/ru.objects.generated.ts @@ -284,6 +284,11 @@ export const ruObjects: NonNullable = { } } }, + remove_sso_user: { + label: "Remove Pending User", + 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.", + successMessage: "Pending user removed" + }, set_user_password: { label: "Задать пароль", successMessage: "Пароль обновлён", diff --git a/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts index 803c7a5c745..c5c1bc306f5 100644 --- a/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts @@ -114,5 +114,8 @@ export const ruGeneratedSourceHashes: Readonly> = { "objects.sys_sso_provider.fields.sign_out_of_idp.help": "ab8ff5fce3001c81", "objects.sys_sso_provider.fields.sign_out_of_idp.label": "212587b8191bb91b", "objects.sys_user._actions.import_sso_users.params.csv.label": "bfb77802b66a9222", + "objects.sys_user._actions.remove_sso_user.confirmText": "843b7846781ae0eb", + "objects.sys_user._actions.remove_sso_user.label": "27e40f055ed9dc98", + "objects.sys_user._actions.remove_sso_user.successMessage": "45facf16a8b5ebc7", "objects.sys_user.fields.source.options.idp_pending": "3751093c5b65b072", }; diff --git a/packages/platform-objects/src/apps/translations/zh-Hant.objects.generated.ts b/packages/platform-objects/src/apps/translations/zh-Hant.objects.generated.ts index 1b7cbfb7b32..891c35c6a8f 100644 --- a/packages/platform-objects/src/apps/translations/zh-Hant.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/zh-Hant.objects.generated.ts @@ -284,6 +284,11 @@ export const zhHantObjects: NonNullable = { } } }, + remove_sso_user: { + label: "Remove Pending User", + 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.", + successMessage: "Pending user removed" + }, set_user_password: { label: "設定密碼", successMessage: "密碼已更新", diff --git a/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts index e9a90d643c2..cedbb33ccf7 100644 --- a/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts @@ -108,5 +108,8 @@ export const zhHantGeneratedSourceHashes: Readonly> = { "objects.sys_sso_provider.fields.sign_out_of_idp.help": "ab8ff5fce3001c81", "objects.sys_sso_provider.fields.sign_out_of_idp.label": "212587b8191bb91b", "objects.sys_user._actions.import_sso_users.params.csv.label": "bfb77802b66a9222", + "objects.sys_user._actions.remove_sso_user.confirmText": "843b7846781ae0eb", + "objects.sys_user._actions.remove_sso_user.label": "27e40f055ed9dc98", + "objects.sys_user._actions.remove_sso_user.successMessage": "45facf16a8b5ebc7", "objects.sys_user.fields.source.options.idp_pending": "3751093c5b65b072", }; From 46931d4b9fe2c20ac9929156ef307b050dcc32c8 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 11:01:57 +0000 Subject: [PATCH 4/5] chore: changeset for Remove Pending User Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb --- .changeset/35220-remove-pending-sso-user-action.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .changeset/35220-remove-pending-sso-user-action.md diff --git a/.changeset/35220-remove-pending-sso-user-action.md b/.changeset/35220-remove-pending-sso-user-action.md new file mode 100644 index 00000000000..dab3aa8691f --- /dev/null +++ b/.changeset/35220-remove-pending-sso-user-action.md @@ -0,0 +1,10 @@ +--- +'@objectstack/platform-objects': patch +--- + +feat(platform-objects): Setup → Users can take a pending person back out on a managed environment + +Clause-②: no +Metadata-protocol: none + +`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. From e6380b4f1cc008824fd5a7b90affd0d6f2f20a76 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 11:02:59 +0000 Subject: [PATCH 5/5] test(platform-objects): read the parsed confirmText template Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb --- .../src/identity/remove-pending-sso-user-visibility.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts b/packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts index feda4c6bcec..8e59b8d2d9a 100644 --- a/packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts +++ b/packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts @@ -56,7 +56,8 @@ describe('Setup → Users offers Remove Pending User on a pending row, managed, expect(action.target).toBe('/api/v1/auth/admin/remove-sso-user'); expect(action.recordIdParam).toBe('userId'); expect(action.locations).toEqual(['list_item', 'record_header']); - expect(typeof action.confirmText).toBe('string'); + // A confirmation is asked first (the parsed template, whatever its words). + expect((action.confirmText as { source?: unknown } | undefined)?.source).toEqual(expect.any(String)); // The door mounts with or without the better-auth admin plugin, as Add / Import do. expect(action.requiresFeature).toBeUndefined(); // No params: the door's body is the closed key set `{ userId }`.