Skip to content

Gate terracotta: forwardAuth for private tiles, maxzoom gate for public - #2

Merged
mattiashem merged 2 commits into
mainfrom
spreading-compliance
Nov 12, 2026
Merged

mattiashem merged 2 commits into
mainfrom
spreading-compliance

Conversation

@mattiashem

Copy link
Copy Markdown
Contributor

Part of the spridningstillstånd rollout (map-maker/docs/spridningstillstand.md).

  • Private tiles: /private-tiles/{rgb,singleband} → terracotta (private catalog) through Traefik forwardAuth → /auth/tiles. Only members of the space in the path get through.
  • Public tiles: /public/{rgb,singleband} → terracotta-public through forwardAuth → /auth/public-tile. It enforces z ≤ max public zoom, computed from the dataset's northernmost latitude, and only allowlisted query params (no tile_size).
  • Closed routes: /rgb /singleband /metadata /keys /colormap /datasets /compute are no longer routed. Before this change, private full-resolution tiles and the whole catalog were open to anyone.
  • Catch-all: never serves .tif outside public/, the legacy <realm>/cogs/… keys, or detections.json.
  • Cache: /cache/purge (used by map-maker on unpublish/delete) and /cache/clear/ now need X-Api-Key.
  • Bug fix: private/<realm>/cogs/<space>/… keys are now authorised against the right space; they were always 403.
  • Tests: code/test_gate.py.

🤖 Generated with Claude Code

- /private-tiles/{rgb,singleband} -> terracotta (space membership check)
- /public/{rgb,singleband} -> terracotta-public (z <= max public zoom,
  query allowlist); /datasets, /metadata etc. no longer routed
- catch-all never serves COGs outside public/ or detections
- keyed /cache/purge and /cache/clear/; fix space parsing for
  private/<realm>/cogs/<space>/ keys

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattiashem
mattiashem merged commit 10f6931 into main Nov 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants