Skip to content

desk-hub: an admin's machine removal bound to the machine's key (?ref=&pub=), for O8 M4b - #538

Merged
SSFSKIM merged 2 commits into
masterfrom
p5-desk-revoke-key-precondition
Nov 8, 2026
Merged

SSFSKIM merged 2 commits into
masterfrom
p5-desk-revoke-key-precondition

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

For P5 O8 M4b. When an app's drop of a machine settles, the app deletes that machine's hub row, which can happen well after the drop was signed. If another root enrolled the name anew in between, today's DELETE /api/machines/<name> would revoke the new enrollment's row and credential, because it revokes whatever holds the name when it lands.

What changes

  • DELETE /api/machines/<name>?ref=<MachineRef>&pub=<key> removes the row only while its enrollment's posted key (keepMachineKey) is that ref and pub.
  • A row whose enrollment posted another key, or none, answers 200 {revoked: name} and touches nothing of the name's. This is the answer revokeMachine's enrollment mismatch already gives (leave(), the offline sweep).
  • The check is part of revokeMachine's first synchronous step, before the fence at the Machine object, so nothing can land between the check and the act.
  • One parameter alone, or either one out of shape, answers 400 bad-shape. With neither parameter, the route behaves as it does today (the CLI's removal).
  • The key-bound form is its own Registry method, revokeKeyed, not a third argument of revoke. A deploy reaches the Durable Objects minutes after the Worker, and an older Registry would ignore an extra argument and remove whatever holds the name. It lacks revokeKeyed, so the Worker's existing failure() answers 503 hub-updating and the app asks again (review finding, fixed in 118d985).

Why the key, and not the enrollment id. A key names one machine across enrollments:

  • the state moves a dropped key to retired or revoked, and it is never current again;
  • keepMachineKey posts no key that another ref holds, and no retired or revoked key;
  • an enrollment keeps its first key (409 key-posted).

So a row carrying the dropped key belongs to the dropped machine, whichever enrollment holds it.

Boundaries

  • A certificate machine posts no key, so a removal bound to a key never matches one. The app's drop applies to the state's machines only.
  • Until a hub runs this change, it ignores the parameters, and its answer is the same either way. The app keeps its own client guard (O8's D23).

Tests (apps/desk-hub/test/org-enrollment.test.ts, 5 new):

  • the matching key removes the row;
  • the row is left alone when the name was enrolled anew under another machine's key, or when the same ref was re-keyed;
  • a row whose enrollment posted no key is left alone;
  • shapes: half a pair, a bad ref, a bad pub, an unknown name (404), a non-admin (403), and neither parameter (today's removal).
  • a Registry before revokeKeyed answers 503 hub-updating and touches nothing; org-boundaries.test.ts adds revokeKeyed to the stale-admin and removed-member calls.

Making the key check always pass turns 2 of the new tests red. Locally, I ran only those two test files, one at a time. The gates run on CI.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)

…y (?ref=&pub=)

DELETE /api/machines/<name>?ref=<MachineRef>&pub=<key> removes the row only
while its enrollment's posted key (keepMachineKey) is that one. A row of
another enrollment's key, or of none, is answered {revoked: name} with
nothing of the name's touched, as revokeMachine's enrollment mismatch
already is, and the check is the same synchronous step as the fence. One
parameter alone, or either out of shape, is 400 bad-shape; neither keeps
today's removal of whatever holds the name (the CLI's).

For P5 O8 M4b: the app deletes a dropped machine's hub row once the drop
settles, which can be after another root enrolled the name anew. A key
names one machine across enrollments (a dropped key is retired or revoked
and never posted again), so the row the app means is the one with its key.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T12:09:12.072975Z d222606 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…ethod, so a Registry before it fails closed

The key was a third argument of revoke(member, name); a Registry still on the code before it, reached by the new Worker during a deploy, would ignore the argument and remove whatever holds the name. revokeKeyed is a method that Registry lacks, so the call fails as hub-updating and the app asks again. revoke is as it was; the admin and unknown-machine checks are shared.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
SSFSKIM added a commit that referenced this pull request Nov 8, 2026
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Nov 8, 2026
…538, DL 254): DELETE /api/machines/<name>?ref&pub, revokeKeyed failing closed on an older Registry, for O8 M4b's drop

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@SSFSKIM
SSFSKIM merged commit d76c274 into master Nov 8, 2026
@SSFSKIM
SSFSKIM deleted the p5-desk-revoke-key-precondition branch November 8, 2026 12:57
SSFSKIM added a commit that referenced this pull request Nov 8, 2026
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Nov 8, 2026
…s, push-then-grant with final verdicts; live use needs wire 33 and a hub carrying #538; seven residue rows; the UX copy ticket (board 540)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant