mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-22 23:22:09 +03:00
handleCursorAgentImageGeneration spawns the Cursor `agent` CLI, but POST /v1/images/generations is shared by ~40 non-spawning image providers that remote callers legitimately use, so the whole route can't be classified LOCAL_ONLY without breaking them. Instead the handler now rejects before any credential lookup or spawn unless the trusted AUTHZ_HEADER_PEER_LOCALITY verdict (stamped by the authz pipeline from the real TCP peer, never the spoofable Host header) is "loopback" or "lan" — mirroring the policy every other LOCAL_ONLY route already gets. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>