Repository navigation
fix(auth)!: a cloud-managed environment refuses remove-member and update-member-role - #34281
objectstack-fleet[bot] merged 20 commits into
Conversation
…nment Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
…and update-member-role Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
… cloud-managed; docs and changeset Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
…nization data Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
…membership-changes-refused
Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
…d the cloudManaged gate on the membership actions Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
…membership-changes-refused
…d header Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
…ed delete Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
…membership-changes-refused
📓 Docs Drift CheckThis PR changes 3 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 178 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 36a7f3b0efbf401a1fc54efd24b6d7e2c3175dc0 && git checkout 36a7f3b0efbf401a1fc54efd24b6d7e2c3175dc0
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f59a4aa040910debf0f060a329b3a094c190c082 852c9a0e942bfc395181fa9739dd889144632c35 && git checkout -B drift-repro f59a4aa040910debf0f060a329b3a094c190c082 && git merge --no-ff 852c9a0e942bfc395181fa9739dd889144632c35
node scripts/docs-audit/affected-docs.mjs --json f59a4aa040910debf0f060a329b3a094c190c082
|
|
security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (the maintainer routes contract-tier reviews to the review seat, 2026-11-16T03:43Z) · head def9a07 |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head def9a07 · 2026-11-16T03:45Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-16T03:48Z. First review of this head; claim: comment 6906689819; lane request 6906680880 on mailbox #33873. Independence: implemented in a project thread for security#1 (sunhaolin); reviewed by os-tesla, who neither dispatched nor implemented it. ① Derived judgments
② Semver level
CI at this head: 73 check-runs, 23 success, 16 skipped, 33 in progress (Test Core, Test UI, Build Core, Build Docs, type-check and lint lanes), 1 cancelled ( ③ Boundary flags
④ Design judgmentM1 (must-fix) — the declared rule is wider than the doors the change closes, and the declaration says otherwise. The rule as written: on a cloud-managed environment the hosting organisation decides who is a member and at which tier. The change refuses two doors and states, in three places ( S1 (should-fix) — the exception is described by its purpose (restoring a membership the environment lost) while the page's lead sentence says the hosting organisation decides membership and tier. The open door is not bounded by that purpose in code. State on the docs page what the door admits on a managed environment, or bound it; and add to the new describe a pin that the door refuses a caller who is not a platform administrator on a managed environment, so "exactly the platform administrator" is held where the exception is claimed. N1 (nit) — the invitation refusal has a second line behind the hook; the two new refusals have one. A sentence in the hook comment saying so, and why one suffices today, would keep the next in-process caller from walking past it. Held against the published spec on Implemented-by: VERDICT: FAIL |
…letes a membership row refuses on a cloud-managed environment, add-member excepted Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 6ad5572 · 2026-11-16T04:00Z |
|
security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f Note for the delta on |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-16T04:08Z. Delta review of this head against FAIL 6906747948 at def9a07; claim: comment 6906901776; no lane request (owed per check-owed-reviews). Independence: implemented in a project thread for security#1 (sunhaolin); reviewed by os-tesla, who neither dispatched nor implemented it. ① Derived judgments
② Semver level
CI at this head: 65 check-runs, 28 success, 10 skipped, 27 in progress (Test Core 1 to 8, Test UI 1 to 16, Type Check workspace, Type Check UI, Build and E2E UI). Nothing has failed yet and nothing is settled. By reading, M2 predicts a red Test Core lane. ③ Boundary flags
④ Design judgmentM1 (must-fix, continues prior M1) — the declaration no longer matches the change, now in the other direction. The code refuses six doors and hides seven actions; the changeset (title, the M2 (must-fix, new) — the pins for the hide did not follow the four new gates. The lowering matrix in S1 (should-fix, continues prior S1) — the pin half is done. The docs page still describes the open door by its purpose alone; say there what it admits on a managed environment (who may call it and what it may add), as the module header now does, or bound it in code. N1 (nit, new) — Held against the published spec on Implemented-by: VERDICT: FAIL |
…ent; docs and changeset state it Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
…doors and seven actions Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
…served predicate Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head dc93845 · 2026-11-16T05:02Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-16T05:08Z. Delta review of this head against FAIL 6907027054 at 6ad5572; claim: comment 6907809052; no lane request (owed per check-owed-reviews). Independence: implemented in a project thread for security#1 (sunhaolin); reviewed by os-tesla, who neither dispatched nor implemented it. ① Derived judgments
② Semver level
CI at this head: 72 check-runs, 60 success, 12 skipped, none failed, none in progress. The skipped set includes the Dogfood Regression Gate, which the merge queue runs. ③ Boundary flags
④ Design judgmentNo must-fix. S1 (should-fix, the remainder of prior M1) — the PR body's N1 (nit, continues prior S1) — on the docs page, "anyone else is refused Held against the published spec on Implemented-by: VERDICT: PASS |
… session answers 401 Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
…membership-changes-refused Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
…rganization, the action gated by multi-org alone Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
…word Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head 852c9a0 · 2026-11-16T09:25Z |
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract reviewServed-tier: Read at 2026-11-16T09:40Z. Full review of this head, not a delta; claim: comment 6912510522. Earlier records on other heads: FAIL 6906747948, FAIL 6907027054, PASS 6907898459. Judged from the net diff against the merge base with ① Derived judgments
② Semver level
CI at this head when read: 65 check-runs, 31 success, 10 skipped, 24 in progress (Test Core, Test UI, Type Check workspace and UI), none failed. Not settled; the skipped set includes the Dogfood Regression Gate, which the merge queue runs. ③ Boundary flags
④ Design judgmentM1: closed. S1 (should-fix) — as graded in 6907898459: the PR body's N2 (nit) — the comment above the seven new entries in N3 (nit) — the file header of N4 (nit) — the hide is real for the seven booked row actions. The console's own organization pages under Held against the published spec on Implemented-by: VERDICT: PASS |
|
security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f 席位核对ACCEPT at
Implemented-by: os-dev (security#1 order, |
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill under
skills/**teaches the organization membership doors or the cloud-managed mode;content/docs/permissions/authentication.mdxgains the rule in this change.维护者速读
OS_CLOUD_MANAGED=1)上,成员资格与成员等级由托管该环境的组织管理:组织族中凡写入或删除成员行的六扇门一律答409 RESOURCE_CONFLICT且不写任何东西(与邀请成员同一信封):移除成员、修改成员等级(含「设为所有者」)、离开组织、接受邀请、创建组织(创建者成为所有者)、删除组织(结束其全部成员资格);对应的七个操作在云托管时隐藏。唯一例外:add-member只接纳平台管理员、只做「添加一条成员资格」,用于恢复环境丢失的成员资格。packages/plugins/plugin-auth/src/auth-manager-before-hook.ts(CLOUD_MANAGED_MEMBERSHIP_DOORS六条与拒绝分支的位置:在 remove-member 权限分支、组织删除记录分支与改等级授权快照之前);②packages/plugins/plugin-auth/src/cloud-managed.ts(族普查与六句拒绝文案);③packages/platform-objects/src/identity/(七个visible)。pnpm --filter @objectstack/plugin-auth exec vitest run src/cloud-managed.test.ts,预期全部通过:云托管下六扇门各答 409 且成员行不变,自托管下各照常 200 并改动成员行,非平台管理员调用add-member得 403。What changes
The rule: on a cloud-managed environment, membership and membership tiers are managed by the organisation that hosts it. It extends the invite-member rule already in place. Every organization-family door that writes or deletes an organization membership row refuses;
add-memberalone stays open.invite-memberalready gives (409 RESOURCE_CONFLICT) and writes nothing.CLOUD_MANAGED_MEMBERSHIP_DOORSinauth-manager-before-hook.tslists them, and the refusal comes ahead of the remove-member permission arm, the organization-delete records arm and the role-change grant read, so none of them runs on a refused request. Six sentences joinCLOUD_MANAGED_REFUSAL_MESSAGES:removeMember,updateMemberRole,leaveOrganization,acceptInvitation,createOrganization,deleteOrganization. This hook is the only line of refusal: no in-process caller reaches these vendor operations. The hook comment says so, and says that a future in-process caller needs its own refusal.features.cloudManaged != truenow sits invisibleonsys_member.update_member_role,remove_memberandtransfer_ownership;sys_organization.leave_organization,create_organizationanddelete_organization; andsys_invitation.accept_invitation. The invite actions are already hidden the same way.PUBLIC_AUTH_FEATURES.cloudManaged.gatedInputsbooks the seven paths. The registry note now namesaccept_invitationas the one gated input that has no second feature gate. This is a list entry, not a schema change, soMetadata-protocol: none.POST /organization/add-memberadmits exactly a platform administrator, adding a membership. On a managed environment it restores a membership the environment lost; any other caller is refused403 PERMISSION_DENIED(pinned).content/docs/permissions/authentication.mdxstates the rule in its cloud-managed section: the six doors, the seven hidden actions, what add-member admits, and that the rest of the family is unchanged. The six routes sit in a marked wire fence.membership-required-every-posture.dogfood.test.tsgains a leg under each tenancy posture. A person whose membership row was deleted under the system context (no door) signs in to no active organization, adopts no membership, and cannot read or write any of the organization's data, their own note included.The organization family on a cloud-managed environment
Every
family: 'organization'route inauth-route-ledger.ts(26 routes):POST /organization/remove-memberPOST /organization/update-member-rolePOST /organization/leavePOST /organization/accept-invitationPOST /organization/createPOST /organization/deletePOST /organization/add-memberPOST /organization/invite-memberPOST /organization/cancel-invitationPOST /organization/reject-invitationPOST /organization/add-team-memberPOST /organization/remove-team-memberPOST /organization/create-teamPOST /organization/update-teamPOST /organization/remove-teamPOST /organization/set-activePOST /organization/updateGET /organization/get-active-memberGET /organization/get-full-organizationGET /organization/listGET /organization/list-membersGET /organization/list-invitationsGET /organization/list-user-invitationsGET /organization/list-teamsGET /organization/list-team-membersGET /organization/invitation-previewTests
plugin-auth/src/cloud-managed.test.tsgains one top-leveldescribe. It runs on the realAuthManagerbehind the real route mount; create and delete run on a walled posture, sincesinglerefuses a second organization.code,statusand the door's own sentence), and the membership rows are unchanged. For create, no organization is written either; for delete, the organization stays.200and changes the rows (the spied arms run there).403 PERMISSION_DENIEDthere with nothing written.200when managed.platform-objects:accept_invitationrow.identity/cloud-managed-visibility.test.tsevaluates the seven predicates through the canonical CEL engine. Each is hidden when managed, offered as before when not, and still hidden when its other gate is closed (organization ormultiOrgEnabled; the pending row for accept). add-member stays offered when managed, and reject-invitation too.Acceptance notes
skills/**teaches these doors, so no skill moves.Verification
Readings at head
852c9a0e942bfc395181fa9739dd889144632c35, under the verify lock.Rule suites, ablations, gates and the dogfood battery
pnpm --filter @objectstack/plugin-auth exec vitest run src/cloud-managed.test.ts: Tests 59 passed (59).feature-gate-guard,identity/action-predicate-sparse-face,identity/cloud-managed-visibility,platform-objects): Test Files 4 passed (4), Tests 353 passed (353).membership-required-every-posture.dogfood.test.ts: Tests 21 passed (21).org-change-slug-bound-action.dogfood.test.ts: Tests 5 passed (5).@objectstack/plugin-auth,@objectstack/platform-objectsand@objectstack/speceach exit 0.scripts/ablation-replace.mjs, WRAP on the membership-door arm of the before-hook):src/cloud-managed.test.tsTests 10 failed | 49 passed (59), the reds being the refusal pins of the six doors and the refuse-ahead-of-the-arms pins. Restored: blob equal to HEAD,git diff HEADempty.org-change-slug-bound-action.dogfood.test.ts1 failed | 4 passed. Restored the same way.dispatch-gates --commands∪--ran: 116 derived, 116 run, 0 NOT-MEASURED, 0 UNRUN; the three prerequisite gates were run after building their prerequisites (check:skill-examples347 examples,check:dual-build-cjs-loads123 entry points across 72 packages,check:type-check-debtOK).pnpm --filter @objectstack/dogfood test, no shard, no path): Test Files 473 passed | 3 skipped (476), Tests 4006 passed | 42 skipped (4048), no failures.Round 3 changes from
dc93845f: the dogfood cross-check of the multi-org gate now compares againstset_active_organization, the onesys_organizationaction whose only gate ismultiOrgEnabled(leave_organizationnow also carries the cloud-managed hide); the docs say who names the tier of a membership added through add-member and that a caller with no session is answered as unauthenticated;origin/mainmerged without conflict.Generated by Claude Code