Files
Oleksandr Bezdieniezhnykh 811b04e605 [AZ-777] Phase 1: wire e2e-runner to real satellite-provider + C11 contract adapt
Adapt C11 HttpTileDownloader to the AZ-505 v1.0.0 tile-inventory
contract (POST /api/satellite/tiles/inventory + GET /tiles/{z}/{x}/{y})
and wire the Jetson e2e harness against the real parent-suite
satellite-provider service. Closes Phase 1 of 5 for AZ-777; STOP
gate before Phase 2 (Derkachi catalog seed).

C11 changes:
- _LIST_PATH / _GET_PATH replaced with _INVENTORY_PATH + _TILES_PATH.
- _do_enumerate enumerates bbox tile coords client-side and posts
  chunked inventory requests (5000-entry cap per the contract).
- _download_one_tile parses tile_id_str into (z,x,y) and fetches
  the slippy-map URL.
- Common GET / POST retry+auth ladder consolidated into _send_request.
- New module helpers: _enumerate_bbox_tile_coords,
  _tile_center_latlon, _tile_size_meters_at, _format_tile_id_str,
  _parse_tile_id_str, _chunk_iter.
- _DEFAULT_ESTIMATED_TILE_BYTES (50 KiB) replaces the inventory-side
  estimatedBytes field the v1.0.0 contract dropped.

Tests:
- 14/14 unit tests in tests/unit/c11_tile_manager/test_tile_downloader.py
  rewritten for the new POST inventory + slippy-map GET handler.
  _StubTileWriter rekeyed by call-index (the downloader now derives
  lat/lon from the slippy-map coord, so fixtures can't fabricate
  arbitrary positions).
- New Tier-2 smoke at tests/e2e/satellite_provider/test_smoke.py:
  validates inventory POST schema + drives HttpTileDownloader against
  the real service. Gated by RUN_REPLAY_E2E=1 + tier2.

Compose / env:
- e2e-runner SATELLITE_PROVIDER_URL switched from mock-sat:5100 to
  https://satellite-provider:8080; TLS_INSECURE + Bearer JWT env +
  depends_on satellite-provider added.
- .env.test.example documents SATELLITE_PROVIDER_API_KEY + dev TLS
  bypass security note.
- scripts/mint_dev_jwt.py mints HS256 dev JWTs from env / .env.test.
- pyjwt added to dev extras.

Tracker hygiene:
- AZ-777 row in _dependencies_table.md bumped 5pt -> 8pt to match
  the 2026-05-21 override decision log.

Code review: PASS_WITH_WARNINGS (3 medium/low findings, all deferred
to later AZ-777 phases) -- see batch_104_review.md. Batch report at
batch_104_cycle3_report.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 14:52:39 +03:00

43 lines
2.0 KiB
Bash

# AZ-688: dev-only environment for the Jetson e2e harness.
# Jetson-only test policy (2026-05-20) — see _docs/LESSONS.md.
#
# Copy this file to `.env.test` and customize. NEVER commit `.env.test`
# (gitignored). Sourced by `scripts/run-tests-jetson.sh` before
# `docker compose up`.
# Suite JWT contract — see ../_docs/10_auth.md. The same secret signs the
# dev JWT (AZ-690) and validates it at the satellite-provider boundary.
# MUST be ≥ 32 bytes UTF-8. Generate a fresh value with:
# openssl rand -hex 32
JWT_SECRET=DEV-ONLY-REPLACE-WITH-OPENSSL-RAND-HEX-32-OUTPUT-XXXXXXX
# JWT issuer / audience claims. Dev-only values that ONLY validate against
# the dev secret above. Production deploys MUST use real values provided
# by the admin team (the admin API stamps `iss`; satellite-provider
# validates `aud`).
JWT_ISSUER=DEV-ONLY-iss-admin-azaion-local
JWT_AUDIENCE=DEV-ONLY-aud-satellite-provider
# Google Maps Platform key. Left empty: AZ-689 seeds local fixture tiles
# instead, so the hermetic Derkachi e2e flow never calls GoogleMaps. If
# you need to exercise the real GMaps tile-download path, set this to a
# valid key.
GOOGLE_MAPS_API_KEY=
# AZ-777: Bearer token C11 sends to satellite-provider as
# `Authorization: Bearer <token>`. The token is a JWT signed with
# JWT_SECRET above and stamped with the same iss/aud the provider
# validates. Mint a dev token with:
# python scripts/mint_dev_jwt.py
# Production deploys retrieve this from the admin API and rotate per
# operator session — never commit a real one.
SATELLITE_PROVIDER_API_KEY=PASTE-MINTED-JWT-HERE
# SECURITY: development-only TLS bypass for the parent-suite
# satellite-provider self-signed dev cert. The compose env block sets
# SATELLITE_PROVIDER_TLS_INSECURE=1 — it stays inside the Jetson e2e
# harness, never in production. Production deploys MUST use a real
# CA-issued cert (or your own internal CA) and leave this unset (or
# set to "0"). C11 logs a single WARNING at startup whenever the
# insecure flag is active so the operator can audit it.