test: TestGolemAdminSchemas refuses an AI model JSON with any api_key key, even redacted
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user