GeezerVison is showing github.com — Bridge S3: per-agent fleet credentials + bootstrap enroll tokens (#14368) by dezren39 · Pull Request #14407 · developing-today/code
Conversation
dezren39
commented
Nov 24, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Implements bridge build-out slice S3 (design §4.5, trust resolutions §5.1–3): the fleet surface gains per-agent credentials and bootstrap enrollment, on the notes surface's hash-only model.
What changed (pkgs/message-bridge/worker):
fleet_credential (token_hash PK, agent, scopes, created, revoked_at) — SHA-256 hashes only. A /fleet/<credential>/... request acts only as its own agent: hello/inbox/ack for its own name (scope inbox), send with from_addr fixed to agent:<its name> and the sender label forced to match (scope send). Every refusal is the plain 404 a wrong token gets.
enroll_token (token_hash PK, agent, kind, groups, notes_identity, expires_at, used_at, revoked_at, created) — POST /api/<owner>/enroll-tokens mints a single-use, expiring bootstrap token bound at mint time to the agent name, kind and groups; the value is returned once in that response and never stored.
POST /enroll/exchange {bootstrap_token, agent} — one atomic claim (name match + unused + unrevoked + unexpired) burns the token, registers the fleet mailbox with the bound groups and, when minted with one, the class/name notes identity; mints the fleet credential and notes token and returns their values once. Any failure is a plain 404.
- Revocation:
POST /api/<owner>/fleet/credentials/revoke {agent}, POST /api/<owner>/notes-tokens/revoke {identity}, POST /api/<owner>/enroll-tokens/revoke {bootstrap_token | token_hash} (unused tokens only).
- The shared fleet token keeps working unchanged; no existing route is removed or weakened.
enroll joins the reserved signal classes so the exchange path can't be shadowed by the public wake signal.
- Durable Object methods +
MemoryStore mirrors for every new store op; router inventory comment updated.
Tests — new test/credentials.test.mjs (6 tests), following the notes/fleet patterns: exchange provisions working fleet + notes credentials exactly once; a credential is refused (404) for another agent's inbox/hello/ack/send and cannot forge a sender (a send claiming sender: drew is stamped agent:<its name>); scopes gate routes; revocation of a fleet credential and of a notes token stops them immediately while other agents and the shared token are unaffected; bootstrap tokens expire, can be revoked while unused, and a used token can't be revoked; a sql-level test asserts hash-only storage (stored hashes equal the SHA-256 of the values; no value appears in any stored row) and the claim predicate.
Verification (remote): run 45406245992 reached the target HEAD (889ddc8) but died with node: command not found — the known executor-image gap (code#14267 / dezren39/fleet#111), recorded here rather than skipped. Re-dispatched with node provided by nix (run 45407524524, Target HEAD 889ddc8, node v22.23.5): 78 tests, 78 pass, 0 fail — the full worker suite, with the six new tests passing by name (ok 29–34).
Acceptance: all five criteria on #14368 are covered by the named tests above.
Left unmerged for Felix's review (security diff).
Closes #14368
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
fleet_credential and enroll_token tables store SHA-256 hashes only.
A /fleet credential acts only as its own agent (inbox scope:
hello/inbox/ack for its own name; send scope: from_addr fixed to
agent:<its name>); every refusal is the plain 404. Owner routes mint
single-use, expiring, name/kind/groups-bound bootstrap tokens and
revoke fleet credentials, notes tokens and unused bootstrap tokens.
POST /enroll/exchange burns the token, registers the mailbox (and the
notes identity when minted with one) and returns the agent's fleet
credential and notes token once. The shared fleet token is unchanged.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 43 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c485028e-be0c-4e6a-96e2-ba3b43ff08bb
Commits
-
Reviewing files that changed from the base of the PR and between ee91ecc and 889ddc8.
Files selected for processing: 6
-
pkgs/message-bridge/worker/src/fleet.js
pkgs/message-bridge/worker/src/index.js
pkgs/message-bridge/worker/src/messages.js
pkgs/message-bridge/worker/src/notes.js
pkgs/message-bridge/worker/src/routes.js
pkgs/message-bridge/worker/test/credentials.test.mjs
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 24, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|