Skip to content

chore: improve PomSanitizer detection and robustness#23332

Merged
gnodet merged 1 commit into
apache:mainfrom
gnodet:chore/improve-pom-sanitizer
May 20, 2026
Merged

chore: improve PomSanitizer detection and robustness#23332
gnodet merged 1 commit into
apache:mainfrom
gnodet:chore/improve-pom-sanitizer

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented May 19, 2026

Summary

Improve PomSanitizer in camel-jbang-mcp to close detection gaps and simplify internals:

  • CDATA support: values wrapped in <![CDATA[...]]> were previously invisible to detection — now inspected and masked
  • Camel placeholder recognition: {{vault:...}} and {{...}} placeholders are preserved alongside Maven ${...}
  • URL-embedded credentials: new pattern detects ://user:password@host in any element (catches JDBC URLs, HTTP basic auth in non-sensitive-named elements like <db.url>)
  • Additional keywords: connection-string, connectionstring, connection_string
  • Single-pass processing: merged the separate detection and masking regex passes into one
  • Minor cleanup: String.join replaces Collectors.joining, removed unused import

12 new test cases covering all additions.

Test plan

  • mvn test -Dtest=PomSanitizerTest — all 30 tests pass
  • Verify no regressions in existing MCP tool behavior

Claude Code on behalf of Guillaume Nodet

- Handle CDATA-wrapped values (previously bypassed detection entirely)
- Recognize Camel property placeholders ({{...}}) in addition to Maven ${...}
- Detect URL-embedded credentials (://user:password@host) in any element
- Add connection-string/connectionstring/connection_string keywords
- Merge detection and masking into a single regex pass
- Replace Collectors.joining with String.join

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet requested review from Croway and oscerd May 19, 2026 16:21
@github-actions
Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions Bot added the dsl label May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • dsl/camel-jbang/camel-jbang-mcp

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • dsl/camel-jbang/camel-jbang-mcp: 1 test(s) disabled on GitHub Actions

⚙️ View full build and test results

@gnodet gnodet merged commit 6efd318 into apache:main May 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants