Repository navigation
feat(cloud-workers): authenticated worker protocol with closed ingress and minted credentials - #104688
Merged
Conversation
Contributor
|
Codex review: stale review; fresh review needed. Summary Next step |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 12, 2026
…s and minted credentials (openclaw#104688) * feat(cloud-workers): add authenticated worker protocol * feat(cloud-workers): add worker credential primitives * docs(gateway): document closed worker protocol * test(cloud-workers): keep protocol fixtures lean * fix(cloud-workers): bound live worker connections * fix(cloud-workers): close admission and cleanup gaps * docs: regenerate docs map for worker protocol page
This was referenced Jul 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of #104294 (cloud workers, milestone 2, PR 5). Builds on the merged milestone-1 stack (#104401, #104465, #104532, #104553). Design:
docs/plan/cloud-workers.md("Worker protocol (dedicated; not the node protocol)").What Problem This Solves
Milestone 1 can provision, bootstrap, and tunnel to a worker box, but there is no authenticated way for that box to talk to the gateway. The design deliberately does NOT reuse the node protocol: a connected node can emit
node.event: agent.requestand start a gateway-side run, so node-role ingress is not a security boundary for untrusted workers. This PR adds a dedicated, authenticatedworkerconnection with a closed dispatch surface and hashed-at-rest minted credentials — the identity layer the milestone-2 loop (transcript ingestion, inference proxy) will plug into.Why This Change Was Made
src/gateway/server/ws-connection/worker-connection.ts): a dedicated loopback worker WS path with a closed dispatcher. Worker connections can invoke only worker-protocol methods (admission verification + heartbeat/status); anything else is rejected fail-closed with a bounded reason and never reaches node/operator/plugin handlers. Enforced at the connection-dispatch boundary, not scattered checks.worker-environmentscredential primitives): high-entropy, stored only as hashes (never plaintext at rest) in a dedicated credential table with binding/lifecycle fields kept separate from environment state. Bound to environment id, worker bundle hash, allowed session (SQL NULL until attach), RPC-set version, owner epoch, and expiry.owner_epochadded via additiveensureColumnmigration. Plaintext exists only in an in-memory delivery seam (takeMintedCredential) the milestone-2 loop consumes.User Impact
Opt-in only; no worker loop, inference, or transcript RPCs yet (PRs 6-8). Establishes the authenticated connection identity and closed surface those build on. No config, changelog, or version-bump changes.
Evidence
scripts/run-vitest.mjsfallback and passed; these are gateway/state/protocol tests with no jsdom dependency, so local execution is representative. Hosted PR CI provides the authoritative Testbox-parity run.origin/maincurrently carries a fake secret-shaped test literal (service.test.ts, ask-...-style fixture added by feat(cloud-workers): pinned SSH tunnel runtime and provider-owned key resolution #104553) that this PR cleans up; the helper's secret scanner refuses any diff that deletes a secret-shaped line. Tracked separately; resolved by this PR's own fixture cleanup.