Cameras: redact API keys from feed errors; gate TfL/Calgary; clamp map bbox

- Feed/catalog error text (shown to every signed-in user via GET /cameras and
  /traffic/511 status fields) carried httpx's full request URL, including
  ?key= for Ontario 511 and the 511NY DAA key. Query strings are now dropped.
- TfL and Calgary licences are per GEV only (TfL's terms page 403'd), the same
  footing as Ontario 511, so they are UNVERIFIED (acknowledgement required)
  instead of ungated attribution_required. Attribution still renders.
- The map camera layer clamps its bbox to +/-180/+/-90; zoomed-out bounds
  produced a 422 ("could not reach server").

Refs server-26#198

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Logan Cusano
2026-10-04 18:06:47 -04:00
co-authored by Claude Opus 5.5
parent e6b1581139
commit 2f21728bce
5 changed files with 52 additions and 8 deletions
+4 -1
View File
@@ -60,8 +60,11 @@ export function useMapCameras(map: L.Map, enabled: boolean) {
return useCameraFetch(
enabled
? () => {
// Clamp: zoomed out (or panned past the antimeridian) Leaflet bounds run
// past ±180/±90, and GET /cameras answers 422 to an out-of-range bbox.
const b = map.getBounds().pad(BBOX_PAD);
return { south: b.getSouth(), west: b.getWest(), north: b.getNorth(), east: b.getEast() };
const clamp = (v: number, lim: number) => Math.max(-lim, Math.min(lim, v));
return { south: clamp(b.getSouth(), 90), west: clamp(b.getWest(), 180), north: clamp(b.getNorth(), 90), east: clamp(b.getEast(), 180) };
}
: null,
[map, enabled],