fix: authenticate the CARTO basemaps with the suite key - #22
Merged
Conversation
added 2 commits
August 28, 2026 23:07
CARTO began watermarking unauthenticated basemaps.cartocdn.com raster
tiles with "API KEY REQUIRED" on 2026-08-26, so both maps here — the
national site-picker and the theme-aware Biogeography map — render
defaced. The tile request still returns HTTP 200 with a valid PNG, so
nothing errors or logs; full suite diagnosis lives in NEON-Driver-Cascade
docs/SUITE-BASEMAP-INCIDENT-2026-08.md.
Adds an add_suite_basemap() helper to global.R and routes both call
sites through it. With CARTO_BASEMAP_KEY set (a Connect Cloud content
variable), it serves the exact same Positron and Dark Matter tiles as
before, keyed, via addTiles() — addProviderTiles() cannot carry the key
because the bundled CartoDB template has no {apikey} placeholder. The
key is a public rate-limited identifier, not a credential: it rides in
the client-side tile URL by design, and the env var exists to keep it
out of git and make rotation a Connect setting rather than a release.
Without the key the helper falls back to Esri's keyless grey canvas
(light and dark variants) so the map degrades to a clean basemap rather
than a defaced one; the fallback is capped at its real maxNativeZoom of
16 because the canvas has no content past that at rural NEON sites.
The theme toggle keeps working unchanged: dark mode now selects the
dark_all variant through the same helper.
manifest.json is intentionally not touched in this commit — it is
regenerated in the pinned CI validator per AGENTS.md rule 2, and the
validated candidate artifact from that run lands in the follow-up
commit.
Exact bytes of the "ground-beetle-manifest-be9fde1e" validated candidate artifact from CI run 33219364063: regenerated by write_manifest.R in the pinned validator, passed verify_bundle.R and the offline app source, and uploaded before the byte gate stopped the run. Carries the new checksums for global.R, R/map_picker.R and server.R, plus the runner's current package Built timestamps. Generated in the pinned validator per AGENTS.md rule 2 — not edited by hand.
tgilbert14
marked this pull request as ready for review
August 28, 2026 23:47
This was referenced Aug 29, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Canary PR — first of nine. CARTO began watermarking unauthenticated
basemaps.cartocdn.comraster tiles with "API KEY REQUIRED" on 2026-08-26, so both maps here — the national site-picker and the theme-aware Biogeography map — render defaced. The request still returnsHTTP 200with a valid PNG, so nothing errored or logged. Full suite diagnosis:docs/SUITE-BASEMAP-INCIDENT-2026-08.mdin NEON-Driver-Cascade and tgilbert14/NEON-Driver-Cascade#70.How
Adds
add_suite_basemap()toglobal.Rand routes both call sites through it (R/map_picker.R:57,server.R:1633-1634):CARTO_BASEMAP_KEYset (Connect Cloud content variable, already issued by CARTO and verified against live tiles): the exact same Positron / Dark Matter tiles as before, keyed.addProviderTiles()cannot carry the key — the bundled CartoDB template has no{apikey}placeholder — so it is a rawaddTiles()with explicit OpenStreetMap + CARTO attribution.maxNativeZoom = 16because that canvas has no content past z16 at rural NEON sites.is_dark()now selectsdark_allthrough the same helper.The key is a public, rate-limited identifier, not a credential — it rides in the client-side tile URL by design (CARTO's terms ban server-side proxying). The env var keeps it out of git and makes rotation a Connect setting rather than a release.
Manifest
manifest.jsonis intentionally untouched in the first commit — AGENTS.md rule 2 says never edit it by hand, and this repo has noregenerate-manifest.ymldispatch workflow. The first CI run regenerates it in the pinned validator and uploads the validated manifest candidate artifact; the follow-up commit lands exactly those bytes. Expect the first run red at "Require committed generated bytes to match" — that is the plan working, not a failure of the patch.Before merging (owner)
CARTO_BASEMAP_KEYwith the key CARTO emailed (startscb1_…). Until it is set, the deployed app shows the clean Esri fallback rather than CARTO.Verified
light_allanddark_all, and on the previously-cached watermarked picker zooms (the CDN caches keyed responses separately).grep -E 'CartoDB[."$]|cartocdn'across the repo: no unkeyed CARTO reference remains.git diff --checkclean; helper parens/braces balanced. No R interpreter was available in the patch environment, so CI's offline-source step is the syntax gate.🤖 Generated with Claude Code
https://claude.ai/code/session_01738HeGPEU9NEoczL8RXnu1
Generated by Claude Code