davsclaus opened a new pull request, #31022:
URL: https://github.com/apache/camel/pull/31022

   JIRA: https://issues.apache.org/jira/browse/CAMEL-27664
   
   ## What was wrong
   
   `appid` (the OpenWeatherMap API key) is a secret option, but 
`WeatherQuery.getQuery()` appends it as `&APPID=<appid>`
   to the request URL, and that URL showed up in plain text in:
   
   - the `CamelWeatherQuery` header, set by both the consumer and the producer, 
which travels with the message to the next
     endpoints, tracers and the message history;
   - the DEBUG log ("Going to execute the Weather query ...") and the WARN log 
of the consumer for a bad HTTP status;
   - the message of the exception the producer throws for a bad HTTP status or 
an empty response.
   
   ## What changed
   
   - `WeatherQuery.sanitize(String)` masks the value of the `APPID` parameter 
as `xxxxxx` (case-insensitive, so an
     `appid=` that a `CamelWeatherLocation` header adds is masked too).
   - `WeatherConsumer` and `WeatherProducer` still send the real URL, but use 
the masked one for the header, the logs and
     the error messages.
   - The header description says the value is masked (regenerated component 
JSON, catalog copy and endpoint DSL).
   - Upgrade guide 4.24: a short note that the header value changes.
   
   ## Tests
   
   `WeatherAppidMaskedTest` (mocked `HttpClient`, no network): the producer 
header, a location header that carries an
   `appid`, the producer error message, the consumer header, and `sanitize` 
itself. The four header/error tests fail
   without the change in the consumer and the producer. All tests of the module 
pass.
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to