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.

Keep the token list handler in the shape its source pin expects

rcourtmand08eb807955a
diff --git a/internal/api/security_tokens.go b/internal/api/security_tokens.go
index c474f2f93f..3d0b18a5fe 100644
--- a/internal/api/security_tokens.go
+++ b/internal/api/security_tokens.go
@@ -307,11 +307,11 @@ func (r *Router) handleListAPITokens(w http.ResponseWriter, req *http.Request) {
callerToken := getAPITokenRecordFromRequest(req)
tokens := make([]apiTokenDTO, 0, len(r.config.APITokens))
- for idx := range r.config.APITokens {
- if !callerTokenMayManage(callerToken, &r.config.APITokens[idx]) {
+ for _, record := range r.config.APITokens {
+ if !callerTokenMayManage(callerToken, &record) {
continue
}
- tokens = append(tokens, toAPITokenDTO(r.config.APITokens[idx]))
+ tokens = append(tokens, toAPITokenDTO(record))
}
w.Header().Set("Content-Type", "application/json")