Files
via-core/crates/roads/tests/fixtures/home/devices.json
T
mnovak 69e3a9377d [roads] QA F-01: a service road grants only that service
A firewall sees an address and a port, never a hostname, so a road to
photos.home.arpa compiled to home-server:443 and also opened git.home.arpa
there. Rules are now per service:

- devices.json services may carry their own mesh address (same rules as a
  device address, unique among all of them). A road to such a service compiles
  to that address only; the hosting device's plan lists it in the new field
  services[] so it answers on it, and DNS points there.
- A road to a service that shares its address and a port with another service
  is refused (service.shared), naming the others, instead of opening both.
  Narrowing ports: to a port nobody else serves on that address is allowed.
- A device: road reaches the whole device: its own address and its services'
  own addresses.

No Ianitor identity check is needed for this. The home fixture gives photos
its own address (100.96.1.2); tests that encoded the old host:port model are
updated, three new snapshot fixtures cover the address rules, and the golden
plans and pinned digest are regenerated. Mutation-checked: dropping the
refusal, or ignoring the service address, each fails an F-01 test.
2026-11-25 09:01:18 +01:00

18 lines
1.2 KiB
JSON

{
"format": 1,
"devices": [
{ "key": "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE", "name": "mark-pc", "owner": "mark", "address": "100.96.0.1" },
{ "key": "AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI", "name": "home-server", "owner": "mark", "address": "100.96.0.2", "exit": true, "relay": true,
"routes": ["192.168.100.0/24"],
"services": [
{ "host": "photos.home.arpa", "ports": ["tcp/443"], "address": "100.96.1.2" },
{ "host": "git.home.arpa", "ports": ["tcp/443", "tcp/22"] }
] },
{ "key": "AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM", "name": "jana-phone", "owner": "jana", "address": "100.96.0.3" },
{ "key": "BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ", "name": "jana-laptop", "owner": "jana", "address": "100.96.0.4" },
{ "key": "BQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU", "name": "router", "address": "100.96.0.5", "classic": true },
{ "key": "BgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgY", "name": "friend-node", "owner": "petr", "address": "100.96.0.6", "exit": true },
{ "key": "BwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwc", "name": "petr-phone", "owner": "petr", "address": "100.96.0.7" }
]
}