TRUSTED_NETWORKS=connected: requests from the subnets the server's interfaces are on right now count as logged in (the car's server, whichever Wi-Fi it's on); CIDRs still work alongside
CI / check (push) Successful in 21s
CI / deploy (push) Successful in 23s

This commit is contained in:
randy committed 2026-11-29 17:19:13 +01:00
1 parent ea14b110e6
commit 62045be0f7
3 files changed
+26 -5

No files matched your search

+6
View File
@@ -148,6 +148,12 @@ class AppTest < Minitest::Test
assert_equal 401, request.get("/api/sync/maps/file", params: { "path" => "offline.pmtiles" }).status
end
def test_connected_networks_are_the_interfaces_subnets
networks = Maptool::App.connected_networks
assert(networks.any? { |n| n.include?(IPAddr.new("127.0.0.1")) }, "loopback's 127.0.0.0/8")
refute(networks.any? { |n| n.include?(IPAddr.new("8.8.8.8")) })
end
def test_map_data_offered_to_clients_is_only_the_map_files
data = Maptool::App::DATA_DIR
files = %w[terrain.pmtiles places/SK.sqlite places/.rsync-partial/SK.sqlite routing/tiles.tar.part routing/service.sh can.json]