You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2024/08/06 11:50:33 UTC
(camel) branch main updated: Splunk HEC add sslContextParameters (#14998)
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 9f79b25ce22 Splunk HEC add sslContextParameters (#14998)
9f79b25ce22 is described below
commit 9f79b25ce22bba40fa9c31048a7cddce6e576198
Author: JiriOndrusek <on...@gmail.com>
AuthorDate: Tue Aug 6 13:50:26 2024 +0200
Splunk HEC add sslContextParameters (#14998)
---
.../camel/catalog/components/splunk-hec.json | 15 +++++----
.../splunkhec/SplunkHECComponentConfigurer.java | 12 ++++++++
.../splunkhec/SplunkHECEndpointConfigurer.java | 6 ++++
.../splunkhec/SplunkHECEndpointUriFactory.java | 3 +-
.../camel/component/splunkhec/splunk-hec.json | 15 +++++----
.../component/splunkhec/SplunkHECComponent.java | 35 ++++++++++++++++++++-
.../component/splunkhec/SplunkHECEndpoint.java | 29 +++++++++++++++++
.../component/splunkhec/SplunkHECProducer.java | 8 ++++-
.../dsl/SplunkHecComponentBuilderFactory.java | 36 ++++++++++++++++++++++
.../dsl/SplunkHECEndpointBuilderFactory.java | 30 ++++++++++++++++++
.../camel/kotlin/components/SplunkHecUriDsl.kt | 7 +++++
11 files changed, 181 insertions(+), 15 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/splunk-hec.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/splunk-hec.json
index a0234ec9e95..8cf30eb99cc 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/splunk-hec.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/splunk-hec.json
@@ -24,7 +24,9 @@
},
"componentProperties": {
"lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...]
- "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...]
+ "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...]
+ "sslContextParameters": { "index": 2, "kind": "property", "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, "description": "Sets the default SSL configuration to use for all the endpoints. You can also configure it directly at the endpoint level." },
+ "useGlobalSslContextParameters": { "index": 3, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." }
},
"headers": {
"CamelSplunkHECIndexTime": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Epoch-formatted time. Specify with the time query string parameter. Sets a default for all events in the request. The default time can be overridden.", "constantName": "org.apache.camel.component.splunkhec.SplunkHECConstants#INDEX_TIME" }
@@ -38,10 +40,11 @@
"source": { "index": 5, "kind": "parameter", "displayName": "Source", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "camel", "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Splunk source argument" },
"sourceType": { "index": 6, "kind": "parameter", "displayName": "Source Type", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "camel", "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Splunk sourcetype argument" },
"splunkEndpoint": { "index": 7, "kind": "parameter", "displayName": "Splunk Endpoint", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "\/services\/collector\/event", "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Splunk endpoint Defaults to \/services\/collector\/e [...]
- "time": { "index": 8, "kind": "parameter", "displayName": "Time", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Time this even occurred. By default, the time will be when this event hits the splunk server." },
- "lazyStartProducer": { "index": 9, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...]
- "https": { "index": 10, "kind": "parameter", "displayName": "Https", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Contact HEC over https." },
- "skipTlsVerify": { "index": 11, "kind": "parameter", "displayName": "Skip Tls Verify", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Splunk HEC TLS verification." },
- "token": { "index": 12, "kind": "parameter", "displayName": "Token", "group": "security", "label": "security", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Splunk HEC token (this is the token created for HEC and not the user's token)" }
+ "sslContextParameters": { "index": 8, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "description": "SSL configuration" },
+ "time": { "index": 9, "kind": "parameter", "displayName": "Time", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Time this even occurred. By default, the time will be when this event hits the splunk server." },
+ "lazyStartProducer": { "index": 10, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...]
+ "https": { "index": 11, "kind": "parameter", "displayName": "Https", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Contact HEC over https." },
+ "skipTlsVerify": { "index": 12, "kind": "parameter", "displayName": "Skip Tls Verify", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Splunk HEC TLS verification." },
+ "token": { "index": 13, "kind": "parameter", "displayName": "Token", "group": "security", "label": "security", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Splunk HEC token (this is the token created for HEC and not the user's token)" }
}
}
diff --git a/components/camel-splunk-hec/src/generated/java/org/apache/camel/component/splunkhec/SplunkHECComponentConfigurer.java b/components/camel-splunk-hec/src/generated/java/org/apache/camel/component/splunkhec/SplunkHECComponentConfigurer.java
index cc2fec5009c..6b2456d4f4e 100644
--- a/components/camel-splunk-hec/src/generated/java/org/apache/camel/component/splunkhec/SplunkHECComponentConfigurer.java
+++ b/components/camel-splunk-hec/src/generated/java/org/apache/camel/component/splunkhec/SplunkHECComponentConfigurer.java
@@ -27,6 +27,10 @@ public class SplunkHECComponentConfigurer extends PropertyConfigurerSupport impl
case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
case "lazystartproducer":
case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
+ case "sslcontextparameters":
+ case "sslContextParameters": target.setSslContextParameters(property(camelContext, org.apache.camel.support.jsse.SSLContextParameters.class, value)); return true;
+ case "useglobalsslcontextparameters":
+ case "useGlobalSslContextParameters": target.setUseGlobalSslContextParameters(property(camelContext, boolean.class, value)); return true;
default: return false;
}
}
@@ -38,6 +42,10 @@ public class SplunkHECComponentConfigurer extends PropertyConfigurerSupport impl
case "autowiredEnabled": return boolean.class;
case "lazystartproducer":
case "lazyStartProducer": return boolean.class;
+ case "sslcontextparameters":
+ case "sslContextParameters": return org.apache.camel.support.jsse.SSLContextParameters.class;
+ case "useglobalsslcontextparameters":
+ case "useGlobalSslContextParameters": return boolean.class;
default: return null;
}
}
@@ -50,6 +58,10 @@ public class SplunkHECComponentConfigurer extends PropertyConfigurerSupport impl
case "autowiredEnabled": return target.isAutowiredEnabled();
case "lazystartproducer":
case "lazyStartProducer": return target.isLazyStartProducer();
+ case "sslcontextparameters":
+ case "sslContextParameters": return target.getSslContextParameters();
+ case "useglobalsslcontextparameters":
+ case "useGlobalSslContextParameters": return target.isUseGlobalSslContextParameters();
default: return null;
}
}
diff --git a/components/camel-splunk-hec/src/generated/java/org/apache/camel/component/splunkhec/SplunkHECEndpointConfigurer.java b/components/camel-splunk-hec/src/generated/java/org/apache/camel/component/splunkhec/SplunkHECEndpointConfigurer.java
index 0f6a297abf0..22dac336b0e 100644
--- a/components/camel-splunk-hec/src/generated/java/org/apache/camel/component/splunkhec/SplunkHECEndpointConfigurer.java
+++ b/components/camel-splunk-hec/src/generated/java/org/apache/camel/component/splunkhec/SplunkHECEndpointConfigurer.java
@@ -39,6 +39,8 @@ public class SplunkHECEndpointConfigurer extends PropertyConfigurerSupport imple
case "sourceType": target.getConfiguration().setSourceType(property(camelContext, java.lang.String.class, value)); return true;
case "splunkendpoint":
case "splunkEndpoint": target.getConfiguration().setSplunkEndpoint(property(camelContext, java.lang.String.class, value)); return true;
+ case "sslcontextparameters":
+ case "sslContextParameters": target.setSslContextParameters(property(camelContext, org.apache.camel.support.jsse.SSLContextParameters.class, value)); return true;
case "time": target.getConfiguration().setTime(property(camelContext, java.lang.Long.class, value)); return true;
case "token": target.getConfiguration().setToken(property(camelContext, java.lang.String.class, value)); return true;
default: return false;
@@ -64,6 +66,8 @@ public class SplunkHECEndpointConfigurer extends PropertyConfigurerSupport imple
case "sourceType": return java.lang.String.class;
case "splunkendpoint":
case "splunkEndpoint": return java.lang.String.class;
+ case "sslcontextparameters":
+ case "sslContextParameters": return org.apache.camel.support.jsse.SSLContextParameters.class;
case "time": return java.lang.Long.class;
case "token": return java.lang.String.class;
default: return null;
@@ -90,6 +94,8 @@ public class SplunkHECEndpointConfigurer extends PropertyConfigurerSupport imple
case "sourceType": return target.getConfiguration().getSourceType();
case "splunkendpoint":
case "splunkEndpoint": return target.getConfiguration().getSplunkEndpoint();
+ case "sslcontextparameters":
+ case "sslContextParameters": return target.getSslContextParameters();
case "time": return target.getConfiguration().getTime();
case "token": return target.getConfiguration().getToken();
default: return null;
diff --git a/components/camel-splunk-hec/src/generated/java/org/apache/camel/component/splunkhec/SplunkHECEndpointUriFactory.java b/components/camel-splunk-hec/src/generated/java/org/apache/camel/component/splunkhec/SplunkHECEndpointUriFactory.java
index aeb98fcb6f1..3920f8cde40 100644
--- a/components/camel-splunk-hec/src/generated/java/org/apache/camel/component/splunkhec/SplunkHECEndpointUriFactory.java
+++ b/components/camel-splunk-hec/src/generated/java/org/apache/camel/component/splunkhec/SplunkHECEndpointUriFactory.java
@@ -23,7 +23,7 @@ public class SplunkHECEndpointUriFactory extends org.apache.camel.support.compon
private static final Set<String> SECRET_PROPERTY_NAMES;
private static final Set<String> MULTI_VALUE_PREFIXES;
static {
- Set<String> props = new HashSet<>(13);
+ Set<String> props = new HashSet<>(14);
props.add("bodyOnly");
props.add("headersOnly");
props.add("host");
@@ -35,6 +35,7 @@ public class SplunkHECEndpointUriFactory extends org.apache.camel.support.compon
props.add("sourceType");
props.add("splunkEndpoint");
props.add("splunkURL");
+ props.add("sslContextParameters");
props.add("time");
props.add("token");
PROPERTY_NAMES = Collections.unmodifiableSet(props);
diff --git a/components/camel-splunk-hec/src/generated/resources/META-INF/org/apache/camel/component/splunkhec/splunk-hec.json b/components/camel-splunk-hec/src/generated/resources/META-INF/org/apache/camel/component/splunkhec/splunk-hec.json
index a0234ec9e95..8cf30eb99cc 100644
--- a/components/camel-splunk-hec/src/generated/resources/META-INF/org/apache/camel/component/splunkhec/splunk-hec.json
+++ b/components/camel-splunk-hec/src/generated/resources/META-INF/org/apache/camel/component/splunkhec/splunk-hec.json
@@ -24,7 +24,9 @@
},
"componentProperties": {
"lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...]
- "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...]
+ "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...]
+ "sslContextParameters": { "index": 2, "kind": "property", "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, "description": "Sets the default SSL configuration to use for all the endpoints. You can also configure it directly at the endpoint level." },
+ "useGlobalSslContextParameters": { "index": 3, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." }
},
"headers": {
"CamelSplunkHECIndexTime": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Epoch-formatted time. Specify with the time query string parameter. Sets a default for all events in the request. The default time can be overridden.", "constantName": "org.apache.camel.component.splunkhec.SplunkHECConstants#INDEX_TIME" }
@@ -38,10 +40,11 @@
"source": { "index": 5, "kind": "parameter", "displayName": "Source", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "camel", "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Splunk source argument" },
"sourceType": { "index": 6, "kind": "parameter", "displayName": "Source Type", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "camel", "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Splunk sourcetype argument" },
"splunkEndpoint": { "index": 7, "kind": "parameter", "displayName": "Splunk Endpoint", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "\/services\/collector\/event", "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Splunk endpoint Defaults to \/services\/collector\/e [...]
- "time": { "index": 8, "kind": "parameter", "displayName": "Time", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Time this even occurred. By default, the time will be when this event hits the splunk server." },
- "lazyStartProducer": { "index": 9, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...]
- "https": { "index": 10, "kind": "parameter", "displayName": "Https", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Contact HEC over https." },
- "skipTlsVerify": { "index": 11, "kind": "parameter", "displayName": "Skip Tls Verify", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Splunk HEC TLS verification." },
- "token": { "index": 12, "kind": "parameter", "displayName": "Token", "group": "security", "label": "security", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Splunk HEC token (this is the token created for HEC and not the user's token)" }
+ "sslContextParameters": { "index": 8, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "description": "SSL configuration" },
+ "time": { "index": 9, "kind": "parameter", "displayName": "Time", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Time this even occurred. By default, the time will be when this event hits the splunk server." },
+ "lazyStartProducer": { "index": 10, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...]
+ "https": { "index": 11, "kind": "parameter", "displayName": "Https", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Contact HEC over https." },
+ "skipTlsVerify": { "index": 12, "kind": "parameter", "displayName": "Skip Tls Verify", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Splunk HEC TLS verification." },
+ "token": { "index": 13, "kind": "parameter", "displayName": "Token", "group": "security", "label": "security", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.splunkhec.SplunkHECConfiguration", "configurationField": "configuration", "description": "Splunk HEC token (this is the token created for HEC and not the user's token)" }
}
}
diff --git a/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECComponent.java b/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECComponent.java
index 8535f76314b..b533d3947aa 100644
--- a/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECComponent.java
+++ b/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECComponent.java
@@ -19,12 +19,20 @@ package org.apache.camel.component.splunkhec;
import java.util.Map;
import org.apache.camel.Endpoint;
+import org.apache.camel.SSLContextParametersAware;
+import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.annotations.Component;
import org.apache.camel.support.DefaultComponent;
+import org.apache.camel.support.jsse.SSLContextParameters;
import org.apache.camel.util.URISupport;
@Component("splunk-hec")
-public class SplunkHECComponent extends DefaultComponent {
+public class SplunkHECComponent extends DefaultComponent implements SSLContextParametersAware {
+
+ @Metadata(label = "security")
+ private SSLContextParameters sslContextParameters;
+ @Metadata(label = "security", defaultValue = "false")
+ private boolean useGlobalSslContextParameters;
public SplunkHECComponent() {
}
@@ -41,4 +49,29 @@ public class SplunkHECComponent extends DefaultComponent {
return answer;
}
+
+ public SSLContextParameters getSslContextParameters() {
+ return sslContextParameters;
+ }
+
+ /**
+ * Sets the default SSL configuration to use for all the endpoints. You can also configure it directly at the
+ * endpoint level.
+ */
+ public void setSslContextParameters(SSLContextParameters sslContextParameters) {
+ this.sslContextParameters = sslContextParameters;
+ }
+
+ @Override
+ public boolean isUseGlobalSslContextParameters() {
+ return this.useGlobalSslContextParameters;
+ }
+
+ /**
+ * Enable usage of global SSL context parameters.
+ */
+ @Override
+ public void setUseGlobalSslContextParameters(boolean useGlobalSslContextParameters) {
+ this.useGlobalSslContextParameters = useGlobalSslContextParameters;
+ }
}
diff --git a/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECEndpoint.java b/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECEndpoint.java
index b7223d04bc3..e7e241fd001 100644
--- a/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECEndpoint.java
+++ b/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECEndpoint.java
@@ -16,9 +16,13 @@
*/
package org.apache.camel.component.splunkhec;
+import java.io.IOException;
+import java.security.GeneralSecurityException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import javax.net.ssl.SSLContext;
+
import org.apache.camel.Category;
import org.apache.camel.Consumer;
import org.apache.camel.Processor;
@@ -29,6 +33,7 @@ import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriPath;
import org.apache.camel.support.DefaultEndpoint;
+import org.apache.camel.support.jsse.SSLContextParameters;
import org.apache.commons.validator.routines.DomainValidator;
import org.apache.commons.validator.routines.InetAddressValidator;
@@ -46,6 +51,8 @@ public class SplunkHECEndpoint extends DefaultEndpoint implements EndpointServic
@UriPath
@Metadata(required = true)
private String splunkURL;
+ @UriParam(description = "SSL configuration")
+ private SSLContextParameters sslContextParameters;
@UriParam
private SplunkHECConfiguration configuration;
@@ -89,6 +96,11 @@ public class SplunkHECEndpoint extends DefaultEndpoint implements EndpointServic
}
}
+ @Override
+ public SplunkHECComponent getComponent() {
+ return (SplunkHECComponent) super.getComponent();
+ }
+
@Override
public Producer createProducer() {
return new SplunkHECProducer(this);
@@ -124,4 +136,21 @@ public class SplunkHECEndpoint extends DefaultEndpoint implements EndpointServic
this.splunkURL = splunkURL;
}
+ public SSLContextParameters getSslContextParameters() {
+ return sslContextParameters;
+ }
+
+ public void setSslContextParameters(SSLContextParameters sslContextParameters) {
+ this.sslContextParameters = sslContextParameters;
+ }
+
+ SSLContext provideSSLContext() throws GeneralSecurityException, IOException {
+ if (sslContextParameters != null) {
+ return sslContextParameters.createSSLContext(getCamelContext());
+ } else if (getComponent().getSslContextParameters() != null) {
+ return getComponent().getSslContextParameters().createSSLContext(getCamelContext());
+ } else {
+ return null;
+ }
+ }
}
diff --git a/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECProducer.java b/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECProducer.java
index 4d1e05fdf5f..09c6665ac9e 100644
--- a/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECProducer.java
+++ b/components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECProducer.java
@@ -68,8 +68,14 @@ public class SplunkHECProducer extends DefaultProducer {
connManager = new PoolingHttpClientConnectionManager(registryBuilder.build());
} else {
- connManager = new PoolingHttpClientConnectionManager();
+ SSLConnectionSocketFactory sslsf
+ = new SSLConnectionSocketFactory(endpoint.provideSSLContext(), NoopHostnameVerifier.INSTANCE);
+ RegistryBuilder<ConnectionSocketFactory> registryBuilder = RegistryBuilder.create();
+ registryBuilder.register("https", sslsf);
+
+ connManager = new PoolingHttpClientConnectionManager(registryBuilder.build());
}
+
connManager.setMaxTotal(10);
builder.setConnectionManager(connManager);
httpClient = builder.build();
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SplunkHecComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SplunkHecComponentBuilderFactory.java
index f0632ed54be..d1d569682bb 100644
--- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SplunkHecComponentBuilderFactory.java
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SplunkHecComponentBuilderFactory.java
@@ -98,6 +98,40 @@ public interface SplunkHecComponentBuilderFactory {
doSetProperty("autowiredEnabled", autowiredEnabled);
return this;
}
+
+ /**
+ * Sets the default SSL configuration to use for all the endpoints. You
+ * can also configure it directly at the endpoint level.
+ *
+ * The option is a:
+ * <code>org.apache.camel.support.jsse.SSLContextParameters</code> type.
+ *
+ * Group: security
+ *
+ * @param sslContextParameters the value to set
+ * @return the dsl builder
+ */
+ default SplunkHecComponentBuilder sslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) {
+ doSetProperty("sslContextParameters", sslContextParameters);
+ return this;
+ }
+
+
+ /**
+ * Enable usage of global SSL context parameters.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useGlobalSslContextParameters the value to set
+ * @return the dsl builder
+ */
+ default SplunkHecComponentBuilder useGlobalSslContextParameters(boolean useGlobalSslContextParameters) {
+ doSetProperty("useGlobalSslContextParameters", useGlobalSslContextParameters);
+ return this;
+ }
}
class SplunkHecComponentBuilderImpl
@@ -115,6 +149,8 @@ public interface SplunkHecComponentBuilderFactory {
switch (name) {
case "lazyStartProducer": ((SplunkHECComponent) component).setLazyStartProducer((boolean) value); return true;
case "autowiredEnabled": ((SplunkHECComponent) component).setAutowiredEnabled((boolean) value); return true;
+ case "sslContextParameters": ((SplunkHECComponent) component).setSslContextParameters((org.apache.camel.support.jsse.SSLContextParameters) value); return true;
+ case "useGlobalSslContextParameters": ((SplunkHECComponent) component).setUseGlobalSslContextParameters((boolean) value); return true;
default: return false;
}
}
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SplunkHECEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SplunkHECEndpointBuilderFactory.java
index e7f7958d67e..85b6695c4a3 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SplunkHECEndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SplunkHECEndpointBuilderFactory.java
@@ -184,6 +184,36 @@ public interface SplunkHECEndpointBuilderFactory {
doSetProperty("splunkEndpoint", splunkEndpoint);
return this;
}
+ /**
+ * SSL configuration.
+ *
+ * The option is a:
+ * <code>org.apache.camel.support.jsse.SSLContextParameters</code> type.
+ *
+ * Group: producer
+ *
+ * @param sslContextParameters the value to set
+ * @return the dsl builder
+ */
+ default SplunkHECEndpointBuilder sslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) {
+ doSetProperty("sslContextParameters", sslContextParameters);
+ return this;
+ }
+ /**
+ * SSL configuration.
+ *
+ * The option will be converted to a
+ * <code>org.apache.camel.support.jsse.SSLContextParameters</code> type.
+ *
+ * Group: producer
+ *
+ * @param sslContextParameters the value to set
+ * @return the dsl builder
+ */
+ default SplunkHECEndpointBuilder sslContextParameters(String sslContextParameters) {
+ doSetProperty("sslContextParameters", sslContextParameters);
+ return this;
+ }
/**
* Time this even occurred. By default, the time will be when this event
* hits the splunk server.
diff --git a/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/SplunkHecUriDsl.kt b/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/SplunkHecUriDsl.kt
index a4e21e0817c..24c272277ff 100644
--- a/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/SplunkHecUriDsl.kt
+++ b/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/SplunkHecUriDsl.kt
@@ -119,6 +119,13 @@ public class SplunkHecUriDsl(
it.property("splunkEndpoint", splunkEndpoint)
}
+ /**
+ * SSL configuration
+ */
+ public fun sslContextParameters(sslContextParameters: String) {
+ it.property("sslContextParameters", sslContextParameters)
+ }
+
/**
* Time this even occurred. By default, the time will be when this event hits the splunk server.
*/