From e7c0bcd945f8365e86e99b9d450f3a3389fa0e66 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 6 Oct 2018 19:33:51 -0700 Subject: altos-mapd: Add geo-fencing for map requests. Add port and key arguments Map requests are now limited to a region within 17km of any registered launch site. The --port argument allows the listen port to be changed. The --key argument provides the name of a file containing the Google maps API key. Signed-off-by: Keith Packard --- map-server/altos-mapd/AltosMapdClient.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'map-server/altos-mapd/AltosMapdClient.java') diff --git a/map-server/altos-mapd/AltosMapdClient.java b/map-server/altos-mapd/AltosMapdClient.java index fb0c08e6..70ceae82 100644 --- a/map-server/altos-mapd/AltosMapdClient.java +++ b/map-server/altos-mapd/AltosMapdClient.java @@ -77,7 +77,10 @@ public class AltosMapdClient extends Thread implements AltosMapStoreListener { addr == null) { set_status(400); + } else if (!AltosMapd.check_lat_lon(lat, lon)) { + set_status(403); /* Forbidden */ } else { + store_ready = new Semaphore(0); System.out.printf("Fetching tile for %g %g %d\n", lat, lon, zoom); -- cgit v1.2.3