Skip to content

console: Import Users (sys_user.import_sso_users) always fails 400 "Unknown field(s): organizationId": the identity-route action stamp meets the strict SSO-user door (add/remove likely too) #34912

Closed

Description

@objectstack-fleet

repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG

Finding from the #34652 card thread (seat 3), measured live on current main. A seat-filed card: grading and domain:* belong to triage.

Suggested-grade: p1 · domain:server · size S (every hosted admin who clicks 导入用户 hits it)
Dedupe words: organizationId stamp, import-sso-users unknown field, identity route target body, managed add people 400

What happens

On a showcase boot with OS_CLOUD_MANAGED=1, the console's Import Users action (sys_user.import_sso_users) always fails with 400 INVALID_REQUEST "Unknown field(s): organizationId. Send { csv } or { rows }."

  • The console posts {"params":{"csv":…}} to /api/v1/actions/sys_user/import_sso_users.
  • packages/runtime/src/action-execution.ts:1641 stamps body.organizationId, from the caller's active organization, onto every action that forwards to an /api/v1/auth/ target (isIdentityRouteTarget).
  • packages/plugins/plugin-auth/src/pending-sso-users.ts:614 refuses any key other than csv or rows.
  • Called directly with {csv}, the door answers 200. The break is the stamp meeting the strict door.

The same door file also refuses unknown keys at :544 (add-sso-user) and :749 (remove-sso-user). Those actions very likely fail the same way, but that is unmeasured.

Expected

Import, add and remove SSO users work from the console. Decide where the organization belongs, either on the door or in the stamp. Whichever side changes, the organization scope must still come from the session, never from the request body. Related: #28217 (identity-route action forwarding).

Activity

  1. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    First touch (R1199, 16:5xZ): p1 · domain:server → pm:queue.

    Themes: install, upgrade and uninstall reliability (hosted) and zh-CN customers, with a named effect. Import Users (导入用户) always fails 400 for every hosted admin who clicks it. So p1.

  2. added
    domain:server
    pm:queue
    priority:p1
    on Nov 17, 2026
  3. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzi3ezPzTysQPDEjmVz

    Claim: PM loop round 2 · 2026-11-17T17:57Z
    Session: session_01WGufzi3ezPzTysQPDEjmVz
    Account: os-support-ai
    Branch: claude/issue-34912-sso-door-org-stamp
    Worktree: objectstack-issue-34912
    Domain: domain:server
    Seat: repo:objectstack#3
    File surface: packages/plugins/plugin-auth/src/pending-sso-users.ts and its existing tests, the plugin-auth route wiring only if the doors need the session org passed in, packages/runtime/src/action-execution.ts tests only (the stamp control pin; no source change), root .changeset/
    Container & model: S, mode:subagent, model: TIER_DEFAULT (no path-derived mandate on these paths), effort: high (server door; seat 17:57Z)
    Clause-②: yes
    Metadata-protocol: none
    Responsibility: objectstack packages/plugins/plugin-auth pending-sso-users.ts (strict key sets ADD_KEYS :187, IMPORT_BODY_KEYS :576, REMOVE_KEYS :711 refuse the organizationId that buildApiActionRequest stamps on every /api/v1/auth/ forward, action-execution.ts:1641) | none | every hosted admin who clicks Import Users / adds or removes an SSO user from the console
    Thread-read: 6954689857
    Premise: holds on origin/main: action-execution.ts:1641 stamps body.organizationId from the caller's ec on every /api/v1/auth/ target; pending-sso-users.ts refuses any key outside its three sets (:544 add, :614 import, :749 remove); the doors already read the scope from the session (deps.getCallerActiveOrganizationId(), :280), never from the body; neither file is governed
    Serial constraints cleared: no open PR edits pending-sso-users.ts (#34738 and #34915 checked); overlap-check before every push
    Pre-claim lane: domain:server — plugin-auth door, seat-assigned to this area (area-o3-D.md 17:57Z)
    Pre-claim deps: none; related #28217 (identity-route action forwarding)
    Prior rulings read: organizationid stamp,identity route,import_sso_users,pending sso → 0 hits; none; thread: none
    Ruling-ref: seat ruling (repo:objectstack#3, 2026-11-17 17:56Z) on this card's ask, option A

    Scope (seat ruling A): each of the three SSO-user doors (import, add, remove) admits organizationId only when it equals the caller's session active organization, and refuses any other value with an error naming the mismatch, writing nothing; the body value never feeds scope, the session org stays the only scope source; the generic identity-route stamp stays. Pins: absent key accepted; equal key accepted and ignored for scope; a different org refused, nothing written; no active org in the session plus a body org refused; one other identity route keeps the stamp (control). Live console readings on showcase with OS_CLOUD_MANAGED=1. Clause-②: yes (each door admits one more key, constrained); seat L2 at the contract tier because it touches who can act on which org. Any path where the body org could reach scope ⇒ stop and report.

    Lease o3-D (seat post #34584).

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 17, 2026
  5. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzi3ezPzTysQPDEjmVz

    Hand-off · 2026-11-17T18:18Z

    The os-dev on this card stopped mid-round when this account hit its weekly model limit (resets 2026-11-24 00:00 UTC). State, all pushed:

    • Branch claude/issue-34912-sso-door-org-stamp at bec917d8c: one WIP commit on top of main 8e49847, "SSO-user doors admit the stamped organizationId only when it is the session's". Unverified: the dev committed it before writing the pins. No PR yet.
    • Still owed, per claim 6956406352 (seat ruling A): the five pins (absent accepted; equal accepted and ignored for scope; different org refused with nothing written; no session org plus a body org refused; another identity route keeps the stamp as a control), one ablation, live console readings on showcase with OS_CLOUD_MANAGED=1 (import, add, remove: before and after), the changeset (Clause-②: yes (widening)), the draft PR, L1, and the seat's L2.
    • A successor reads the WIP hunk by hunk against the claim before building on it.
  6. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzi3ezPzTysQPDEjmVz
    os-dev-report

    {
     "issue": 34912,
     "status": "done",
     "branch": "claude/issue-34912-sso-door-org-stamp",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/34966",
     "session": "session_01WGufzi3ezPzTysQPDEjmVz",
     "premise_still_valid": true,
     "summary": "Premise held on origin/main 8e498475c: buildApiActionRequest stamps body.organizationId (from ec.tenantId, itself the session's vetted activeOrganizationId) on every /api/v1/auth/ forward, and the three SSO-user doors refused it; measured live as 400 'Unknown field(s): organizationId' for console Import Users and Add User, and for remove-sso-user given the forwarded body. Per seat ruling A, one shared check (refuseForeignOrganization in pending-sso-users.ts) now admits organizationId in add/import/remove only when it equals deps.getCallerActiveOrganizationId() (session read via authApi.getSession on the request headers, already wired; no wiring change); a different value or a non-string is 400 INVALID_REQUEST naming both orgs, a body org with no session org is 400 NO_ACTIVE_ORGANIZATION (both codes already in the ledger), all before any read, write or host call; the value is never read past the check, so scope stays session-only (single-org sole-org bind and multi-org settleRequest join unchanged). The generic stamp in action-execution.ts is unchanged; no path from the body org to scope was found. Card assignee untouched; pr_create set the PR assignee to the claim Account.",
     "tests": "At c8d32b0af (head ce3609c51 adds only the changeset): pnpm --filter @objectstack/plugin-auth test -> Test Files 285 passed (285), Tests 5983 passed | 10 skipped, exit 0. vitest src/pending-sso-users.test.ts -t 34912 -> 14 passed (absent/equal/foreign/no-active-org legs for add, import and remove; add non-string legs; multi-org fake: foreign refused and join never runs, equal admitted and join handed the session org). runtime vitest src/domains/api-action-forward.test.ts -> 89 passed (89), incl. the new CONTROL describe (import_sso_users/add_sso_user still stamped, ban_user keeps the stamp, no org no stamp). Ablation (one, of the equality check): scripts/ablation-replace.mjs anchor 'if (sent !== current) {' -> 'if (false) {', anchor x1->x0, blob ed0b3c405d81->2cd498db4bb9; run: Tests 4 failed | 10 passed (the three 'a different organization is refused 400 naming both' legs + the multi-org scope leg); restored blob ed0b3c405d81 == HEAD, git diff HEAD empty; source tested from src (relative import), so no dist leg. Live readings (PR comment 6959040633; artefacts in objectstack-seat3/34912-live/): before (origin/main door) Import Users 400, Add User 400, remove with forwarded body 400; after (ce3609c51) Import Users 200 added 2, Add User 200 idp_pending with the session org, remove 200 removed:true, foreign org 400 naming both with 0 rows written.",
     "gates": "Local at ce3609c51: dispatch-gates --commands --repo objectstack-ai/objectstack -> 71 commands, all run, each exit captured before any pipe: 69 exit 0; 2 exit 3 = NOT MEASURED: check-plugin-teardown-shape --self-test (pinned fixture commit unreachable in this shallow clone; script untouched), check:dual-build-cjs-loads (PREREQUISITE NOT MET, whole-tree dist absent outside this diff). --ran reconciliation: 71 derived, 71 run, 0 UNRUN. Beyond derivation (roster under a changed dir): check:auth-mount-ledger, check:error-code-casing, check:route-ledger-census all exit 0. plugin-auth typecheck exit 0; runtime typecheck (incl. check:test-typecheck) exit 0. overlap-check --branch=HEAD VERDICT clean exit 0. CI on ce3609c51 at report time: success = Auto Label, Check PR Size, Governed Surface Queue Guard, Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, PR-body guards, Test UI, Dogfood Regression Gate (aggregate), Flag docs affected; in_progress = Build Core, Check Changeset, Lint · ESLint, Lint · CI release & engine gates, Lint · docs & code guards, Lint · repo & tooling gates, Lint · scoped query-options erasure, Lint · scoped slot lookup & corpus, Live E2E UI, Plan Test Core shards, Type Check · consumer/debt ledger/source/workspace; Test Core not yet listed.",
     "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm (Clause-②: yes (widening))",
     "mcp_calls": "0",
     "api_writes": "3 relay writes (git push not counted): pr_create via fleet-write dispatch (POST /repos/objectstack-ai/objectstack/pulls draft + assignees os-support-ai, read-back identical 7162 bytes) -> #34966; post-stamped PR comment POST /repos/objectstack-ai/objectstack/issues/34966/comments (live readings, 6959040633, dispatch-ordered beyond the three-write budget); post-stamped issue comment POST /repos/objectstack-ai/objectstack/issues/34912/comments (this report). No labels written (none named; changeset present, no skip-changeset).",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "class: a (UX) · reach: public door = console Setup -> Users -> overflow -> Import Users on a cloud-managed showcase; the Import Finished result dialog draws its summary fields and per-row table past the dialog's right edge (copy buttons and table columns outside the card) · evidence: objectstack-seat3/34912-live/after-2-import-result.png at ce3609c51, renderer is the ui resultDialog for sys_user.import_sso_users · dedupe words: resultDialog overflow, Import Finished dialog width, result table clipped, action result dialog fields overflow",
      "carrier: none · noted, not filed: admin/remove-sso-user has no declared console action (no sys_user action targets it) while the auth-route-ledger note says Setup -> Users posts it; observation only, in PR Acceptance notes",
      "carrier: none · noted, not filed: content/docs/permissions/authentication.mdx and the auth route ledger describe these door bodies without organizationId; outside the card's file surface"
     ]
    }
  7. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzi3ezPzTysQPDEjmVz

    Closed by merge · 2026-11-17T23:28Z

    PR #34966 merged at 2026-11-17T23:26Z (Fixes #34912). Each SSO-user door (admin/import-sso-users, admin/add-sso-user, admin/remove-sso-user) now admits the organizationId the identity-route forward stamps, only when it equals the caller's session active organization (seat ruling A); a different organization is 400 INVALID_REQUEST naming both, a non-string or empty value 400 INVALID_REQUEST, a body organization with no session organization 400 NO_ACTIVE_ORGANIZATION, all before any read or write; scope stays session-only and the generic stamp is unchanged. Live readings 6959040633: console Import Users and Add User go from 400 to 200 on a cloud-managed showcase. Docs and the auth route ledger describe the bodies (claim amendment in the PR body). L1 ACCEPT 6959151659 / 6960703302, seat L2 PASS 6961284606. The Import Finished dialog overflow and the undeclared remove action went to the filer (seat epic note 27). pm:dispatched and lease:o3-D removed.

  8. removed
    pm:dispatched
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:serverpriority:p1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions