fix: allow cold managed service discovery only at stage admission

This commit is contained in:
2026-10-20 21:53:18 +01:00
parent bb98bde4fc
commit d3c7e6e784
10 changed files with 276 additions and 6 deletions
@@ -8,11 +8,13 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"testing"
)
func TestExecutionServiceReferencePinsIdentityAndAuth(t *testing.T) {
t.Setenv("HOME", t.TempDir())
c, calls := exportAPI(t, `{"data":{"info":{"id":"ses_ok"},"messages":[{"type":"user","text":"execution A"}]}}`, 200)
chatCalls := 0
chat := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@@ -50,6 +52,9 @@ func TestExecutionServiceReferencePinsIdentityAndAuth(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if runtime.GOOS == "darwin" && !strings.HasPrefix(ref, filepath.Join(os.Getenv("HOME"), "Library", "Caches")+string(filepath.Separator)) {
t.Fatal("reference escaped scratch macOS HOME cache")
}
data, _ := os.ReadFile(ref)
if strings.Contains(string(data), c.password) || strings.Contains(string(data), `"password"`) {
t.Fatal("credential copied into reference")