oscerd commented on PR #25093:
URL: https://github.com/apache/camel/pull/25093#issuecomment-5070047390

   Thanks @davsclaus, good call. Reworked to reuse Camel's own secret knowledge 
instead of a hand-rolled regex:
   
   - **Structured (`JsonObject`) results** are now redacted by key name with 
`SensitiveUtils.containsSensitive(...)`, the same helper the jbang 
`ListProperties` command already uses. This is the important path, since the 
runtime tools (e.g. `camel_runtime_properties`) return a `JsonObject`.
   - **Free-text results** go through `DefaultMaskingFormatter`, which masks 
key=value, XML and JSON values off `SensitiveUtils.getSensitiveKeys()`.
   - Removed the hand-maintained `DEFAULT_PATTERNS` and `SECRET_KEY_NAME`. 
Operator-supplied custom patterns (`camel.mcp.security.redaction.patterns`) 
still apply on top.
   
   One consequence worth flagging: the two format-only cases I had (a 
`mongodb://user:pass@host` userinfo credential and PEM private-key blocks) are 
no longer special-cased, since `SensitiveUtils`/`DefaultMaskingFormatter` key 
off names rather than value shapes. The `?password=` query-parameter form is 
still caught (it is key=value). If the userinfo/PEM shapes are worth covering, 
that feels like it belongs in `SensitiveUtils`/`DefaultMaskingFormatter` 
project-wide rather than here; happy to open a separate issue if you agree.
   
   Tests updated to the canonical behaviour (30 green in the module). Still 
draft while I settle the record-returning-tools follow-up noted in the 
description.
   
   _Claude Code on behalf of Andrea Cosentino (@oscerd)._
   


-- 
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