You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2024/05/22 09:59:48 UTC
(camel) 01/01: CAMEL-20795 - camel-nats - NATS Credential file support
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch CAMEL-20795
in repository https://gitbox.apache.org/repos/asf/camel.git
commit c971ca067f70232cba0738186d9df90f528a698c
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed May 22 11:58:53 2024 +0200
CAMEL-20795 - camel-nats - NATS Credential file support
Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
.../org/apache/camel/catalog/components/nats.json | 6 +-
.../component/nats/NatsEndpointConfigurer.java | 12 ++
.../component/nats/NatsEndpointUriFactory.java | 4 +-
.../org/apache/camel/component/nats/nats.json | 6 +-
.../camel/component/nats/NatsConfiguration.java | 29 +++++
.../apache/camel/component/nats/NatsEndpoint.java | 9 ++
.../endpoint/dsl/NatsEndpointBuilderFactory.java | 141 +++++++++++++++++++++
.../apache/camel/kotlin/components/NatsUriDsl.kt | 23 ++++
8 files changed, 225 insertions(+), 5 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/nats.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/nats.json
index 3ae2ae4049c..c226db67603 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/nats.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/nats.json
@@ -67,7 +67,9 @@
"connection": { "index": 25, "kind": "parameter", "displayName": "Connection", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "io.nats.client.Connection", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "Reference an already instantiated connection to Nats server" },
"headerFilterStrategy": { "index": 26, "kind": "parameter", "displayName": "Header Filter Strategy", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "Define the header filtering strategy" },
"traceConnection": { "index": 27, "kind": "parameter", "displayName": "Trace Connection", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "Whether or not connection trace messages should be printed to standard out for fine [...]
- "secure": { "index": 28, "kind": "parameter", "displayName": "Secure", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "Set secure option indicating TLS is required" },
- "sslContextParameters": { "index": 29, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters" }
+ "credentialsFilePath": { "index": 28, "kind": "parameter", "displayName": "Credentials File Path", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "If we use useCredentialsFile to true we'll need to set the credentialsFilePath option. It [...]
+ "secure": { "index": 29, "kind": "parameter", "displayName": "Secure", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "Set secure option indicating TLS is required" },
+ "sslContextParameters": { "index": 30, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters" },
+ "useCredentialsFile": { "index": 31, "kind": "parameter", "displayName": "Use Credentials File", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "Determine if we are going to use a credentials file or not" }
}
}
diff --git a/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointConfigurer.java b/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointConfigurer.java
index 1e60bd06f4a..5159309771a 100644
--- a/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointConfigurer.java
+++ b/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointConfigurer.java
@@ -28,6 +28,8 @@ public class NatsEndpointConfigurer extends PropertyConfigurerSupport implements
case "connection": target.getConfiguration().setConnection(property(camelContext, io.nats.client.Connection.class, value)); return true;
case "connectiontimeout":
case "connectionTimeout": target.getConfiguration().setConnectionTimeout(property(camelContext, int.class, value)); return true;
+ case "credentialsfilepath":
+ case "credentialsFilePath": target.getConfiguration().setCredentialsFilePath(property(camelContext, java.lang.String.class, value)); return true;
case "exceptionhandler":
case "exceptionHandler": target.setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true;
case "exchangepattern":
@@ -74,6 +76,8 @@ public class NatsEndpointConfigurer extends PropertyConfigurerSupport implements
case "sslContextParameters": target.getConfiguration().setSslContextParameters(property(camelContext, org.apache.camel.support.jsse.SSLContextParameters.class, value)); return true;
case "traceconnection":
case "traceConnection": target.getConfiguration().setTraceConnection(property(camelContext, boolean.class, value)); return true;
+ case "usecredentialsfile":
+ case "useCredentialsFile": target.getConfiguration().setUseCredentialsFile(property(camelContext, boolean.class, value)); return true;
case "verbose": target.getConfiguration().setVerbose(property(camelContext, boolean.class, value)); return true;
default: return false;
}
@@ -87,6 +91,8 @@ public class NatsEndpointConfigurer extends PropertyConfigurerSupport implements
case "connection": return io.nats.client.Connection.class;
case "connectiontimeout":
case "connectionTimeout": return int.class;
+ case "credentialsfilepath":
+ case "credentialsFilePath": return java.lang.String.class;
case "exceptionhandler":
case "exceptionHandler": return org.apache.camel.spi.ExceptionHandler.class;
case "exchangepattern":
@@ -133,6 +139,8 @@ public class NatsEndpointConfigurer extends PropertyConfigurerSupport implements
case "sslContextParameters": return org.apache.camel.support.jsse.SSLContextParameters.class;
case "traceconnection":
case "traceConnection": return boolean.class;
+ case "usecredentialsfile":
+ case "useCredentialsFile": return boolean.class;
case "verbose": return boolean.class;
default: return null;
}
@@ -147,6 +155,8 @@ public class NatsEndpointConfigurer extends PropertyConfigurerSupport implements
case "connection": return target.getConfiguration().getConnection();
case "connectiontimeout":
case "connectionTimeout": return target.getConfiguration().getConnectionTimeout();
+ case "credentialsfilepath":
+ case "credentialsFilePath": return target.getConfiguration().getCredentialsFilePath();
case "exceptionhandler":
case "exceptionHandler": return target.getExceptionHandler();
case "exchangepattern":
@@ -193,6 +203,8 @@ public class NatsEndpointConfigurer extends PropertyConfigurerSupport implements
case "sslContextParameters": return target.getConfiguration().getSslContextParameters();
case "traceconnection":
case "traceConnection": return target.getConfiguration().isTraceConnection();
+ case "usecredentialsfile":
+ case "useCredentialsFile": return target.getConfiguration().isUseCredentialsFile();
case "verbose": return target.getConfiguration().isVerbose();
default: return null;
}
diff --git a/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointUriFactory.java b/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointUriFactory.java
index 6d61e236881..8aaebc88eda 100644
--- a/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointUriFactory.java
+++ b/components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsEndpointUriFactory.java
@@ -23,10 +23,11 @@ public class NatsEndpointUriFactory extends org.apache.camel.support.component.E
private static final Set<String> SECRET_PROPERTY_NAMES;
private static final Set<String> MULTI_VALUE_PREFIXES;
static {
- Set<String> props = new HashSet<>(30);
+ Set<String> props = new HashSet<>(32);
props.add("bridgeErrorHandler");
props.add("connection");
props.add("connectionTimeout");
+ props.add("credentialsFilePath");
props.add("exceptionHandler");
props.add("exchangePattern");
props.add("flushConnection");
@@ -53,6 +54,7 @@ public class NatsEndpointUriFactory extends org.apache.camel.support.component.E
props.add("sslContextParameters");
props.add("topic");
props.add("traceConnection");
+ props.add("useCredentialsFile");
props.add("verbose");
PROPERTY_NAMES = Collections.unmodifiableSet(props);
SECRET_PROPERTY_NAMES = Collections.emptySet();
diff --git a/components/camel-nats/src/generated/resources/META-INF/org/apache/camel/component/nats/nats.json b/components/camel-nats/src/generated/resources/META-INF/org/apache/camel/component/nats/nats.json
index 3ae2ae4049c..c226db67603 100644
--- a/components/camel-nats/src/generated/resources/META-INF/org/apache/camel/component/nats/nats.json
+++ b/components/camel-nats/src/generated/resources/META-INF/org/apache/camel/component/nats/nats.json
@@ -67,7 +67,9 @@
"connection": { "index": 25, "kind": "parameter", "displayName": "Connection", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "io.nats.client.Connection", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "Reference an already instantiated connection to Nats server" },
"headerFilterStrategy": { "index": 26, "kind": "parameter", "displayName": "Header Filter Strategy", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "Define the header filtering strategy" },
"traceConnection": { "index": 27, "kind": "parameter", "displayName": "Trace Connection", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "Whether or not connection trace messages should be printed to standard out for fine [...]
- "secure": { "index": 28, "kind": "parameter", "displayName": "Secure", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "Set secure option indicating TLS is required" },
- "sslContextParameters": { "index": 29, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters" }
+ "credentialsFilePath": { "index": 28, "kind": "parameter", "displayName": "Credentials File Path", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "If we use useCredentialsFile to true we'll need to set the credentialsFilePath option. It [...]
+ "secure": { "index": 29, "kind": "parameter", "displayName": "Secure", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "Set secure option indicating TLS is required" },
+ "sslContextParameters": { "index": 30, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters" },
+ "useCredentialsFile": { "index": 31, "kind": "parameter", "displayName": "Use Credentials File", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.nats.NatsConfiguration", "configurationField": "configuration", "description": "Determine if we are going to use a credentials file or not" }
}
}
diff --git a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java
index 53f185a1fb9..2bd05851312 100644
--- a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java
+++ b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java
@@ -20,6 +20,7 @@ import java.security.NoSuchAlgorithmException;
import java.time.Duration;
import io.nats.client.Connection;
+import io.nats.client.Nats;
import io.nats.client.Options;
import io.nats.client.Options.Builder;
import org.apache.camel.spi.HeaderFilterStrategy;
@@ -83,6 +84,10 @@ public class NatsConfiguration {
private boolean secure;
@UriParam(label = "security")
private SSLContextParameters sslContextParameters;
+ @UriParam(label = "security")
+ boolean useCredentialsFile;
+ @UriParam(label = "security")
+ String credentialsFilePath;
@UriParam(label = "advanced")
private boolean traceConnection;
@UriParam(label = "advanced")
@@ -367,6 +372,30 @@ public class NatsConfiguration {
this.sslContextParameters = sslContextParameters;
}
+ /**
+ * Determine if we are going to use a credentials file or not
+ */
+ public boolean isUseCredentialsFile() {
+ return useCredentialsFile;
+ }
+
+ public void setUseCredentialsFile(boolean useCredentialsFile) {
+ this.useCredentialsFile = useCredentialsFile;
+ }
+
+ /**
+ * If we use useCredentialsFile to true we'll need to set the credentialsFilePath option. It can be loaded by
+ * default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different
+ * systems.
+ */
+ public String getCredentialsFilePath() {
+ return credentialsFilePath;
+ }
+
+ public void setCredentialsFilePath(String credentialsFilePath) {
+ this.credentialsFilePath = credentialsFilePath;
+ }
+
public Builder createOptions() throws NoSuchAlgorithmException, IllegalArgumentException {
Builder builder = new Options.Builder();
builder.server(splitServers());
diff --git a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsEndpoint.java b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsEndpoint.java
index 7cc24f51fa1..c00104b61ee 100644
--- a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsEndpoint.java
+++ b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsEndpoint.java
@@ -36,6 +36,8 @@ import org.apache.camel.spi.HeaderFilterStrategyAware;
import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;
import org.apache.camel.support.DefaultEndpoint;
+import org.apache.camel.support.ResourceHelper;
+import org.apache.camel.util.ObjectHelper;
/**
* Send and receive messages from <a href="http://nats.io/">NATS</a> messaging system.
@@ -85,6 +87,13 @@ public class NatsEndpoint extends DefaultEndpoint implements MultipleConsumersSu
SSLContext sslCtx = getConfiguration().getSslContextParameters().createSSLContext(getCamelContext());
builder.sslContext(sslCtx);
}
+ if (getConfiguration().isUseCredentialsFile()) {
+ if (ObjectHelper.isNotEmpty(getConfiguration().getCredentialsFilePath())) {
+ builder.authHandler(Nats.staticCredentials(
+ ResourceHelper.resolveResource(getCamelContext(), getConfiguration().getCredentialsFilePath())
+ .getInputStream().readAllBytes()));
+ }
+ }
Options options = builder.build();
return Nats.connect(options);
}
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NatsEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NatsEndpointBuilderFactory.java
index c9a4fb50119..f89807d069c 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NatsEndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NatsEndpointBuilderFactory.java
@@ -549,6 +549,23 @@ public interface NatsEndpointBuilderFactory {
doSetProperty("replyToDisabled", replyToDisabled);
return this;
}
+ /**
+ * If we use useCredentialsFile to true we'll need to set the
+ * credentialsFilePath option. It can be loaded by default from
+ * classpath, but you can prefix with classpath:, file:, or http: to
+ * load the resource from different systems.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param credentialsFilePath the value to set
+ * @return the dsl builder
+ */
+ default NatsEndpointConsumerBuilder credentialsFilePath(String credentialsFilePath) {
+ doSetProperty("credentialsFilePath", credentialsFilePath);
+ return this;
+ }
/**
* Set secure option indicating TLS is required.
*
@@ -609,6 +626,36 @@ public interface NatsEndpointBuilderFactory {
doSetProperty("sslContextParameters", sslContextParameters);
return this;
}
+ /**
+ * Determine if we are going to use a credentials file or not.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useCredentialsFile the value to set
+ * @return the dsl builder
+ */
+ default NatsEndpointConsumerBuilder useCredentialsFile(boolean useCredentialsFile) {
+ doSetProperty("useCredentialsFile", useCredentialsFile);
+ return this;
+ }
+ /**
+ * Determine if we are going to use a credentials file or not.
+ *
+ * The option will be converted to a <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useCredentialsFile the value to set
+ * @return the dsl builder
+ */
+ default NatsEndpointConsumerBuilder useCredentialsFile(String useCredentialsFile) {
+ doSetProperty("useCredentialsFile", useCredentialsFile);
+ return this;
+ }
}
/**
@@ -1301,6 +1348,23 @@ public interface NatsEndpointBuilderFactory {
doSetProperty("requestTimeout", requestTimeout);
return this;
}
+ /**
+ * If we use useCredentialsFile to true we'll need to set the
+ * credentialsFilePath option. It can be loaded by default from
+ * classpath, but you can prefix with classpath:, file:, or http: to
+ * load the resource from different systems.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param credentialsFilePath the value to set
+ * @return the dsl builder
+ */
+ default NatsEndpointProducerBuilder credentialsFilePath(String credentialsFilePath) {
+ doSetProperty("credentialsFilePath", credentialsFilePath);
+ return this;
+ }
/**
* Set secure option indicating TLS is required.
*
@@ -1361,6 +1425,36 @@ public interface NatsEndpointBuilderFactory {
doSetProperty("sslContextParameters", sslContextParameters);
return this;
}
+ /**
+ * Determine if we are going to use a credentials file or not.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useCredentialsFile the value to set
+ * @return the dsl builder
+ */
+ default NatsEndpointProducerBuilder useCredentialsFile(boolean useCredentialsFile) {
+ doSetProperty("useCredentialsFile", useCredentialsFile);
+ return this;
+ }
+ /**
+ * Determine if we are going to use a credentials file or not.
+ *
+ * The option will be converted to a <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useCredentialsFile the value to set
+ * @return the dsl builder
+ */
+ default NatsEndpointProducerBuilder useCredentialsFile(String useCredentialsFile) {
+ doSetProperty("useCredentialsFile", useCredentialsFile);
+ return this;
+ }
}
/**
@@ -1938,6 +2032,23 @@ public interface NatsEndpointBuilderFactory {
doSetProperty("verbose", verbose);
return this;
}
+ /**
+ * If we use useCredentialsFile to true we'll need to set the
+ * credentialsFilePath option. It can be loaded by default from
+ * classpath, but you can prefix with classpath:, file:, or http: to
+ * load the resource from different systems.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param credentialsFilePath the value to set
+ * @return the dsl builder
+ */
+ default NatsEndpointBuilder credentialsFilePath(String credentialsFilePath) {
+ doSetProperty("credentialsFilePath", credentialsFilePath);
+ return this;
+ }
/**
* Set secure option indicating TLS is required.
*
@@ -1998,6 +2109,36 @@ public interface NatsEndpointBuilderFactory {
doSetProperty("sslContextParameters", sslContextParameters);
return this;
}
+ /**
+ * Determine if we are going to use a credentials file or not.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useCredentialsFile the value to set
+ * @return the dsl builder
+ */
+ default NatsEndpointBuilder useCredentialsFile(boolean useCredentialsFile) {
+ doSetProperty("useCredentialsFile", useCredentialsFile);
+ return this;
+ }
+ /**
+ * Determine if we are going to use a credentials file or not.
+ *
+ * The option will be converted to a <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useCredentialsFile the value to set
+ * @return the dsl builder
+ */
+ default NatsEndpointBuilder useCredentialsFile(String useCredentialsFile) {
+ doSetProperty("useCredentialsFile", useCredentialsFile);
+ return this;
+ }
}
/**
diff --git a/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/NatsUriDsl.kt b/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/NatsUriDsl.kt
index e3a42a3e8be..014eb119914 100644
--- a/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/NatsUriDsl.kt
+++ b/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/NatsUriDsl.kt
@@ -407,6 +407,15 @@ public class NatsUriDsl(
it.property("traceConnection", traceConnection.toString())
}
+ /**
+ * If we use useCredentialsFile to true we'll need to set the credentialsFilePath option. It can
+ * be loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load
+ * the resource from different systems.
+ */
+ public fun credentialsFilePath(credentialsFilePath: String) {
+ it.property("credentialsFilePath", credentialsFilePath)
+ }
+
/**
* Set secure option indicating TLS is required
*/
@@ -427,4 +436,18 @@ public class NatsUriDsl(
public fun sslContextParameters(sslContextParameters: String) {
it.property("sslContextParameters", sslContextParameters)
}
+
+ /**
+ * Determine if we are going to use a credentials file or not
+ */
+ public fun useCredentialsFile(useCredentialsFile: String) {
+ it.property("useCredentialsFile", useCredentialsFile)
+ }
+
+ /**
+ * Determine if we are going to use a credentials file or not
+ */
+ public fun useCredentialsFile(useCredentialsFile: Boolean) {
+ it.property("useCredentialsFile", useCredentialsFile.toString())
+ }
}