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.

Compare tenant audit mutations with each request starting state

pulse-triage[bot]f98c1eae7886
diff --git a/internal/api/audit_selection_validation_test.go b/internal/api/audit_selection_validation_test.go
index 92a51d0d70..6e7c56edcb 100644
--- a/internal/api/audit_selection_validation_test.go
+++ b/internal/api/audit_selection_validation_test.go
@@ -253,8 +253,9 @@ func TestAuditSelectionTenantIsolation(t *testing.T) {
req = httptest.NewRequest(http.MethodPut, "/api/admin/webhooks/audit", strings.NewReader(`{"urls":null}`))
req = req.WithContext(context.WithValue(req.Context(), OrgIDContextKey, org))
rec = httptest.NewRecorder()
+ ownUpdates, otherUpdates := factory[org].updates, factory[other].updates
NewAuditHandlers().HandleUpdateWebhooks(rec, req)
- if rec.Code != 400 || factory[org].updates != 0 || factory[other].updates != 0 {
+ if rec.Code != 400 || factory[org].updates != ownUpdates || factory[other].updates != otherUpdates {
t.Fatal("absent selection mutated tenant receivers")
}
req = httptest.NewRequest(http.MethodPut, "/api/admin/webhooks/audit", strings.NewReader(`{"urls":[]}`))