Stream live server logs over SSE

This commit is contained in:
npc0-hue
2026-08-03 22:28:54 +08:00
parent 5d4fca14f9
commit 7eac1926dd
48 changed files with 1526 additions and 263 deletions
+19 -1
View File
@@ -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",