commit 765c0cfdff3c720ca1d9fb24753999b2b894e4a9
parent 102c38f72bf9398618a284d8c35e94c4b2d90daf
Author: triesap <tyson@radroots.org>
Date: Tue, 25 Aug 2026 21:53:34 +0000
mobile-core: align device relay policy coverage
- accept plaintext relay URLs for literal RFC1918 device peers
- retain rejection of public DNS names under device policy
- retain rejection of loopback and link-local destinations
- bind the downstream context model to the shared transport policy
Diffstat:
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/crates/mobile_core/src/runtime/product_surface/context.rs b/crates/mobile_core/src/runtime/product_surface/context.rs
@@ -441,7 +441,26 @@ mod tests {
0,
LocalNetworkRelayPolicy::Device,
)
- .is_err()
+ .is_ok()
);
+ for denied in [
+ "wss://relay.example",
+ "ws://127.0.0.1:7447",
+ "ws://169.254.1.7:7447",
+ "ws://8.8.8.8:7447",
+ ] {
+ assert!(matches!(
+ LocalNetwork::new_for_relay_policy(
+ "id".into(),
+ "label".into(),
+ vec![denied.into()],
+ None,
+ vec![],
+ 0,
+ LocalNetworkRelayPolicy::Device,
+ ),
+ Err(LocalNetworkError::InvalidRelay)
+ ));
+ }
}
}