mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-28 16:58:31 +01:00
/api/auto-register accepts agent:report tokens so a Proxmox agent can refresh the API token Pulse holds for its own node when that connection stops working. Every monitored host holds such a token, including Docker-only and Kubernetes-only hosts, and nothing an agent says about itself (serverName, candidate addresses, its bound hostname, which a command-enabled agent may rebind) proves which connection is its own. The proof is the install grant. An admin-issued, first-host-bound, expiring grant may still adopt or create a source, and spending it records the connection address on the token. Without an available grant, an agent token may now refresh the credentials of an existing PVE or PBS connection, or a cluster member, only at that recorded address, and the stored address and TLS pin stay as they are. Anything else is a 403 that changes nothing. The registration check reports canRegister on the same terms, so an agent does not rotate a credential it cannot register. Setup-token registration and install-grant creation and adoption are unchanged. An agent whose token never spent a grant keeps its current connection instead of replacing it; reinstalling the agent from a fresh install command, or re-running the node setup, refreshes it. The handler also stops logging the raw request body when auto-register or auto-unregister JSON fails to parse, and logs its size instead. Contract-Neutral: authorization fix inside /api/auto-register; request and response shapes unchanged; api-contracts records the rule