mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-13 18:32:12 +03:00
Two follow-ups to the peerContext extraction, both caught by CI. public-policy.test.ts guarded its two loopback cases behind `if (!getMachineTokenSync()) t.skip(...)`. Those are the only tests covering the branch the pack-boot fix added, so a machine-id that failed to resolve would have silenced exactly the coverage that matters and shipped the authorization change untested — which is what the test-masking detector flagged. The sibling management-policy cases in authz/routeGuard.test.ts call the same helper with no guard and pass in CI, so an empty token is a broken environment: assert on it loudly instead of skipping. route-guard-private-lan.test.ts pinned its Host-spoofing regression guard to source text inside management.ts; moving requestPeerAddress into peerContext.ts made the literals disappear from the file it greps, while the property itself was untouched. The guard now follows the implementation: neither module may read the Host header, the owning module must resolve the token-stamped peer, and — new positive anchor — management.ts must still delegate to peerContext, so the guard cannot pass by the policy quietly regrowing a Host-based path.