Skip to content

Commit 3f0a307

Browse files
fix(platform-objects): sys_session.revoke_reason description names admin_password_reset (#23518)
Fixes #23477 Clause-②: no `sys_session.revoke_reason` is free text; its description is the field's only published vocabulary. It now names `admin_password_reset`, the value `plugin-auth/forced-reset-revocation.ts` (`FORCED_RESET_REVOKE_REASON`) writes on sessions an administrator's forced password reset revokes. Ruling (triage 6168824114): add the value with its cause and run `node scripts/check-i18n-bundles.mjs --write`; precedent #15784. ## Changes - `sys-session.object.ts`: description lists `admin_password_reset` after `organization_membership_ended`; the in-code comment records it as the second authorization-event cause. - `apps/translations/*.objects.generated.ts`: the generator rewrote `en`; the zh-CN, ja-JP and es-ES help strings are hand-written values, so I added the value there too, as #15784 did. - New `plugin-auth/src/forced-reset-revoke-reason-vocabulary.test.ts`: asserts the description contains the producer's constant (no existing test pinned the list; plugin-auth already depends on platform-objects, the reverse would not be allowed). - `.changeset/23477-revoke-reason-vocabulary.md`: patch for `@objectstack/platform-objects`, description text only. Landing spot matches the claim's file surface; the test sits in plugin-auth, the producer side. ## Evidence (head after merging origin/main) - `check-i18n-bundles.mjs --write` exit 0; plain run: all bundles in sync (10 packages). - plugin-auth new test 1/1; platform-objects full suite 70 files, 1091 tests; both packages' typecheck OK; `@objectstack/spec` `test:repo` 60 files, 1029 tests. - dispatch-gates: 66 derived families, all run, all exit 0 except `check:dual-build-cjs-loads` (exit 3, PREREQUISITE NOT MET, no dist for unrelated packages): NOT MEASURED, a description-only diff does not reach it. - No accept/refuse change, so no consumer sweep beyond the above. ## Acceptance notes Bundle folder is `apps/translations` (not `identity`); open PR #23469 also regenerates that folder, so the later lander re-runs the generator. --- _Generated by [Claude Code](https://claude.ai/code/session_01D6F9axfoPzR7t8G1J7Ytzz)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2811a63 commit 3f0a307

7 files changed

Lines changed: 26 additions & 5 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@objectstack/platform-objects': patch
3+
---
4+
5+
fix(platform-objects): the `sys_session.revoke_reason` description names `admin_password_reset`, the value an administrator's forced password reset writes on the sessions it revokes. Description text only; nothing is accepted or refused differently.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
342342
},
343343
revoke_reason: {
344344
label: "Revoke Reason",
345-
help: "Why the session was revoked (idle_timeout, absolute_max, concurrent_cap, user_revoked, admin, organization_membership_ended, …)."
345+
help: "Why the session was revoked (idle_timeout, absolute_max, concurrent_cap, user_revoked, admin, organization_membership_ended, admin_password_reset, …)."
346346
},
347347
active_organization_id: {
348348
label: "Active Organization"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ export const esESObjects: NonNullable<TranslationData['objects']> = {
342342
},
343343
revoke_reason: {
344344
label: "Motivo de la revocación",
345-
help: "Por qué se revocó la sesión (idle_timeout, absolute_max, concurrent_cap, user_revoked, admin, organization_membership_ended, …)."
345+
help: "Por qué se revocó la sesión (idle_timeout, absolute_max, concurrent_cap, user_revoked, admin, organization_membership_ended, admin_password_reset, …)."
346346
},
347347
active_organization_id: {
348348
label: "Organización activa"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ export const jaJPObjects: NonNullable<TranslationData['objects']> = {
342342
},
343343
revoke_reason: {
344344
label: "失効理由",
345-
help: "セッションが失効した理由(idle_timeout、absolute_max、concurrent_cap、user_revoked、admin、organization_membership_ended など)。"
345+
help: "セッションが失効した理由(idle_timeout、absolute_max、concurrent_cap、user_revoked、admin、organization_membership_ended、admin_password_reset など)。"
346346
},
347347
active_organization_id: {
348348
label: "アクティブ組織"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ export const zhCNObjects: NonNullable<TranslationData['objects']> = {
342342
},
343343
revoke_reason: {
344344
label: "撤销原因",
345-
help: "会话被撤销的原因(idle_timeout、absolute_max、concurrent_cap、user_revoked、admin、organization_membership_ended 等)。"
345+
help: "会话被撤销的原因(idle_timeout、absolute_max、concurrent_cap、user_revoked、admin、organization_membership_ended、admin_password_reset 等)。"
346346
},
347347
active_organization_id: {
348348
label: "当前组织"

‎packages/platform-objects/src/identity/sys-session.object.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,12 @@ export const SysSession = ObjectSchema.create({
196196
// backing a session's active organization ends and the user holds no
197197
// other. ⛔ It is a COURTESY, never the enforcement: the wall is the
198198
// per-request membership check in `resolve-authz-context.ts`.
199+
// `admin_password_reset` is the second authorization-event cause: an
200+
// administrator's forced password reset revoked the session
201+
// (`plugin-auth/forced-reset-revocation.ts`, `FORCED_RESET_REVOKE_REASON`).
199202
description:
200203
'Why the session was revoked (idle_timeout, absolute_max, concurrent_cap, user_revoked, '
201-
+ 'admin, organization_membership_ended, …).',
204+
+ 'admin, organization_membership_ended, admin_password_reset, …).',
202205
}),
203206

204207
// ── Active context (multi-org/team) ──────────────────────────
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { describe, it, expect } from 'vitest';
2+
import { SysSession } from '@objectstack/platform-objects/identity';
3+
import { FORCED_RESET_REVOKE_REASON } from './forced-reset-revocation';
4+
5+
// `sys_session.revoke_reason` is free text; its description is the only
6+
// published vocabulary, so a value this producer writes must be named there.
7+
describe('sys_session.revoke_reason vocabulary', () => {
8+
it('names the value a forced reset writes', () => {
9+
expect(FORCED_RESET_REVOKE_REASON).toBe('admin_password_reset');
10+
const description = String((SysSession.fields as any).revoke_reason.description);
11+
expect(description).toContain(FORCED_RESET_REVOKE_REASON);
12+
});
13+
});

0 commit comments

Comments
 (0)