fix(macos): restore Homebrew sandbox callbacks - #2739
Conversation
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
|
🌿 Preview your docs: https://nvidia-preview-pr-2739.docs.buildwithfern.com/openshell |
|
Agent-driven review found the following, emphasis mine. I did not try to reproduce it, though. P1 — Reusing the primary listener exposes HTTP routes to sandboxesOpenShell/crates/openshell-server/src/gateway_listener.rs Lines 156 to 158 in 5445a1a Sandbox JWT authorization protects gRPC methods, but it does not protect the primary HTTP router. That router includes WebSocket, authentication, and unauthenticated sandbox-service proxy routes (http.rs:180-187). A sandbox can therefore set a service-routing Host header and reach another sandbox’s exposed service through the gateway without authorization. Health and reflection also become reachable. This removes the isolation that callback-only listeners provided. The PR should preserve callback restrictions on sandbox traffic or add equivalent HTTP-route enforcement before reusing the primary socket. |
Sandboxed workloads still won't be able to access the gateway so I don't think it's valid. |
Summary
Fix macOS Homebrew gateway connectivity for the CLI and Docker Desktop or Podman Machine sandbox callbacks. Homebrew now uses the built-in IPv4 loopback listener, while the gateway reuses any reachable primary listener and creates a callback-only listener only when necessary.
Related Issue
No issue required: localized regression fix for the package-generated macOS gateway configuration.
Changes
https://localhost:17670and normalize raw IPv6 literals for TLS server-name validationgateway.tomlwithout an explicitbind_address, preserving the built-in127.0.0.1:17670defaultTesting
mise run pre-commitpassesAdditional suites:
cargo test -p openshell-server gateway_listener_specs_ --libcargo test -p openshell-driver-docker --libcargo test -p openshell-driver-podman --libcargo test -p openshell-cli --libuv run --frozen pytest -q python/openshell/release_formula_test.pybash tasks/scripts/test-install-sh.shChecklist