CAMEL-24291: align host-key checking option metadata with camel-ftp and tidy SCP global/session redundancy - #25263
Conversation
…nd tidy SCP global/session redundancy
Tag the SSH-based host-key options with security="insecure:ssl" for parity with the
SFTP strictHostKeyChecking policy (CAMEL-23404):
- camel-jsch: ScpConfiguration.strictHostKeyChecking
- camel-ssh: SshConfiguration.knownHostsResource and failOnUnknownHost
(failOnUnknownHost carries insecureValue="false", since it is insecure when false)
Remove the contradictory global JSch.setConfig("StrictHostKeyChecking", "yes") in
ScpComponent.initJsch(): it was always overridden per-session by ScpOperations from
ScpConfiguration, so it had no effect other than a misleading default. The per-session
value (default "no", now tagged) governs behaviour; default values are unchanged.
Non-behavioural aside from removing the dead global; regenerates catalog/docs/DSL metadata.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 565 tested, 26 compile-only — current: 562 all testedMaveniverse Scalpel detected 591 affected modules (current approach: 562).
|
gnodet
left a comment
There was a problem hiding this comment.
Claude Code on behalf of Guillaume Nodet
Well-crafted metadata alignment that correctly tags SCP and SSH host-key-checking options with security="insecure:ssl" to match the SFTP pattern from CAMEL-23404. The removal of the dead global JSch.setConfig("StrictHostKeyChecking", "yes") call in ScpComponent is justified — ScpOperations.createSession() always applies the per-session value from ScpConfiguration (default "no"), so the global was always overridden.
Key observations:
- The
insecureValue="false"onfailOnUnknownHostis correctly specified — without it, the default for boolean types would incorrectly flagfailOnUnknownHost=trueas insecure - The SCP
strictHostKeyCheckingannotation is consistent with the SFTPBaseSftpConfigurationfrom CAMEL-23404 - Generated files (catalog JSON, endpoint DSL, component DSL) are properly regenerated and consistent with the annotation changes
- No upgrade guide entry needed since defaults are unchanged and no behavioral changes
- CI is green on both JDK 17 and 25
What
Aligns the SSH-based components' host-key-checking option metadata with the SFTP
strictHostKeyCheckingpolicy introduced in CAMEL-23404, and tidies a contradictory global/session setting in camel-jsch.Metadata parity (
security="insecure:ssl")ScpConfiguration.strictHostKeyChecking(defaultno) is now taggedsecurity="insecure:ssl"with a description, matching SFTP.SshConfiguration.knownHostsResourceandfailOnUnknownHostare now taggedsecurity="insecure:ssl".failOnUnknownHostadditionally carriesinsecureValue="false": it is a boolean that is insecure when false (unknown host keys accepted), so without this the generatedSecurityUtilsenforcement map would default to"true"— the inverted value. This mirrors hownetty-httptagshostnameVerification.SCP global/session tidy
ScpComponent.initJsch()set the JVM-globalJSch.setConfig("StrictHostKeyChecking", "yes"), butScpOperations.createSession()always re-applies the per-session value fromScpConfiguration(defaultno), so the global was dead and contradictory. It has been removed (theJSch.setLoggersetup is kept); the per-session value governs behaviour.Behaviour
Non-behavioural aside from removing the dead global (the session value already won). Default values are unchanged — flipping the insecure defaults would be a separate behavioural change for a future major release with an upgrade-guide entry.
Tests / build
initJsch/createSessionpath).mvn clean install -DskipTestsregenerates catalog/docs/DSL and theSecurityUtilsenforcement map with no drift.Backport
main only — the
insecure:sslsecurity-profile enforcement framework (SecurityUtils) does not exist oncamel-4.18.x/camel-4.14.x, so the tags would have nothing to enforce there.Closes CAMEL-24291.
Claude Code on behalf of Andrea Cosentino (@oscerd)