Consolidate egress configuration across backends - #88
Open
aron-cf wants to merge 5 commits into
Open
Conversation
Default ambient execution network access to blocked across containers and Dynamic Workers. Support explicit direct access or an HTTP gateway while keeping host Git and artifact capabilities independent. Route container gateway requests through authenticated workspace callbacks and scope Worker shell loader identities by policy. Replace the custom shell fetcher path with typed loader and external runtime sources.
馃 Changeset detectedLatest commit: 2d47263 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Thanks for your interest in Cloudflare Computer. This repository does not accept unsolicited pull requests. Please use one of the accepted contribution paths instead:
If a maintainer asked you to open this pull request, they can add the |
commit: |
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.
This change gives the container, Worker shell, and Worker JavaScript backends one way to configure ambient network access. Previously the container always had direct Internet access, while the Dynamic Worker backends used backend-specific controls. The Worker shell's custom
fetcheroption also mixed runtime creation with outbound network policy.The shared
WorkspaceEgressPolicysupports three modes.noneblocks ambient network access and is the default,directuses the backend's native Internet access, andhttp-gatewaysends HTTP and HTTPS requests through a host-providedFetcher. The gateway mode does not promise portable interception of arbitrary TCP connections. Trusted host operations, including Git and artifact network access, remain controlled by their existing capability options rather than by ambient egress.A policy can be defined once and passed to any backend:
For a container backend, pass the policy alongside the container host and workspace reference. Container callbacks use an authenticated
WorkspaceProxy, so the Worker must continue to export that entrypoint. Existing applications that need the previous direct Internet behavior must now opt in withdirectEgress.For the managed Worker shell, the same policy is applied before the Loader creates or selects the shell isolate. The policy identity is included in the Loader cache key, and
revisionlets an application choose when a gateway configuration may reuse an isolate.Applications that create the shell runtime through a service binding, dispatch namespace, broker, or pool can use the explicit external runtime source. The source receives the policy before it creates or selects the runtime, and is responsible for enforcing it.
For Worker JavaScript, the policy maps directly to the Dynamic Worker Loader's outbound setting. The existing
globalOutboundoption remains available for compatibility, but it cannot be combined withegress.The change is covered by backend tests for all three modes, Worker shell source and Loader lifecycle tests, container callback authentication tests, and proxy forwarding tests. The container-based examples opt into direct egress so their existing behavior does not change.
Reviewers can verify the change with:
Reference documentation and a production example for the external Worker shell runtime remain follow-up work.