Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Bind audit guidance smoke checks to the unambiguous decoder

pulse-triage[bot]ea61020cb11f
diff --git a/scripts/tests/test_audit_recovery_docs.py b/scripts/tests/test_audit_recovery_docs.py
index d78798b598..3ab795101d 100644
--- a/scripts/tests/test_audit_recovery_docs.py
+++ b/scripts/tests/test_audit_recovery_docs.py
@@ -114,7 +114,11 @@ class AuditWebhookDocsTest(unittest.TestCase):
handler = (ROOT / "internal/api/activity_audit_handlers.go").read_text().split(
"func (h *AuditHandlers) HandleUpdateWebhooks", 1)[1].split(
"// validateWebhookURL", 1)[0]
- self.assertIn('URLs []string `json:"urls"`', handler)
+ # Admission now lives in the duplicate-preserving decoder, not an
+ # inline struct. Bind the documented complete replacement to that path.
+ self.assertIn("urls, err := decodeAuditWebhookSelection(r.Body)", handler)
+ self.assertLess(handler.index("decodeAuditWebhookSelection(r.Body)"),
+ handler.index("validateWebhookURL(rawURL)"))
self.assertIn("getLoggerForOrg(orgID)", handler)
self.assertIn("logger.UpdateWebhookURLs(validatedURLs)", handler)