#172 (add-on): the CLMS provider — unblock Greece's cover (R142) #177
No reviewers
Labels
No labels
blocked
claude-wip
map-report
map:is
map:se
needs-review
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
art/ismap!177
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-172-clms-fetcher"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-on to the #172 pilot PR (#176): the pilot's one blocked item was the CORINE cover
download, because the old EIONET static URLs are dead and the only official route is the
CLMS download API, which needs a Bearer token the importer's plain-GET
downloads:mechanism cannot supply. This PR lands the token-minting provider that unblocks it — and
then actually fetched and imported the data.
What changed
importer/clms.go— a new provider fetcher, the project's first OAuth2 JWT-bearerclient-credentials flow (R142). Reads the CLMS service key from a
clms:block inconf/secrets.yaml, signs an RS256 JWT grant (stdlib crypto — no new dependency),exchanges it at
@@oauth2-tokenfor a Bearer token, POSTs the Greece crop to@datarequest_post, polls@datarequest_status_getto completion, and downloads the.gpkg. Wired intofetch/list,appConfig,include.goand the import fetch phasealongside geotorget/lastkajen/trafiklab. The token is re-minted on demand rather than
held for the life of the fetch.
importer/clms_test.go— seven tests against localhttptestservers: the JWT-bearergrant (iss/sub/aud claims, grant type,
expires_in), missing-credential and bad-keyrejection, the
Queued → In_progress → Finished_okpoll transition, terminal failure, andtoken re-minting.
conf/gr/downloads.yaml— CORINE moves from a blocked plaindownloads:entry to aclms:block, with the full register/configure instructions.conf/gr/base.yaml— declaressecrets_file: conf/secrets.yaml.conf/gr/acceptance.yaml— R105 now coversgr_clcas well asgr_perifereies.conf/gr/staging.yaml,conf/gr/02-cover.yaml— the real layer name and column casingfrom the delivered file.
fetch-grrunsimporter fetch conf/gr clmsafter the boundary fetch, andthat fetch runs under
umask 002for the shared data tree.conf/secrets.example.yaml— theclms:block, and the EU Login + CLMS tokenregistration (the private key is shown once and is unrecoverable).
docs/country-requirements.md— new R142: token-minting providers are importerfetchers, never a key in config or a URL; CLMS is the reference.
docs/importer-cli.md— theclmsprovider on both thefetchandlistlines.Verification
The live download ran, and the cover is imported. (An earlier revision of this
description said it had not — that was written before the credential was in place and was
never updated. Corrected here.)
data/gr/clc_gr.gpkg— 169 MB, fetched2026-08-20T00:49:30Zfromcopernicus-fme.eea.europa.euthrough the provider, not by hand.gr_clcstaging: 49 056 rows, 0 NULLcode_18.map_cover_*_grbuilt at all 11 zooms; z13 holds 49 844 rows, 0 NULLcover_class,42 distinct classes — including the Mediterranean ones Finland never sees
(
olive_grove,sclerophyllous,vineyard,rice_fields,salt_marsh).importer acceptance conf/gr— 28/28 pass, including R34 gapless at 0.75%(cover 131 042 km² vs territory 132 029 km²), R120 no-NULL, and R105 now reporting
tables=2where it reportedtables=1.go build ./...,go vet ./...,go test ./...green; the seven CLMS tests all pass.Field fixes found by running it
EL.GRis accepted by the API andthen fails the task with "no data for the selected Area Of Interest".
Queued, which a freshtask returns before
In_progress. Only terminal statuses error now.Code_18; the staging loader lowercases it, sothe query reads
code_18unquoted. Layer name isU2018_CLC2018_V2020_20u1, not theassumed
clc2018_gr.Review fixes in the last commit
R105 widened to
gr_clc(#181); the access token re-mints instead of being held for thewhole fetch (a raised
poll_timeout_secondswould have 401-ed mid-poll); deadclmsCredsstruct removed; hand-rolled
urlEncodereplaced withurl.Values.Encode;docs/importer-cli.md'slistline corrected.Left undone
docs/country-gr.md's CORINE caveat still described this as a blocker — that is fixed in#183, which also corrects the catalogue's
NUTS "GR"and its roads/rail verdicts.Rebased onto
issue-172-greece-pilotafter that branch took its own review fixes.980ff9fec6to0fa53f7ed00fa53f7ed0toc8cce66978d47319ed4fto87b030702c87b030702cto2f321a4d5c2f321a4d5ctocd6b2d5834cd6b2d5834toce3688967a