Skip to content

Open-Meteo transport errors carry coordinates into the log #133

Description

@prorochestvo

internal/infrastructure/weather/openmeteo.go's attempt deliberately strips the query
string from the status-code error, with the reason written in the code: to keep latitude and
longitude out of the logs. The transport-failure branch alongside it does not. It wraps the
*url.Error returned by httpClient.Do, whose Error() embeds the full URL:

Get "https://api.open-meteo.com/v1/forecast?...&latitude=51.169392&longitude=71.449074...": dial tcp: i/o timeout

Every caller that prints that error with %v therefore logs the coordinates. There are now
three call sites: Forecast, Geocode (which additionally carries the search term), and
ForecastRange.

This is hygiene rather than a policy breach — city coordinates are pre-approved data under
the beacon-data-privacy skill, and the line carries no user identifier — but it defeats an
intent the code states out loud, and it defeats it in three places.

Direction: redact inside attempt's transport branch, rewriting (*url.Error).URL to
host plus path before wrapping, so every caller inherits the same guarantee the status-code
branch already gives.

Found by review of #127 (P3, pre-existing, out of that PR's scope).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions