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

   ## Description
   
   [CAMEL-24973](https://issues.apache.org/jira/browse/CAMEL-24973)
   
   `URISupport.sanitizeUri()` did not always mask option values the way Camel 
parses and binds endpoint URIs. This aligns it with the parser:
   
   - **RAW values**: `RAW(...)` and `RAW{...}` now end at the closing bracket 
followed by `&` or the end of the uri, the same way `URIScanner` parses them, 
instead of at the first closing bracket. When the uri is part of a longer text 
(such as a route label) and there is no such bracket, the value is masked up to 
the last closing bracket.
   - **Userinfo**: the password is matched only in the authority (up to the 
first `/` or `?`, ending at the last `@`, as `normalizeUri` reads it), and 
every uri in the text is sanitized. Before, the match anchored on the last 
`://` in the string, so another uri later in the text caused the wrong segment 
to be replaced.
   - **Option names**: keys are matched ignoring case and dashes, like 
`SensitiveUtils.containsSensitive()`, since options can be configured in dash 
case (for example `access-key`, `connection-string`, `sasl-jaas-config`).
   - **`addSanitizeKeywords()`**: added keywords now apply to every matching 
parameter (it used `replaceFirst`) and are kept across calls, as the javadoc 
says. Empty or built-in-only keywords no longer compile a pattern that matches 
any parameter, and `null` is ignored.
   - New `URISupport.sanitizeParameters(Map)`, used by `DefaultComponent`, 
`ScheduledPollConsumer` and `JettyHttpComponent12` to mask sensitive values in 
their `Unknown parameters=[...]` error messages. The message format is 
unchanged.
   
   Only the masked output changes, so there is no upgrade guide entry.
   
   ## Tests
   
   - `URISupportTest`: new tests for each case above. The existing sanitize 
tests are unchanged and pass.
   - `DefaultComponentTest#testUnknownParametersAreSanitized`.
   
   _Claude Code on behalf of oscerd_
   
   🤖 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