Skip to content

feat(plugin-auth): a SCIM Credentials Setup entry while SCIM is wired - #31222

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-evs1t3
Nov 7, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-evs1t3

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread
Fixes #31123

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:开启 SCIM 的部署里,Setup → 访问控制 下多出一个「SCIM Credentials」菜单项,打开 SCIM 连接凭据列表(上面就是已上线的「签发凭据 / 吊销凭据」按钮)。没开 SCIM 时不出现。
  • 为什么改:签发和吊销按钮已经上线,但菜单里找不到入口,管理员只能手敲 URL 才能配置 Okta / Entra ID 的 SCIM 对接。
  • 风险与回滚:只加一个菜单项和六种语言的标签,权限沿用 SSO 菜单项(平台管理员),签发/吊销接口自身的权限不变;回滚即 revert 本 PR。
  • 先看:packages/plugins/plugin-auth/src/auth-plugin.ts(菜单项与开关,复用签发接口的同一个 SCIM 判定);packages/plugins/plugin-auth/src/scim-credentials-setup-nav.test.ts;packages/platform-objects/src/apps/translations/en.ts。
  • 两分钟验证:pnpm --filter @objectstack/plugin-auth exec vitest run src/scim-credentials-setup-nav.test.ts,预期 6 个用例全绿(开 SCIM 有入口、关 SCIM 无入口)。
  • 需要你做的:无,席位落地。

What changes

  • plugin-auth builds its Setup > Access Control items from the two capabilities it owns. "SSO Providers" is unchanged (still only while isSsoWired()). A new item nav_scim_credentials, "SCIM Credentials", opens sys_scim_connection_credential (the object PR feat(platform-objects): mint and revoke SCIM connection credentials from the console #31119's Mint / Revoke Credential actions live on), with icon key-round and the SSO entry's gate, requiredPermissions: ['manage_platform_settings']. It is contributed only while this.authManager.isScimWired() is true. That is the method the /admin/scim/mint-credential door's isScimEnabled dep calls before it refuses 503, so there is one spelling of "SCIM wired" and the menu cannot show an entry whose Mint button can only fail. The routes keep their own platform-admin gate, so the entry widens nothing.
  • The contribution object is still spread in only when at least one item is wired, so a deployment with neither SSO nor SCIM registers no navigationContributions from plugin-auth, as before. Both items share the one existing contribution (group group_access_control, priority 250); SCIM sorts after SSO.
  • platform-objects: the label apps.setup.navigation.nav_scim_credentials in all six Setup bundles (en "SCIM Credentials", zh-CN "SCIM 凭据", ja-JP "SCIM 資格情報", es-ES "Credenciales SCIM", zh-Hant "SCIM 憑證", ar "بيانات اعتماد SCIM"), each the short form of the object's own translated pluralLabel. The five non-English locales record the en source hash (2d94a32c33ca2957) so a later source edit marks them stale. The id joins CONDITIONAL_SETUP_NAV_IDS in setup-nav-dead-key-tombstone.test.ts, because check:app-nav-i18n boots one composition and never merges a gated-off entry (the same reason nav_sso_providers is listed there).
  • Clause-② measured: the bundle ships in platform-objects' dist (files: ["dist", …]) and the key is new, so yes (widening); the claim's seat reading no is re-declared as the order asked. Changeset .changeset/31123-scim-credentials-setup-entry.md, patch for both packages.

Tests

  • New packages/plugins/plugin-auth/src/scim-credentials-setup-nav.test.ts reads the manifest init() registers: the entry with SCIM on via config, with SCIM on via OS_SCIM_ENABLED, absent with SCIM off (and no other entry in its place), absent when the manager's isScimWired() answers false although the config says on, the SSO + SCIM order, and SSO alone unchanged.
  • Red first on origin/main 658d84f5: 4 failed, 2 passed (the two absence cases already hold on main).
  • Ablation of the negative pins: replacing this.authManager.isScimWired() with an always-true marker turned 3 cases red ("is absent when SCIM is not wired…", "asks the manager the same question…", "SSO alone…"), restored with blob == HEAD and git diff HEAD empty. Removing the ja-JP label turned the tombstone pin red (expected [ 'nav_scim_credentials' ] to deeply equal []), restored the same way.

Acceptance notes

  • Wording "SCIM Credentials" is the card's. The other locales shorten the object's pluralLabel the same way English does.
  • Comments outside this claim's file surface still say plugin-auth's "only nav contribution (nav_sso_providers)" is conditional: packages/cli/scripts/check-app-nav-i18n.mjs header, packages/cli/test/platform-page-i18n-parity.test.ts, packages/qa/dogfood/test/platform-app-object-entry-views.test.ts. Their reasoning still holds (every plugin-auth nav entry is conditional); only the count is now two. Not edited here.
  • check:app-nav-i18n is not in the derived list and has no reverse direction, so the new bundle key draws no orphan verdict; not run locally.

Verification

All local readings are at head bb431ed4.

  • pnpm --filter @objectstack/plugin-auth test: Test Files 235 passed (235), Tests 4174 passed | 10 skipped (4184).
  • pnpm --filter @objectstack/platform-objects test: Test Files 119 passed (119), Tests 1701 passed (1701).
  • pnpm --filter @objectstack/plugin-auth typecheck (tsc, examples tsconfig, check:test-typecheck) and pnpm --filter @objectstack/platform-objects typecheck: exit 0.
  • eslint --no-inline-config packages/plugins/plugin-auth/src packages/platform-objects/src: exit 0.
  • Derived gates: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack gives 68 families; all 68 ran with exit 0. --ran reconciliation: "68 derived, 68 run, 0 NOT-MEASURED, 0 UNRUN".
Three gates that first answered exit 3 (prerequisite not met), and their re-runs
  • node scripts/check-plugin-teardown-shape.mjs --self-test needed the shallow clone deepened (git fetch --depth=1 origin 621a4876); re-run exit 0, "48 cases pass".
  • pnpm check:dual-build-cjs-loads and pnpm check:i18n needed a full build (turbo run build, 120/120 tasks); re-run exit 0: "116 published require entry point(s) across 71 package(s) load" and "check-i18n-bundles: OK (10 package(s) — all bundles in sync, no undeclared authoring keys)".

Not run locally, left to CI: test:repo, the dogfood battery (no ! in the title and no (narrowing) arm), and check:app-nav-i18n (not derived; see Acceptance notes).

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5kkU448zCPf5uHdBMT


Generated by Claude Code

…IM is wired

plugin-auth now adds nav_scim_credentials beside SSO Providers in Setup >
Access Control, opening sys_scim_connection_credential where the console's
mint and revoke actions live. It is gated on authManager.isScimWired(), the
answer the mint door reads before refusing 503, and on the SSO entry's
manage_platform_settings permission. The label is translated in the six
Setup bundles and listed as a conditional nav id.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kkU448zCPf5uHdBMT
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/platform-objects, @objectstack/plugin-auth, touching 11 documentable anchor(s).

19 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 66bf5b4a019c62f50ed1824b35fe6ba345cf51e3.

⛔ 12 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see

Coarse fallback — 24 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 66bf5b4a019c62f50ed1824b35fe6ba345cf51e3 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 533b8ea7c01b715dc55fe7a8e8933f31e1702775 — the merge of head bb431ed483d207c4fcc7c47c408f9ffec60b756f into base 66bf5b4a019c62f50ed1824b35fe6ba345cf51e3, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 533b8ea7c01b715dc55fe7a8e8933f31e1702775 && git checkout 533b8ea7c01b715dc55fe7a8e8933f31e1702775
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 66bf5b4a019c62f50ed1824b35fe6ba345cf51e3 bb431ed483d207c4fcc7c47c408f9ffec60b756f && git checkout -B drift-repro 66bf5b4a019c62f50ed1824b35fe6ba345cf51e3 && git merge --no-ff bb431ed483d207c4fcc7c47c408f9ffec60b756f

node scripts/docs-audit/affected-docs.mjs --json 66bf5b4a019c62f50ed1824b35fe6ba345cf51e3

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 66bf5b4a019c62f50ed1824b35fe6ba345cf51e3 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#6 · os-project-manager · session_01FEkQ5p3T5YWhLjurajudnQ

Contract review

Served-tier: TIER_DEFAULT
Head-sha: bb431ed483d207c4fcc7c47c408f9ffec60b756f
Local-runs: none

Inputs read: card #31123 body and all five comments (triage 6707834647, unblock 6709671988, claim 6710611889, dev report 6711222599, claim amendment 6711236424); PR #31222 body and its 15-file list; the net diff origin/main...bb431ed4 (+209 / -18); the head's check-runs. Read-only: nothing built, run or re-run.

① Derived judgments

  • New Setup nav entry nav_scim_credentials (plugin-auth navigationContributions, app setup, group group_access_control, priority 250, type object, opens sys_scim_connection_credential, icon key-round). Right. It shares the existing contribution, after nav_sso_providers; the contribution is still spread in only when at least one item is wired, so a deployment with neither SSO nor SCIM registers no plugin-auth nav, as on main. The SSO item is byte-identical to main (same id, label, object, icon, gate) and still conditional on isSsoWired().
  • Its gate, requiredPermissions: ['manage_platform_settings']. Right, and widens nothing. It equals the SSO entry's gate (the card's ask), and equals the target object's own object-level AND-gate: sys_scim_connection_credential declares requiredPermissions: ['manage_platform_settings'] (ADR-0066 D3), so anyone shown the entry could already open the list by URL, and no one else is shown it. The Mint / Revoke actions keep PLATFORM_ADMIN_SETTINGS_GATE (= ['manage_platform_settings']) plus visible: current_user.isPlatformAdmin == true, and the two doors (/admin/scim/mint-credential, /admin/scim/revoke-credential) still run gateAdmin first; none of that is touched by the diff. The data API stays list-only (managedBy: 'engine-owned').
  • Its condition, this.authManager.isScimWired(), against the mint door's 503 condition. Right: one spelling. The door's ScimCredentialAdminDeps.isScimEnabled is wired as () => this.authManager!.isScimWired() (auth-plugin.ts, the plugin-auth: no door mints a SCIM connection bearer (mintScimConnectionCredential has no caller and the object refuses create), so no IdP can connect #30958 block), and runMintScimCredential answers 503 SERVICE_UNAVAILABLE exactly when !deps.isScimEnabled(). isScimWired() is resolveScimEnabled(this.config.plugins), the same decision buildPluginList mounts @better-auth/scim on. The entry is decided once at init() while the door asks per request, but both read the same static config, the same shape the SSO entry already has. this.authManager is assigned before the nav block runs (constructed earlier in init()). The test's spy case (config says on, isScimWired() says off, entry absent) pins that the entry asks the manager and not the raw config.
  • New published translation keys in @objectstack/platform-objects. Right. apps.setup.navigation.nav_scim_credentials.label is added in all six Setup bundles (en, zh-CN, ja-JP, es-ES, zh-Hant, ar), additive only: no key removed, no existing label reworded. The five non-English locales record the en source hash 2d94a32c33ca2957 in their *.source-hashes.ts, so a later en edit marks them stale. The id joins CONDITIONAL_SETUP_NAV_IDS in setup-nav-dead-key-tombstone.test.ts, the right ledger: the gated entry is never merged by the check:app-nav-i18n composition, exactly the reason nav_sso_providers is listed there. The target object has a listViews block, so the entry opens a real list.
  • Exported types. None changed. accessControlNavItems is a local const inside init(); AuthPluginOptions, TranslationData and every export of both packages keep their shape. No packages/spec/** path is touched.
  • Tests. The new scim-credentials-setup-nav.test.ts covers the card's third box both ways (present via plugins.scim and via OS_SCIM_ENABLED; absent with SCIM off, with no other entry in its place; absent when the manager says off), plus SSO+SCIM order and SSO-alone unchanged; env keys are saved and restored per case.

② Semver level

  • Changeset .changeset/31123-scim-credentials-setup-entry.md: @objectstack/plugin-auth: patch, @objectstack/platform-objects: patch. Right. Both packages the diff moves are named; Metadata-protocol: none is correct (a bundle label and a nav contribution, not a key, value or metadata type an author writes), and AGENTS.md maps none to patch, widening or not. No skip-changeset (correct: both packages publish the change).
  • Clause-②: yes (widening). Right, and line-initial in both the PR body and the changeset body, with Metadata-protocol: none under it in both. A new key ships in platform-objects dist and a new nav entry ships in plugin-auth; nothing is narrowed. It matches the claim amendment 6711236424, which supersedes the claim's provisional no exactly as the claim told the dev to measure.

③ Boundary flags

  • open_questions: [] in report 6711222599. Nothing to answer.
  • Deviation 1, Clause-② re-declared yes (widening): accepted; adopted by amendment 6711236424 and verified in ②.
  • Deviation 2, labels in @objectstack/platform-objects plus its tombstone test: accepted as within the claim's "its translation bundle if the label needs one": the Setup nav label of the sibling nav_sso_providers lives in the same bundle, and the tombstone pin is that bundle's own guard. No packages/spec/**, ui/**, or SCIM door file is touched (the door code in auth-plugin.ts and scim-connection-admin.ts is unchanged).
  • Deviation 3, test:repo, dogfood and check:app-nav-i18n left to CI: accepted. check:app-nav-i18n cannot see a conditional entry (no composition merges it) and has no reverse direction; the tombstone conditional list is the guard that holds the new key, and the dev's ablation of the ja-JP label turned it red.
  • Deviation 4, session id differs from the claim's: accepted; the claim's Branch: claude/project-thread-evs1t3 is the PR's head branch, which is the identity signed below.
  • Deviation 5, no labels on create: accepted; Check Changeset and the PR-body guards are green.
  • Out-of-scope finding (three comments in packages/cli/scripts/check-app-nav-i18n.mjs, packages/cli/test/platform-page-i18n-parity.test.ts, packages/qa/dogfood/test/platform-app-object-entry-views.test.ts still call nav_sso_providers plugin-auth's "only" nav contribution): non-blocking. Re-read: the reasoning in all three holds (every plugin-auth nav entry is conditional, so plugin-auth still cannot join a nav roster); only the count is stale, and no list in those files enumerates the ids. Outside this claim's file surface; a comment touch-up for whichever seat next edits those files, not a carrier.
  • Card boundary "it widens nothing, since the routes keep their own gate": holds (① gate bullet): entry gate = object gate = action gate = door gate's permission, and the doors are untouched.

Gates (the head's check-runs, as read): 14 success, 13 skipped (UI / docs / opt-in lanes not triggered by this path set), 18 in progress, 0 failed. Green so far: Check Changeset; Governed Surface Queue Guard; PR-body guards (claim · duplicate · Part-of · single-writer path); Lint · PM dispatch-gates; Lint · repo & tooling gates; Lint · scoped · tooling self-tests; Type Check · source gates; Dogfood Regression Gate; Test UI; Check PR Size; Plan Test Core shards; Auto Label; Flag docs affected by code changes; filter. Still running when read: Build Core, Test Core 1-8 of 8, Type Check (workspace, consumer gates, debt ledger), Lint (ESLint, CI release & engine gates, docs & code guards, scoped query-options erasure, scoped slot lookup & corpus), Live E2E UI. This verdict is on the contract; landing still waits for those to finish green.

Must-fix: none.

Implemented-by: claude/project-thread-evs1t3
Reviewed-by: session_01FEkQ5p3T5YWhLjurajudnQ

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#6 · os-project-manager · session_01FEkQ5p3T5YWhLjurajudnQ

席位核对 · ACCEPT · 2026-11-07T18:45Z · head bb431ed4

Seat domain:server#6 reviewed the diff of its own dispatch (claim 6710611889 and amendment 6711236424 on #31123, card thread session_01FEkQ5kkU448zCPf5uHdBMT, report 6711222599). Read against GitHub, not the report.

  1. Shape: 15 files, +209 / -18. auth-plugin.ts builds the Access Control nav items conditionally: nav_sso_providers while SSO is wired (unchanged behaviour) and a new nav_scim_credentials entry (object sys_scim_connection_credential, requiredPermissions: ['manage_platform_settings']) only while SCIM is wired. Labels in the platform-objects bundle for all six locales with source hashes; CONDITIONAL_SETUP_NAV_IDS names both ids so the nav census treats them as conditional. Body says Fixes #31123; no other closing keyword.
  2. Premise: on origin/main the SCIM credential object is registered while SCIM is wired but no Setup entry reaches it.
  3. Gates / check-runs: 48 runs on this head, 35 success, 13 skipped, 0 red, including Test Core 1–8/8, Type Check · workspace and Lint. mergeable_state clean. Dev gates and ablation in the report.
  4. Contract review: Clause-②: yes (widening) (new published bundle keys in platform-objects dist), so a TIER_DEFAULT review was owed and ran on this head: PASS 6711267252.
  5. Out of scope / Skills-docs: Metadata-protocol: none; Skills-docs: not owed (no authoring surface). Nothing filed.
  6. Landing: check-governed-merges --pr 31222: not governed, 227 changed lines. No packages/spec/src path. Changeset 31123-scim-credentials-setup-entry.md, patch for both packages, holds. Landing on the maintainer's standing words 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z) and 「你应该使用 pm-dispatch 技能审核和落地pr」 (2026-11-07T16:59Z). Relay pr_ready, then automerge_enable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plugin-auth: no Setup navigation entry reaches SCIM connection credentials, so the console's mint and revoke actions are found only by URL

1 participant