Repository navigation
feat(sdk): support TLS on the BYOP egress proxy connection - #1958
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
🦋 Changeset detectedLatest commit: c16cb96 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
Package ArtifactsBuilt from f1216f4. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-dockerfile-utils-0.1.2-devin-1791388625-egress-proxy-tls.0.tgz ./e2b-2.56.1-devin-1791388625-egress-proxy-tls.0.tgzCLI ( npm install ./e2b-cli-2.22.1-devin-1791388625-egress-proxy-tls.0.tgzCode Interpreter JS SDK ( npm install ./e2b-code-interpreter-2.9.1-devin-1791388625-egress-proxy-tls.0.tgzDesktop JS SDK ( npm install ./e2b-desktop-2.5.1-devin-1791388625-egress-proxy-tls.0.tgzPython SDK ( pip install ./e2b_dockerfile_utils-0.1.1+devin.1791388625.egress.proxy.tls-py3-none-any.whl ./e2b-2.56.0+devin.1791388625.egress.proxy.tls-py3-none-any.whlCode Interpreter Python SDK ( pip install ./e2b_code_interpreter-2.11.0+devin.1791388625.egress.proxy.tls-py3-none-any.whlDesktop Python SDK ( pip install ./e2b_desktop-2.7.0+devin.1791388625.egress.proxy.tls-py3-none-any.whl |
|
on the above - TLS should be uppercase (please add Linear task to use abbreviations in their intended casing) |
|
@mishushakov Keeping |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
LGTM. Straightforward, well-contained feature addition that passes a new tls option through to the existing SOCKS5 egress proxy config, with matching implementations in both SDKs, generated types kept in sync with the pinned spec bump, and new unit tests on both sides.
What was reviewed: the JS (sandboxApi.ts) and Python (sandbox_api.py) request/response builders for the egress proxy, confirming tls is validated (object with boolean enabled) and round-tripped consistently with the existing address/username/password pattern; the spec/runtime-ref pin bump matches the claimed upstream commit; the changeset covers both packages; and the prior inline review comments (missing doc comments on SandboxEgressProxyTLSInfo.enabled/serverName) were actually fixed in the follow-up commit, not just self-resolved.
Extended reasoning...
Change adds a tls sub-option (enabled/serverName/caCert) to the BYOP SOCKS5 egress proxy feature, touching the OpenAPI/envd specs (via a pinned runtime-ref bump, not hand-edited), generated schema/client code, and the JS and Python SDK request/response builders plus new tests; no injection, auth, or crypto logic lives in the SDK itself (TLS verification happens server-side), so the security-sensitive surface is minimal. The two rounds of inline review comments asking for missing doc comments were genuinely addressed in a follow-up commit, and the JS/Python implementations are symmetric, so this is a low-risk, mechanical-pattern change suitable for approval.
approve
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
85d033a to
09ea97f
Compare
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
Summary
The API accepts an optional
tlsobject onnetwork.egressProxy(e2b-dev/belt#3753, #3816; documented in e2b-dev/docs#508). Both SDKs rebuild the proxy body from known fields, sotlswas silently dropped. Worse, an SDKupdateNetworkon a TLS sandbox turned TLS off. This PR adds it to the SDKs.SDK shape:
SandboxEgressProxyOpts.tls?: boolean | SandboxEgressProxyTLSOpts, withSandboxEgressProxyTLSOpts = { serverName?; caCert? }(Python{server_name?, ca_cert?}). An object turns TLS on, soenabledisn't part of the SDK surface. This applies to create and update.Wire mapping:
true→{enabled: true}, which means the system trust store, with the SNI taken from theaddresshost.{enabled: true, ...fields}.false/null→tlsis omitted, which the server treats the same as{enabled: false}.Validation:
InvalidArgumentError/InvalidArgumentExceptionis thrown whentlsis neither a bool nor an object, or when the object contains anenabledkey. The second case guards REST-shaped{enabled: false}from silently turning TLS on. Lengths and PEM validity are still checked server-side.Info:
SandboxEgressProxyInfo.tls?: SandboxEgressProxyTLSInfo({ serverName? }) is set only when the API reports TLS enabled.caCertis never returned by the API, so it's never mapped.Naming:
TLSis uppercase in the type names on purpose. SDK-387 tracks updating TASTE.md T-12 to match.Spec pin:
spec/runtime-refis bumped to e2b-dev/runtime9cc9ca75, which addsSandboxEgressProxyTLSConfig. Relative to main, the pin also brings a few unrelated spec changes into the generated clients:filesHashpattern;cpuCounton init and the CPU metrics fieldscpu_possible,cpu_target,cpu_target_attemptsandcpu_write_pending_ms.None of them are exposed in or used by the SDK API.
Covered by mocked-API unit tests in
egressProxy.test.ts/test_egress_proxy.py. Not verified live, because the test team gets403: Egress proxy (network.egressProxy) is not enabled for this team.Link to Devin session: https://app.devin.ai/sessions/43e708f1a1764a1d8b65c0163545efec
Open in Devin Desktop: https://app.devin.ai/desktop/session/43e708f1a1764a1d8b65c0163545efec?variant=devin
Requested by: @mishushakov