This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new cb5068c10ad2 CAMEL-27096: camel-main - document
camel.vault.cyberark.verifySsl with default true and as insecure:ssl (#30732)
cb5068c10ad2 is described below
commit cb5068c10ad28a0bea2a8386ad5ee70b885e9f9e
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Nov 25 08:09:33 2026 +0100
CAMEL-27096: camel-main - document camel.vault.cyberark.verifySsl with
default true and as insecure:ssl (#30732)
The verifySsl field of CyberArkVaultConfiguration defaults to true, but its
bare
@Metadata made the camel-main metadata document it with default false. Mark
it with
defaultValue = "true", security = "insecure:ssl" and insecureValue =
"false".
PrepareCamelMainMojo now reads insecureValue from @Metadata (and from the
bean JSON of
the cluster services), so the camel-main metadata and the SECURITY-KEYS of
SecurityUtils get the insecure value false instead of the boolean default
true.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
---
.../resources/org/apache/camel/catalog/docs/main.adoc | 2 +-
.../catalog/main/camel-main-configuration-metadata.json | 2 +-
.../apache/camel/vault/CyberArkVaultConfiguration.java | 2 +-
.../META-INF/camel-main-configuration-metadata.json | 2 +-
core/camel-main/src/main/docs/main.adoc | 2 +-
.../main/java/org/apache/camel/util/SecurityUtils.java | 1 +
.../java/org/apache/camel/util/SecurityUtilsTest.java | 3 +++
.../camel/maven/packaging/PrepareCamelMainMojo.java | 4 ++++
.../org/apache/camel/maven/packaging/MyConfiguration.java | 15 +++++++++++++++
.../camel/maven/packaging/PrepareCamelMainMojoTest.java | 10 +++++++++-
10 files changed, 37 insertions(+), 6 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc
index 47af761426e2..b4e0df816141 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc
@@ -611,7 +611,7 @@ The camel.vault.cyberark supports 9 options, which are
listed below.
| `camel.vault.cyberark.secrets` | Specify the secret names (or pattern) to
check for updates. Multiple secrets can be separated by comma. | | String
| `camel.vault.cyberark.url` | The CyberArk Conjur instance URL | | String
| `camel.vault.cyberark.username` | The username for authentication | | String
-| `camel.vault.cyberark.verifySsl` | Whether to verify SSL certificates |
false | boolean
+| `camel.vault.cyberark.verifySsl` | Whether to verify SSL certificates | true
| boolean
|===
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
index 12014cfc0295..fcb1616865d5 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
@@ -591,7 +591,7 @@
{ "name": "camel.vault.cyberark.secrets", "required": false,
"description": "Specify the secret names (or pattern) to check for updates.
Multiple secrets can be separated by comma.", "sourceType":
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string",
"javaType": "java.lang.String", "secret": false },
{ "name": "camel.vault.cyberark.url", "required": true, "description":
"The CyberArk Conjur instance URL", "sourceType":
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string",
"javaType": "java.lang.String", "secret": false },
{ "name": "camel.vault.cyberark.username", "required": false,
"description": "The username for authentication", "sourceType":
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string",
"javaType": "java.lang.String", "secret": true, "security": "secret" },
- { "name": "camel.vault.cyberark.verifySsl", "required": false,
"description": "Whether to verify SSL certificates", "sourceType":
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "boolean",
"javaType": "boolean", "defaultValue": false, "secret": false },
+ { "name": "camel.vault.cyberark.verifySsl", "required": false,
"description": "Whether to verify SSL certificates", "sourceType":
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "boolean",
"javaType": "boolean", "defaultValue": true, "secret": false, "security":
"insecure:ssl", "insecureValue": "false" },
{ "name": "camel.vault.gcp.projectId", "required": true, "description":
"The GCP Project ID", "sourceType":
"org.apache.camel.vault.GcpVaultConfiguration", "type": "string", "javaType":
"java.lang.String", "secret": false },
{ "name": "camel.vault.gcp.refreshEnabled", "required": false,
"description": "Whether to automatically reload Camel upon secrets being
updated in GCP.", "sourceType": "org.apache.camel.vault.GcpVaultConfiguration",
"type": "boolean", "javaType": "boolean", "defaultValue": false, "secret":
false },
{ "name": "camel.vault.gcp.refreshPeriod", "required": false,
"description": "The period (millis) between checking Google for updated
secrets.", "sourceType": "org.apache.camel.vault.GcpVaultConfiguration",
"type": "integer", "javaType": "long", "defaultValue": 30000, "secret": false },
diff --git
a/core/camel-api/src/main/java/org/apache/camel/vault/CyberArkVaultConfiguration.java
b/core/camel-api/src/main/java/org/apache/camel/vault/CyberArkVaultConfiguration.java
index 9f0c08c11101..beffc5cc4fae 100644
---
a/core/camel-api/src/main/java/org/apache/camel/vault/CyberArkVaultConfiguration.java
+++
b/core/camel-api/src/main/java/org/apache/camel/vault/CyberArkVaultConfiguration.java
@@ -38,7 +38,7 @@ public class CyberArkVaultConfiguration extends
VaultConfiguration {
private @Nullable String apiKey;
@Metadata(security = "secret")
private @Nullable String authToken;
- @Metadata
+ @Metadata(defaultValue = "true", security = "insecure:ssl", insecureValue
= "false")
private boolean verifySsl = true;
@Metadata
private @Nullable String certificatePath;
diff --git
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
index 12014cfc0295..fcb1616865d5 100644
---
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
+++
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
@@ -591,7 +591,7 @@
{ "name": "camel.vault.cyberark.secrets", "required": false,
"description": "Specify the secret names (or pattern) to check for updates.
Multiple secrets can be separated by comma.", "sourceType":
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string",
"javaType": "java.lang.String", "secret": false },
{ "name": "camel.vault.cyberark.url", "required": true, "description":
"The CyberArk Conjur instance URL", "sourceType":
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string",
"javaType": "java.lang.String", "secret": false },
{ "name": "camel.vault.cyberark.username", "required": false,
"description": "The username for authentication", "sourceType":
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "string",
"javaType": "java.lang.String", "secret": true, "security": "secret" },
- { "name": "camel.vault.cyberark.verifySsl", "required": false,
"description": "Whether to verify SSL certificates", "sourceType":
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "boolean",
"javaType": "boolean", "defaultValue": false, "secret": false },
+ { "name": "camel.vault.cyberark.verifySsl", "required": false,
"description": "Whether to verify SSL certificates", "sourceType":
"org.apache.camel.vault.CyberArkVaultConfiguration", "type": "boolean",
"javaType": "boolean", "defaultValue": true, "secret": false, "security":
"insecure:ssl", "insecureValue": "false" },
{ "name": "camel.vault.gcp.projectId", "required": true, "description":
"The GCP Project ID", "sourceType":
"org.apache.camel.vault.GcpVaultConfiguration", "type": "string", "javaType":
"java.lang.String", "secret": false },
{ "name": "camel.vault.gcp.refreshEnabled", "required": false,
"description": "Whether to automatically reload Camel upon secrets being
updated in GCP.", "sourceType": "org.apache.camel.vault.GcpVaultConfiguration",
"type": "boolean", "javaType": "boolean", "defaultValue": false, "secret":
false },
{ "name": "camel.vault.gcp.refreshPeriod", "required": false,
"description": "The period (millis) between checking Google for updated
secrets.", "sourceType": "org.apache.camel.vault.GcpVaultConfiguration",
"type": "integer", "javaType": "long", "defaultValue": 30000, "secret": false },
diff --git a/core/camel-main/src/main/docs/main.adoc
b/core/camel-main/src/main/docs/main.adoc
index 47af761426e2..b4e0df816141 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -611,7 +611,7 @@ The camel.vault.cyberark supports 9 options, which are
listed below.
| `camel.vault.cyberark.secrets` | Specify the secret names (or pattern) to
check for updates. Multiple secrets can be separated by comma. | | String
| `camel.vault.cyberark.url` | The CyberArk Conjur instance URL | | String
| `camel.vault.cyberark.username` | The username for authentication | | String
-| `camel.vault.cyberark.verifySsl` | Whether to verify SSL certificates |
false | boolean
+| `camel.vault.cyberark.verifySsl` | Whether to verify SSL certificates | true
| boolean
|===
diff --git
a/core/camel-util/src/main/java/org/apache/camel/util/SecurityUtils.java
b/core/camel-util/src/main/java/org/apache/camel/util/SecurityUtils.java
index 222378347bfb..abe98c559b63 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/SecurityUtils.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/SecurityUtils.java
@@ -377,6 +377,7 @@ public final class SecurityUtils {
keys.put("camel.management.uploadenabled", new
SecurityOption(INSECURE_DEV, "true"));
keys.put("camel.server.jwtallowmissingissuerandaudience", new
SecurityOption(INSECURE_DEV, "true"));
keys.put("camel.ssl.trustallcertificates", new
SecurityOption(INSECURE_SSL, "true"));
+ keys.put("camel.vault.cyberark.verifyssl", new
SecurityOption(INSECURE_SSL, VALUE_FALSE));
// SECURITY-KEYS: END
SECURITY_KEYS = Collections.unmodifiableMap(keys);
}
diff --git
a/core/camel-util/src/test/java/org/apache/camel/util/SecurityUtilsTest.java
b/core/camel-util/src/test/java/org/apache/camel/util/SecurityUtilsTest.java
index cbe43a2d7e79..c5ec6f6a9f7d 100644
--- a/core/camel-util/src/test/java/org/apache/camel/util/SecurityUtilsTest.java
+++ b/core/camel-util/src/test/java/org/apache/camel/util/SecurityUtilsTest.java
@@ -66,6 +66,9 @@ class SecurityUtilsTest {
// camel-kubernetes trustCerts=true disables certificate verification
(CAMEL-25413)
assertTrue(SecurityUtils.isInsecureValue("camel.component.kubernetes-pods.trustCerts",
true));
assertFalse(SecurityUtils.isInsecureValue("camel.component.kubernetes-pods.trustCerts",
false));
+ // camel.vault.cyberark.verifySsl=false disables certificate
verification (CAMEL-27096)
+
assertTrue(SecurityUtils.isInsecureValue("camel.vault.cyberark.verifySsl",
false));
+
assertFalse(SecurityUtils.isInsecureValue("camel.vault.cyberark.verifySsl",
true));
}
@Test
diff --git
a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCamelMainMojo.java
b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCamelMainMojo.java
index 68b375b0e5aa..65e6b7f4c9f6 100644
---
a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCamelMainMojo.java
+++
b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCamelMainMojo.java
@@ -94,11 +94,13 @@ public class PrepareCamelMainMojo extends
AbstractGeneratorMojo {
boolean secret = false;
boolean required = false;
String security = null;
+ String insecureValue = null;
if (as != null) {
defaultValue = as.getStringValue("defaultValue");
secret = "true".equals(as.getStringValue("secret"));
required = "true".equals(as.getStringValue("required"));
security = as.getStringValue("security");
+ insecureValue = as.getStringValue("insecureValue");
if ("secret".equals(security) && !secret) {
secret = true;
}
@@ -124,6 +126,7 @@ public class PrepareCamelMainMojo extends
AbstractGeneratorMojo {
model.setSecret(secret);
model.setRequired(required);
model.setSecurity(security);
+ model.setInsecureValue(insecureValue);
List<String> enums = null;
// add known enums
if ("org.apache.camel.LoggingLevel".equals(javaType)) {
@@ -201,6 +204,7 @@ public class PrepareCamelMainMojo extends
AbstractGeneratorMojo {
String security = prop.getString("security");
if (security != null) {
model.setSecurity(security);
+ model.setInsecureValue(prop.getString("insecureValue"));
if ("secret".equals(security) && !model.isSecret()) {
model.setSecret(true);
}
diff --git
a/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/MyConfiguration.java
b/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/MyConfiguration.java
index 4dda6b3c6ace..69a379f8e54e 100644
---
a/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/MyConfiguration.java
+++
b/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/MyConfiguration.java
@@ -16,6 +16,8 @@
*/
package org.apache.camel.maven.packaging;
+import org.apache.camel.spi.Metadata;
+
/**
* Common set of configuration options used by Camel Main, Camel Spring Boot
and other runtimes.
*/
@@ -60,6 +62,8 @@ public class MyConfiguration {
private String threadNamePattern;
private String routeFilterIncludePattern;
private String routeFilterExcludePattern;
+ @Metadata(defaultValue = "true", security = "insecure:ssl", insecureValue
= "false")
+ private boolean verifySsl = true;
// getter and setters
// --------------------------------------------------------------
@@ -538,4 +542,15 @@ public class MyConfiguration {
this.routeFilterExcludePattern = exclude;
}
+ public boolean isVerifySsl() {
+ return verifySsl;
+ }
+
+ /**
+ * Whether to verify SSL certificates
+ */
+ public void setVerifySsl(boolean verifySsl) {
+ this.verifySsl = verifySsl;
+ }
+
}
diff --git
a/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/PrepareCamelMainMojoTest.java
b/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/PrepareCamelMainMojoTest.java
index 3f7d59e47b52..8dea668e1e78 100644
---
a/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/PrepareCamelMainMojoTest.java
+++
b/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/PrepareCamelMainMojoTest.java
@@ -34,7 +34,7 @@ public class PrepareCamelMainMojoTest {
List<MainModel.MainOptionModel> list =
PrepareCamelMainMojo.parseConfigurationSource(fileName);
assertNotNull(list);
- assertEquals(39, list.size());
+ assertEquals(40, list.size());
assertEquals("name", list.get(0).getName());
assertEquals("java.lang.String", list.get(0).getJavaType());
@@ -49,5 +49,13 @@ public class PrepareCamelMainMojoTest {
assertEquals("tracing", list.get(25).getName());
assertEquals("boolean", list.get(25).getJavaType());
assertTrue(list.get(25).isDeprecated());
+
+ // the default, security category and insecure value come from
@Metadata
+ MainModel.MainOptionModel verifySsl = list.get(39);
+ assertEquals("verifySsl", verifySsl.getName());
+ assertEquals("boolean", verifySsl.getType());
+ assertEquals(true, verifySsl.getDefaultValue());
+ assertEquals("insecure:ssl", verifySsl.getSecurity());
+ assertEquals("false", verifySsl.getInsecureValue());
}
}