mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-11 02:55:51 +00:00
9bac3f421d
Two test regressions introduced when agent-report tokens were allowed as fallback auth for /api/auto-register: 1. Org mismatch was not checked: a token belonging to org-a could authenticate a request whose context carried org-b. Add an explicit org consistency check before setting authenticated=true in the fallback path. 2. The security regression test assumed only setup tokens could authenticate auto-register. That contract has intentionally changed: agent-report tokens can now authenticate but are restricted to updating existing nodes (403 for new-node attempts). Update the test to assert the actual security boundary.