Skip to content

fix(overpass): send OVERPASS_URL credentials as Basic auth - #686

Merged
Medformatik merged 1 commit into
fix/overpass-health-follows-instancefrom
fix/overpass-url-credentials
Oct 30, 2026
Merged

Medformatik merged 1 commit into
fix/overpass-health-follows-instancefrom
fix/overpass-url-credentials

Conversation

@Medformatik

Copy link
Copy Markdown
Collaborator

What changed and why

Stacked on #685, whose core helper it reuses; the diff against #685's branch is this one commit.

An operator can point OpenMapX at a hosted Overpass with OVERPASS_URL, including one that needs a login (https://user:pass@host). Every query to such an instance failed. Node's fetch refuses a URL that carries credentials, throwing Request cannot be constructed from a URL that includes credentials: https://user:pass@host/…, so the password also ended up in the error.

The Overpass client now sends such credentials as a Basic Authorization header and queries the URL without them, through the same urlCredentialsAsBasicAuth helper the health checks use since #685. Attribution keeps resolving from the host, now taken from the URL without credentials. Instances without credentials are unaffected.

Verification

  • Query test: a query to an OVERPASS_URL with credentials goes to https://overpass.example.org/api/interpreter with Authorization: Basic … for those credentials. The existing Overpass client tests still pass, including the public-mirror fallback.
  • Node behaviour: I confirmed that fetch("https://u:p@example.com") throws the error quoted above.
  • Repository checks: pnpm lint, pnpm check-types and pnpm check:policy pass. The full Vitest suite passes (1,953 files, 24,087 tests) except motis-probe.test.ts's socket-retry test. That test is flaky: it failed 1 of 5 isolated reruns on this same code, and it drives a real socket through node:http in the data manager, which this change doesn't touch.
  • Not run: a query against a real credential-protected Overpass instance; none is configured anywhere I can reach.

Release and upgrade impact

Product impact: ordinary

No package release: the change is limited to the Overpass client in the private @openmapx/core package; neither published package's source changes in this commit.

@Medformatik Medformatik added the integration New or changed provider, source or backend integration label Oct 30, 2026
@Medformatik Medformatik self-assigned this Oct 30, 2026
fetch refuses a URL carrying credentials, so queries to an OVERPASS_URL
like https://user:pass@host always failed, with the password in the error.
Send them as an Authorization header through the shared core helper.
@Medformatik
Medformatik force-pushed the fix/overpass-url-credentials branch from 52c8211 to 58f471c Compare October 30, 2026 09:49
@Medformatik
Medformatik merged commit c245756 into fix/overpass-health-follows-instance Oct 30, 2026
25 checks passed
@Medformatik
Medformatik deleted the fix/overpass-url-credentials branch October 30, 2026 10:00
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

integration New or changed provider, source or backend integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant