mirror of
https://github.com/unpoller/unpoller.git
synced 2026-09-30 03:21:28 +02:00
Found by running this against a real UNVR4 rather than only the fake one. setDefaults fills an unset user with the placeholder "unifipoller". For a Protect-only console that placeholder was reaching Login(), the console answered 403, and the controller died during initialisation -- the same symptom #1066 set out to fix, one layer further in. A Protect API key and no local account is the config an operator actually writes for a UNVR, so this was the common case, not an edge one. Nothing on such a console uses a session unless Protect logs are wanted: the Integration API authenticates with the key alone. So withhold the credentials entirely in that case, and say so in the startup summary rather than naming a username that is never sent. Also pins the go.mod bump to unifi v6.0.1, which is the release that carries NewProtectClient (unpoller/unifi#240). Verified end to end against a UNVR4 (UniFi OS 5.1.31, Protect 7.2.105): the controller comes up, logs "Auth: Protect API key only (no session needed)", makes no login request at all, and exports 37 unpoller_protect_* series across 9 cameras and 2 bridges with unpoller_controller_up = 1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GVreutpEATmBjm6PBw9RjQ