fix(titiler): drop @1x suffix + append SAS token top-level #24

Merged
sirius merged 1 commit from fix/titiler-tile-url into master 2026-08-29 12:13:33 -04:00
Owner

Summary

Live verification of the merged Sentinel-1 SAR feature exposed two bugs that make every tile request fail, even with the /titiler/ nginx + Tailscale Serve wiring in place:

  1. @1x scale suffix breaks TiTiler. The tile template emitted /cog/tiles/WebMercatorQuad/{z}/{x}/{y}@1x, but this TiTiler latest image only registers /tiles/{z}/{x}/{y} (strict int y) and .{format} — no @{scale}x variant. Every request 422s with int_parsing on 21@1x.
  2. SAS token wrapped under token=. sign_cog_url wrote ?token={quote(token)}, but Azure blob rejects that (403, surfaced by TiTiler as 409). Planetary Computer returns the token as a pre-percent-encoded query string (st=…&se=…&sp=rl&…&sig=…); it must be appended top-level.

Proven against the live Pi: the corrected URL form renders a 200 image/png 256×256 tile.

Changes

  • app/live_layers.py: drop @1x from TITILER_COG_TILES; sign_cog_url appends the token verbatim.
  • tests/test_live_layers.py: update the three assertions pinning the old (broken) URL shape.

Verification

  • pytest tests/test_live_layers.py tests/test_api_live_layers.py → 46 passed
  • pytest (full) → 151 passed, 16 skipped
  • Live: curl … /cog/tiles/WebMercatorQuad/8/168/108?url=<signed>&rescale=0,500&colormap_name=cfastiecode=200 size=3197 type=image/png
## Summary Live verification of the merged Sentinel-1 SAR feature exposed two bugs that make every tile request fail, even with the /titiler/ nginx + Tailscale Serve wiring in place: 1. **`@1x` scale suffix breaks TiTiler.** The tile template emitted `/cog/tiles/WebMercatorQuad/{z}/{x}/{y}@1x`, but this TiTiler `latest` image only registers `/tiles/{z}/{x}/{y}` (strict int `y`) and `.{format}` — no `@{scale}x` variant. Every request 422s with `int_parsing` on `21@1x`. 2. **SAS token wrapped under `token=`.** `sign_cog_url` wrote `?token={quote(token)}`, but Azure blob rejects that (403, surfaced by TiTiler as 409). Planetary Computer returns the token as a pre-percent-encoded query string (`st=…&se=…&sp=rl&…&sig=…`); it must be appended top-level. Proven against the live Pi: the corrected URL form renders a 200 `image/png` 256×256 tile. ## Changes - `app/live_layers.py`: drop `@1x` from `TITILER_COG_TILES`; `sign_cog_url` appends the token verbatim. - `tests/test_live_layers.py`: update the three assertions pinning the old (broken) URL shape. ## Verification - `pytest tests/test_live_layers.py tests/test_api_live_layers.py` → 46 passed - `pytest` (full) → 151 passed, 16 skipped - Live: `curl … /cog/tiles/WebMercatorQuad/8/168/108?url=<signed>&rescale=0,500&colormap_name=cfastie` → `code=200 size=3197 type=image/png`
sirius added 1 commit 2026-08-29 11:40:21 -04:00
TiTiler /tiles/{z}/{x}/{y} takes a strict int for y; the @1x scale-suffix
template 422s on every SAR tile request (int_parsing on '21@1x').

sign_cog_url wrapped the Planetary Computer SAS token under a single
token= param, which Azure rejects (403→409); the token is a pre-encoded
query string and must be appended top-level (st=…&se=…&sig=…).

Proven live: correct-form URL renders a 200 image/png 256px tile.
sirius merged commit fc2c7c28c3 into master 2026-08-29 12:13:33 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: sirius/osint-dashboard#24
No description provided.