From 9cd31e48ca32604f89098b5337d7dc208f6c20d6 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sun, 15 Nov 2026 00:12:07 +1100 Subject: [PATCH] fix(openshell): sandboxes install scoped npm packages; egress endpoints allow encoded slashes (#1864) --- internal/infrastructure/openshell/runtime.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/infrastructure/openshell/runtime.go b/internal/infrastructure/openshell/runtime.go index a5ad92433..25583e9fa 100644 --- a/internal/infrastructure/openshell/runtime.go +++ b/internal/infrastructure/openshell/runtime.go @@ -279,7 +279,13 @@ func (r *Runtime) spec(l Launch) (*v1.SandboxSpec, error) { if err != nil { return nil, err } - endpoints = append(endpoints, v1.PolicyNetworkEndpoint{Host: host, Port: uint32(port)}) //nolint:gosec // G115: a parsed port is 1 to 65535. + // Package registries name scoped packages with an encoded slash + // (@scope%2Fname), which the gateway's HTTP filter refuses unless + // the endpoint allows it, and it allows it only on a REST endpoint. + endpoints = append(endpoints, v1.PolicyNetworkEndpoint{ + Host: host, Port: uint32(port), //nolint:gosec // G115: a parsed port is 1 to 65535. + Protocol: "rest", Access: v1.NetworkAccessPresetFull, AllowEncodedSlash: true, + }) } rules["egress"] = v1.NetworkPolicyRule{Name: "egress", Endpoints: endpoints, Binaries: []v1.PolicyNetworkBinary{{Path: anyBinary}}} }