test: TestGolemAdminSchemas refuses an AI model JSON with any api_key key, even redacted

This commit is contained in:
Jakub Zych
2026-10-04 02:03:57 +02:00
parent 70314b508d
commit 6646d10ff5

View File

@@ -58,8 +58,8 @@ func TestGolemAdminSchemas(t *testing.T) {
}
m := models.AiModel{Name: "Hidden", APIKey: lagoon.NewEncrypted("sk-hidden-0001")}
raw, _ := json.Marshal(m)
if strings.Contains(string(raw), "sk-hidden-0001") {
t.Fatalf("the model serializes its key: %s", raw)
if strings.Contains(string(raw), "sk-hidden-0001") || strings.Contains(string(raw), "api_key") {
t.Fatalf("the model serializes its key, even redacted: %s", raw)
}
if len(models.All()) == 0 || len(p.Models()) == 0 || len(p.Migrations()) == 0 {
t.Fatal("the plugin hands no models or migrations to the framework")