Stream live server logs over SSE
This commit is contained in:
@@ -1695,7 +1695,20 @@ func createCompleteRuntimeBinding(t *testing.T, svc *CoreService, instance domai
|
||||
if err != nil {
|
||||
t.Fatalf("get plugin for runtime binding: %v", err)
|
||||
}
|
||||
binding, err := svc.buildRuntimeBinding(instance, plugin, domain.RuntimeBindingUpdate{ProfileKey: profileKey, Bindings: map[string]string{}}, true)
|
||||
profile, ok := runtimeLifecycleProfile(plugin.RuntimeProfiles, profileKey)
|
||||
if !ok {
|
||||
t.Fatalf("runtime profile %s missing", profileKey)
|
||||
}
|
||||
required, _ := runtimeBindingKeys(plugin.RuntimeProfiles, profile)
|
||||
bindings := map[string]string{}
|
||||
for _, key := range required {
|
||||
if runtimeBindingTestKeyIsSensitive(key) {
|
||||
bindings[key] = "secret://" + instance.ID + "/" + strings.ReplaceAll(key, "/", "-")
|
||||
} else {
|
||||
bindings[key] = "runtime." + strings.ReplaceAll(key, "/", ".")
|
||||
}
|
||||
}
|
||||
binding, err := svc.buildRuntimeBinding(instance, plugin, domain.RuntimeBindingUpdate{ProfileKey: profileKey, Bindings: bindings}, true)
|
||||
if err != nil {
|
||||
t.Fatalf("build runtime binding: %v", err)
|
||||
}
|
||||
@@ -1705,6 +1718,11 @@ func createCompleteRuntimeBinding(t *testing.T, svc *CoreService, instance domai
|
||||
return binding
|
||||
}
|
||||
|
||||
func runtimeBindingTestKeyIsSensitive(key string) bool {
|
||||
normalized := strings.ToLower(key)
|
||||
return strings.Contains(normalized, "password") || strings.Contains(normalized, "credential") || strings.Contains(normalized, "secret") || strings.Contains(normalized, "token") || strings.Contains(normalized, "dsn")
|
||||
}
|
||||
|
||||
func validPluginManifestRegistration() domain.GamePluginManifestRegistration {
|
||||
return domain.GamePluginManifestRegistration{
|
||||
ManifestRef: "artifact://manifests/game.example/0.1.0",
|
||||
|
||||
Reference in New Issue
Block a user