fix: allow cold managed service discovery only at stage admission
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user