fix(openshell): sandboxes install scoped npm packages; egress endpoints allow encoded slashes (#1864)

This commit is contained in:
sam committed 2026-11-15 00:12:07 +11:00
1 parent 998c72f8d3
commit 9cd31e48ca
1 file changed
+7 -1
+7 -1
View File
@@ -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}}}
}