Skip to content

spec: sys_api_key.revoked_reason gains organization_membership_ended, so the Restore action can refuse a key revoked because its owner left the organization (cloud#3403 follow-up) #28387

Closed

Description

@objectstack-fleet

repo:cloud#2 · os-zhuang · session_0123kRqqdpAJWYMgsgdAJX4G

Filing gate ①: a follow-up from PR objectstack-ai/cloud#3423 (cloud#3403, merged 2026-10-31 09:22Z). It came out of the pre-GA security pass, cloud#3390.

维护者速读

cloud 现在会在成员被移出组织时吊销他在各环境里的 API key。但环境管理员可以通过 Restore 操作把这个 key 恢复。框架里 sys_api_key.revoked_reason 目前只接受 admin_password_reset 一个值,所以恢复入口分辨不出这是「成员离开组织」导致的吊销。

Expected

  • revoked_reason accepts organization_membership_ended. That is the framework's own word, already used for sessions as revoke_reason.
  • The Restore action refuses a key revoked for that reason, or is hidden for it.
  • cloud's /_admin/environments/:id/revoke-identity then writes the reason.

Reader who acts

Framework triage (spec plus the sys_api_key actions). This is a spec widening, so it goes through the contract-review tier. The cloud half is a one-line write once it lands.

Dedup

I searched objectstack issues for "revoked_reason membership api key restore": no open card.

Activity

  1. added
    enhancement
    priority:p2
    domain:cloud
    status:parked
    on Oct 31, 2026
  2. objectstack-fleet commented on Oct 31, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: 真挡得住的权限 | none | P②

    Triage: the cloud PM's · status:parked · 2026-10-31T09:55Z

    ⛔ Not a claim. Rule level only.

    • Read fresh. cloud's revoke-identity write depends on this value. A revoked_reason widening plus the Restore refusal is a spec widening with a contract review owed, and cloud then writes the reason. The fix needs both repos, so under 「一个issue只要涉及 cloud ,就归 cloud pm 处理」 it gets status:parked for the cloud PM to schedule. The filer's priority:p2 and security stay.

    Generated by Claude Code

  3. added
    pm:queue
    repo:cloud
    pm:dispatched
    and removed
    status:parked
    pm:queue
    on Nov 7, 2026
  4. objectstack-fleet commented on Nov 8, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:cloud#3 · os-zhuang · session_01QUs3BvRcDHXqRU4TSVE4u6

    Claim: PM loop round 1
    Session: session_01QUs3BvRcDHXqRU4TSVE4u6
    Account: os-zhuang
    Branch: claude/project-thread-11gi1d
    Worktree: the card thread's own clone (mode:thread; the thread can push only its assigned branch, a measured platform exception to claude/issue-N-SLUG)
    Domain: domain:cloud (repo:cloud lane)
    Seat: repo:cloud#3
    File surface: packages/platform-objects (sys-api-key.object.ts revoked_reason options + description), packages/plugin-auth (api-key-restore-guard.ts, the vocabulary pin test), packages/core (security/api-key.ts admission text arm), translations, .changeset/** — corrected from packages/spec/** on the dev's premise reading; nothing in packages/spec (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: opus (dispatch-gates --tier: no path-derived mandate, default tier; the maintainer's standing order pauses the ceiling tier), effort: xhigh
    Clause-②: yes (widening: one new revoked_reason value; contract review before landing)
    Metadata-protocol: none
    Responsibility: implement + local gates; draft PR Closes #28387; seat runs the contract review and lands; cloud write = follow-up card after a pin round
    Thread-read: 6541938694
    Premise: holds (pre-dispatch reading in the dispatch order; the dev re-measures first and stops on a falsified premise)
    Serial constraints cleared: none

  5. objectstack-fleet commented on Nov 8, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:cloud#3 · os-zhuang · session_01QUs3BrzAC1gmXvDdmDaVk6
    os-dev-report

    {
      "issue": 28387,
      "status": "done",
      "branch": "claude/project-thread-11gi1d",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/31435",
      "session": "session_01QUs3BrzAC1gmXvDdmDaVk6",
      "premise_still_valid": true,
      "summary": "Premise held on main db502314 and nothing was already done: sys_api_key.revoked_reason is declared in packages/platform-objects/src/identity/sys-api-key.object.ts:402 (readonly select, options = [admin_password_reset]), not in packages/spec; Restore is the restore_api_key row action (sys-api-key.object.ts:171-186, PATCH /api/v1/data/sys_api_key/{id} with {revoked:false}) whose server door is plugin-auth api-key-restore-guard.ts:106-122; the session word is plugin-auth membership-ended-session.ts:102 MEMBERSHIP_ENDED_REVOKE_REASON. The claim's file surface was corrected by the seat to platform-objects, plugin-auth, core and translations. Done: the option organization_membership_ended added (help text and six translated locales updated, en bundle regenerated); the restore guard refuses every user-context un-revoke of a key carrying it with 403 PERMISSION_DENIED, a platform administrator included (by grant and by the OS_PLATFORM_OWNER_EMAIL anchor), judged before any standing is read, by-id and per row on a multi-row update, with a message naming the reason and the new-key road; system-context writes still pass and clear the reason; core's API_KEY_REVOKED text gets a membership-ended arm, because the old text offered a restore the guard now refuses. admin_password_reset is untouched (its refusal message byte-identical). Refusing platform admins is named in the PR body as an accepted-deviation candidate for the contract review.",
      "tests": "At head eaefa983d. plugin-auth api-key-restore-guard.test.ts + forced-reset-revoke-reason-vocabulary.test.ts: 24/24 passed (8 new cases on the real ObjectQL + SecurityPlugin + D2 rig: host write stored, owner refused, admin by grant refused with a same-caller restore control, admin by email anchor refused with control, re-revoke and smuggled clear keep the reason, admin batch refused whole, system un-revoke clears, door text names no restorer). core api-key-lifecycle.test.ts 23/23. dogfood api-key-data-door-session-required.dogfood.test.ts 10/10: the restore_api_key request read off the registered schema, refused 403 PERMISSION_DENIED to the member session and the platform-admin session, row unchanged, plus an admin restore control (200). Package suites: plugin-auth 240 files / 4257 passed (10 skipped), core 136 / 3147, platform-objects 120 / 1751; typecheck core, platform-objects, plugin-auth, dogfood Done. Ablations, each via ablation-replace with the mutation proven on disk and restored to the HEAD blob: rule 1 removed, engine level, 5/19 red (owner, admin by grant, admin by email, re-revoke, admin batch); admin exemption added (the admin_password_reset pattern), engine level, 3/19 red (the three admin legs only); admin exemption, HTTP level (plugin-auth rebuilt, marker proven in dist, restore leg rebuilt and marker proven absent), dogfood admin leg red, expected 200 to be 403; core text arm removed, 1/23 red.",
      "gates": "dispatch-gates --commands: 75 families from merge base db5023141 at eaefa983d; --ran with recorded exit codes: 74 exit 0, 1 NOT MEASURED: pnpm check:dual-build-cjs-loads exit 3 PREREQUISITE NOT MET (reads every package's dist; only the plugin-auth, dogfood and cli closures were built here). check-plugin-teardown-shape --self-test first exited 3 on a fixture commit outside the shallow clone, passed (48 cases) after fetching that commit. check:i18n platform-objects in sync. objectstack has no check:all script (that runner is cloud's), so the dispatch-gates derived set stands in for it. PR check-runs: in_progress at report time, not waited for.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "3 — mcp__github__issue_read (get x1, get_comments x2), all reads",
      "api_writes": "2 — relay strokes via POST /repos/objectstack-ai/objectstack/dispatches: pr_create (POST /pulls draft + POST /issues/31435/assignees), and this os-dev-report comment (POST /issues/28387/comments); git push is not a REST write",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: cloud · noted, not filed · the follow-up write: packages/objectos-runtime/src/environment-identity-revocation-plugin.ts:309 writes { id, revoked: true } for every reason in REVOKES_ALL_CREDENTIALS; for args.reason === 'membership_ended' it should write { id, revoked: true, revoked_reason: 'organization_membership_ended' }, system context, after a pin round that carries this plugin-auth",
        "carrier: cloud · noted, not filed · the same loop skips keys already revoked (line 307), so a key the member had revoked themselves keeps no reason and stays restorable by an environment administrator; the follow-up can stamp revoked_reason on those rows too (a system write of the reason alone is not an un-revoke, the guard lets it through)",
        "carrier: cloud · noted, not filed · keys revoked for the banned reason carry no revoked_reason and stay restorable; out of this card (no other value)"
      ]
    }
  6. objectstack-fleet commented on Nov 8, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:cloud#3 · os-zhuang · session_01QUs3BvRcDHXqRU4TSVE4u6

    Landed · 2026-11-08T10:11Z: PR #31435 merged into main through the merge queue (head 605c353a, merge f6a429b95) after the pt-BR round; this card closed by its Closes. pm:dispatched dropped in the same act. Owed by the seat after a cloud pin round carries this release, as a cloud card: environment-identity-revocation-plugin.ts writes revoked_reason: 'organization_membership_ended' beside revoked: true on membership removal, including keys that are already revoked.

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

Metadata

Metadata

Assignees

Labels

domain:cloudenhancementpriority:p2repo:cloudsecurity

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions