[roads] Mark's decision: person and group grants leave classic devices out
Mark, 2026-11-25, "Leave classic out": a grant to a person or a group covers only their post-quantum devices. A classic router is reached only through a device: road of its own, which says classic: true. Before, a person grant covered their classic devices and so needed classic: true itself, and one classic device blocked every road of its owner (builder's self-review #5). New test a_person_grant_never_covers_their_classic_device, which fails with the old compiler. Docs and HANDOVER updated: 91 tests, debug and release.
This commit is contained in:
@@ -200,3 +200,44 @@ fn a_person_deleted_from_the_directory_leaves_their_roads_reported_and_void() {
|
||||
"the friend node kept petr-phone as a peer"
|
||||
);
|
||||
}
|
||||
|
||||
/// Mark, 2026-11-25, "Leave classic out": a grant to a person or a group covers only their post-quantum
|
||||
/// devices. A classic router that Mark owns is reached by none of Mark's or the household's roads, only by
|
||||
/// its own `device:` road with `classic: true`, and that road keeps working.
|
||||
#[test]
|
||||
fn a_person_grant_never_covers_their_classic_device() {
|
||||
let parts = Parts::home().edit_devices(|d| {
|
||||
d.replace(
|
||||
r#""name": "router", "address""#,
|
||||
r#""name": "router", "owner": "mark", "address""#,
|
||||
)
|
||||
});
|
||||
let c = parts.compile();
|
||||
assert_eq!(c.errors().count(), 0, "{:?}", c.problems);
|
||||
let router = &c.plans[&key(5)];
|
||||
// h2x8vd (person:mark -> the home LAN) and k3f9q2 (group:household -> home-server) leave it out.
|
||||
for p in &router.peers {
|
||||
assert!(
|
||||
p.roads.iter().all(|r| r.as_str() == "r8m2tg"),
|
||||
"the router got a peer from a person or group road: {:?}",
|
||||
p.roads
|
||||
);
|
||||
}
|
||||
assert!(
|
||||
!router
|
||||
.peers
|
||||
.iter()
|
||||
.flat_map(|p| p.allowed_ips.iter())
|
||||
.any(|n| n.to_string() == "192.168.100.0/24"),
|
||||
"mark's LAN road reached his classic router"
|
||||
);
|
||||
// Its own classic road still gives it the home server on udp/53 and tcp/22.
|
||||
assert!(fw_accepts(
|
||||
&c,
|
||||
&key(5),
|
||||
"100.96.0.2".parse().unwrap(),
|
||||
Some(("tcp", 22))
|
||||
));
|
||||
// And mark's post-quantum devices keep their access.
|
||||
assert!(c.plans[&key(1)].peers.iter().any(|p| p.key == key(2)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user