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.

Preserve fresh availability reads under a replacement identity

pulse-triage[bot]8feaf71fa34e
diff --git a/internal/api/availability_history_authority_test.go b/internal/api/availability_history_authority_test.go
index a0ed000b66..e24b7a71a9 100644
--- a/internal/api/availability_history_authority_test.go
+++ b/internal/api/availability_history_authority_test.go
@@ -216,7 +216,14 @@ func TestAvailabilityHistoryWithdrawnTokenCannotDisclose(t *testing.T) {
}
fresh := httptest.NewRecorder()
f.router.Handler().ServeHTTP(fresh, f.request(t, availabilityAuthorityToken, transport, availabilityAuthorityBody))
- if fresh.Code == http.StatusOK {
+ if change == "credential" || change == "principal" {
+ // The raw key still has monitoring-read authority, now under
+ // its replacement identity. Only the old admission is invalid;
+ // a new request must use the current identity normally.
+ result := make(chan *httptest.ResponseRecorder, 1)
+ result <- fresh
+ readAvailabilityAuthorityResult(t, result, http.StatusOK)
+ } else if fresh.Code == http.StatusOK {
t.Error("fresh read reused withdrawn authority")
}
})