This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch 23222-4.18.x in repository https://gitbox.apache.org/repos/asf/camel.git
commit 89acb56efcadd8b34352c388809ec728caf638e2 Author: Andrea Cosentino <[email protected]> AuthorDate: Fri Mar 20 10:15:02 2026 +0100 CAMEL-23222 - camel-coap: Integrate HeaderFilterStrategy for CoAP query parameter to header mapping Signed-off-by: Andrea Cosentino <[email protected]> --- .../apache/camel/coap/CoAPComponentConfigurer.java | 6 ++++ .../apache/camel/coap/CoAPEndpointConfigurer.java | 6 ++++ .../apache/camel/coap/CoAPEndpointUriFactory.java | 3 +- .../META-INF/org/apache/camel/coap/coap+tcp.json | 22 ++++++++------- .../META-INF/org/apache/camel/coap/coap.json | 22 ++++++++------- .../META-INF/org/apache/camel/coap/coaps+tcp.json | 22 ++++++++------- .../META-INF/org/apache/camel/coap/coaps.json | 22 ++++++++------- .../org/apache/camel/coap/CamelCoapResource.java | 14 +++++++-- .../java/org/apache/camel/coap/CoAPComponent.java | 23 ++++++++++++++- .../java/org/apache/camel/coap/CoAPEndpoint.java | 23 ++++++++++++++- .../camel/coap/CoAPHeaderFilterStrategy.java | 33 ++++++++++++++++++++++ 11 files changed, 151 insertions(+), 45 deletions(-) diff --git a/components/camel-coap/src/generated/java/org/apache/camel/coap/CoAPComponentConfigurer.java b/components/camel-coap/src/generated/java/org/apache/camel/coap/CoAPComponentConfigurer.java index aa4a8a79789a..6c46ac960238 100644 --- a/components/camel-coap/src/generated/java/org/apache/camel/coap/CoAPComponentConfigurer.java +++ b/components/camel-coap/src/generated/java/org/apache/camel/coap/CoAPComponentConfigurer.java @@ -30,6 +30,8 @@ public class CoAPComponentConfigurer extends PropertyConfigurerSupport implement case "client": target.setClient(property(camelContext, org.eclipse.californium.core.CoapClient.class, value)); return true; case "configurationfile": case "configurationFile": target.setConfigurationFile(property(camelContext, java.lang.String.class, value)); return true; + case "headerfilterstrategy": + case "headerFilterStrategy": target.setHeaderFilterStrategy(property(camelContext, org.apache.camel.spi.HeaderFilterStrategy.class, value)); return true; case "lazystartproducer": case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; default: return false; @@ -46,6 +48,8 @@ public class CoAPComponentConfigurer extends PropertyConfigurerSupport implement case "client": return org.eclipse.californium.core.CoapClient.class; case "configurationfile": case "configurationFile": return java.lang.String.class; + case "headerfilterstrategy": + case "headerFilterStrategy": return org.apache.camel.spi.HeaderFilterStrategy.class; case "lazystartproducer": case "lazyStartProducer": return boolean.class; default: return null; @@ -63,6 +67,8 @@ public class CoAPComponentConfigurer extends PropertyConfigurerSupport implement case "client": return target.getClient(); case "configurationfile": case "configurationFile": return target.getConfigurationFile(); + case "headerfilterstrategy": + case "headerFilterStrategy": return target.getHeaderFilterStrategy(); case "lazystartproducer": case "lazyStartProducer": return target.isLazyStartProducer(); default: return null; diff --git a/components/camel-coap/src/generated/java/org/apache/camel/coap/CoAPEndpointConfigurer.java b/components/camel-coap/src/generated/java/org/apache/camel/coap/CoAPEndpointConfigurer.java index cce9f88d3e7a..1aa15f3a4bac 100644 --- a/components/camel-coap/src/generated/java/org/apache/camel/coap/CoAPEndpointConfigurer.java +++ b/components/camel-coap/src/generated/java/org/apache/camel/coap/CoAPEndpointConfigurer.java @@ -41,6 +41,8 @@ public class CoAPEndpointConfigurer extends PropertyConfigurerSupport implements case "exceptionHandler": target.setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true; case "exchangepattern": case "exchangePattern": target.setExchangePattern(property(camelContext, org.apache.camel.ExchangePattern.class, value)); return true; + case "headerfilterstrategy": + case "headerFilterStrategy": target.setHeaderFilterStrategy(property(camelContext, org.apache.camel.spi.HeaderFilterStrategy.class, value)); return true; case "lazystartproducer": case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; case "notify": target.setNotify(property(camelContext, boolean.class, value)); return true; @@ -79,6 +81,8 @@ public class CoAPEndpointConfigurer extends PropertyConfigurerSupport implements case "exceptionHandler": return org.apache.camel.spi.ExceptionHandler.class; case "exchangepattern": case "exchangePattern": return org.apache.camel.ExchangePattern.class; + case "headerfilterstrategy": + case "headerFilterStrategy": return org.apache.camel.spi.HeaderFilterStrategy.class; case "lazystartproducer": case "lazyStartProducer": return boolean.class; case "notify": return boolean.class; @@ -118,6 +122,8 @@ public class CoAPEndpointConfigurer extends PropertyConfigurerSupport implements case "exceptionHandler": return target.getExceptionHandler(); case "exchangepattern": case "exchangePattern": return target.getExchangePattern(); + case "headerfilterstrategy": + case "headerFilterStrategy": return target.getHeaderFilterStrategy(); case "lazystartproducer": case "lazyStartProducer": return target.isLazyStartProducer(); case "notify": return target.isNotify(); diff --git a/components/camel-coap/src/generated/java/org/apache/camel/coap/CoAPEndpointUriFactory.java b/components/camel-coap/src/generated/java/org/apache/camel/coap/CoAPEndpointUriFactory.java index 38524be0f1f4..b8763ad90323 100644 --- a/components/camel-coap/src/generated/java/org/apache/camel/coap/CoAPEndpointUriFactory.java +++ b/components/camel-coap/src/generated/java/org/apache/camel/coap/CoAPEndpointUriFactory.java @@ -24,7 +24,7 @@ public class CoAPEndpointUriFactory extends org.apache.camel.support.component.E private static final Set<String> SECRET_PROPERTY_NAMES; private static final Map<String, String> MULTI_VALUE_PREFIXES; static { - Set<String> props = new HashSet<>(19); + Set<String> props = new HashSet<>(20); props.add("advancedCertificateVerifier"); props.add("advancedPskStore"); props.add("alias"); @@ -35,6 +35,7 @@ public class CoAPEndpointUriFactory extends org.apache.camel.support.component.E props.add("coapMethodRestrict"); props.add("exceptionHandler"); props.add("exchangePattern"); + props.add("headerFilterStrategy"); props.add("lazyStartProducer"); props.add("notify"); props.add("observable"); diff --git a/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coap+tcp.json b/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coap+tcp.json index 8bc56e6b66ae..8570c256d238 100644 --- a/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coap+tcp.json +++ b/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coap+tcp.json @@ -29,7 +29,8 @@ "bridgeErrorHandler": { "index": 1, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the like [...] "lazyStartProducer": { "index": 2, "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 [...] "client": { "index": 3, "kind": "property", "displayName": "Client", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "object", "javaType": "org.eclipse.californium.core.CoapClient", "deprecated": false, "autowired": false, "secret": false, "description": "To use a shared client for the producers" }, - "autowiredEnabled": { "index": 4, "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": 4, "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 [...] + "headerFilterStrategy": { "index": 5, "kind": "property", "displayName": "Header Filter Strategy", "group": "filter", "label": "filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message." } }, "headers": { "CamelCoapETag": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "byte[]", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The CoAP ETag for the response.", "constantName": "org.apache.camel.coap.CoAPConstants#COAP_ETAG" }, @@ -49,14 +50,15 @@ "notify": { "index": 7, "kind": "parameter", "displayName": "Notify", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Notify observers that the resource of this URI has changed, based on RFC 7641. Use this flag on a destination endpoint, with a URI that matches an existing source endpoint URI." }, "client": { "index": 8, "kind": "parameter", "displayName": "Client", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "object", "javaType": "org.eclipse.californium.core.CoapClient", "deprecated": false, "autowired": false, "secret": false, "description": "To use a shared client for the producers" }, "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 [...] - "advancedCertificateVerifier": { "index": 10, "kind": "parameter", "displayName": "Advanced Certificate Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.x509.NewAdvancedCertificateVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedCertificateVerifier to use to determine trust in raw public keys." }, - "advancedPskStore": { "index": 11, "kind": "parameter", "displayName": "Advanced Psk Store", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.pskstore.AdvancedPskStore", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedPskStore to use for pre-shared key." }, - "alias": { "index": 12, "kind": "parameter", "displayName": "Alias", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "NONE", "WANT", "REQUIRE" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the alias used to query the KeyStore for the private key and certificate. This parameter is used when we are enabling TLS with certificates on the service side, and similarly on the client sid [...] - "cipherSuites": { "index": 13, "kind": "parameter", "displayName": "Cipher Suites", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the cipherSuites String. This is a comma separated String of ciphersuites to configure. If it is not specified, then it falls back to getting the ciphersuites from the sslContextParameters object." }, - "clientAuthentication": { "index": 14, "kind": "parameter", "displayName": "Client Authentication", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "org.eclipse.californium.elements.config.CertificateAuthenticationMode", "enum": [ "NONE", "WANTED", "NEEDED" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the configuration options for server-side client-authentication requirements. The value must be one of NONE [...] - "privateKey": { "index": 15, "kind": "parameter", "displayName": "Private Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PrivateKey", "deprecated": false, "autowired": false, "secret": true, "description": "Set the configured private key for use with Raw Public Key." }, - "publicKey": { "index": 16, "kind": "parameter", "displayName": "Public Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PublicKey", "deprecated": false, "autowired": false, "secret": false, "description": "Set the configured public key for use with Raw Public Key." }, - "recommendedCipherSuitesOnly": { "index": 17, "kind": "parameter", "displayName": "Recommended Cipher Suites Only", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "The CBC cipher suites are not recommended. If you want to use them, you first need to set the recommendedCipherSuitesOnly option to false." }, - "sslContextParameters": { "index": 18, "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, "description": "Set the SSLContextParameters object for setting up TLS. This is required for coapstcp, and for coaps when we are using certificates for TLS (as opposed to RPK or PKS)." } + "headerFilterStrategy": { "index": 10, "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, "description": "To use a custom HeaderFilterStrategy to filter header to and from Camel message." }, + "advancedCertificateVerifier": { "index": 11, "kind": "parameter", "displayName": "Advanced Certificate Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.x509.NewAdvancedCertificateVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedCertificateVerifier to use to determine trust in raw public keys." }, + "advancedPskStore": { "index": 12, "kind": "parameter", "displayName": "Advanced Psk Store", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.pskstore.AdvancedPskStore", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedPskStore to use for pre-shared key." }, + "alias": { "index": 13, "kind": "parameter", "displayName": "Alias", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "NONE", "WANT", "REQUIRE" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the alias used to query the KeyStore for the private key and certificate. This parameter is used when we are enabling TLS with certificates on the service side, and similarly on the client sid [...] + "cipherSuites": { "index": 14, "kind": "parameter", "displayName": "Cipher Suites", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the cipherSuites String. This is a comma separated String of ciphersuites to configure. If it is not specified, then it falls back to getting the ciphersuites from the sslContextParameters object." }, + "clientAuthentication": { "index": 15, "kind": "parameter", "displayName": "Client Authentication", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "org.eclipse.californium.elements.config.CertificateAuthenticationMode", "enum": [ "NONE", "WANTED", "NEEDED" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the configuration options for server-side client-authentication requirements. The value must be one of NONE [...] + "privateKey": { "index": 16, "kind": "parameter", "displayName": "Private Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PrivateKey", "deprecated": false, "autowired": false, "secret": true, "description": "Set the configured private key for use with Raw Public Key." }, + "publicKey": { "index": 17, "kind": "parameter", "displayName": "Public Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PublicKey", "deprecated": false, "autowired": false, "secret": false, "description": "Set the configured public key for use with Raw Public Key." }, + "recommendedCipherSuitesOnly": { "index": 18, "kind": "parameter", "displayName": "Recommended Cipher Suites Only", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "The CBC cipher suites are not recommended. If you want to use them, you first need to set the recommendedCipherSuitesOnly option to false." }, + "sslContextParameters": { "index": 19, "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, "description": "Set the SSLContextParameters object for setting up TLS. This is required for coapstcp, and for coaps when we are using certificates for TLS (as opposed to RPK or PKS)." } } } diff --git a/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coap.json b/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coap.json index 932933c69150..c4246043e87f 100644 --- a/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coap.json +++ b/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coap.json @@ -29,7 +29,8 @@ "bridgeErrorHandler": { "index": 1, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the like [...] "lazyStartProducer": { "index": 2, "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 [...] "client": { "index": 3, "kind": "property", "displayName": "Client", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "object", "javaType": "org.eclipse.californium.core.CoapClient", "deprecated": false, "autowired": false, "secret": false, "description": "To use a shared client for the producers" }, - "autowiredEnabled": { "index": 4, "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": 4, "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 [...] + "headerFilterStrategy": { "index": 5, "kind": "property", "displayName": "Header Filter Strategy", "group": "filter", "label": "filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message." } }, "headers": { "CamelCoapETag": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "byte[]", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The CoAP ETag for the response.", "constantName": "org.apache.camel.coap.CoAPConstants#COAP_ETAG" }, @@ -49,14 +50,15 @@ "notify": { "index": 7, "kind": "parameter", "displayName": "Notify", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Notify observers that the resource of this URI has changed, based on RFC 7641. Use this flag on a destination endpoint, with a URI that matches an existing source endpoint URI." }, "client": { "index": 8, "kind": "parameter", "displayName": "Client", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "object", "javaType": "org.eclipse.californium.core.CoapClient", "deprecated": false, "autowired": false, "secret": false, "description": "To use a shared client for the producers" }, "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 [...] - "advancedCertificateVerifier": { "index": 10, "kind": "parameter", "displayName": "Advanced Certificate Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.x509.NewAdvancedCertificateVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedCertificateVerifier to use to determine trust in raw public keys." }, - "advancedPskStore": { "index": 11, "kind": "parameter", "displayName": "Advanced Psk Store", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.pskstore.AdvancedPskStore", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedPskStore to use for pre-shared key." }, - "alias": { "index": 12, "kind": "parameter", "displayName": "Alias", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "NONE", "WANT", "REQUIRE" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the alias used to query the KeyStore for the private key and certificate. This parameter is used when we are enabling TLS with certificates on the service side, and similarly on the client sid [...] - "cipherSuites": { "index": 13, "kind": "parameter", "displayName": "Cipher Suites", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the cipherSuites String. This is a comma separated String of ciphersuites to configure. If it is not specified, then it falls back to getting the ciphersuites from the sslContextParameters object." }, - "clientAuthentication": { "index": 14, "kind": "parameter", "displayName": "Client Authentication", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "org.eclipse.californium.elements.config.CertificateAuthenticationMode", "enum": [ "NONE", "WANTED", "NEEDED" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the configuration options for server-side client-authentication requirements. The value must be one of NONE [...] - "privateKey": { "index": 15, "kind": "parameter", "displayName": "Private Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PrivateKey", "deprecated": false, "autowired": false, "secret": true, "description": "Set the configured private key for use with Raw Public Key." }, - "publicKey": { "index": 16, "kind": "parameter", "displayName": "Public Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PublicKey", "deprecated": false, "autowired": false, "secret": false, "description": "Set the configured public key for use with Raw Public Key." }, - "recommendedCipherSuitesOnly": { "index": 17, "kind": "parameter", "displayName": "Recommended Cipher Suites Only", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "The CBC cipher suites are not recommended. If you want to use them, you first need to set the recommendedCipherSuitesOnly option to false." }, - "sslContextParameters": { "index": 18, "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, "description": "Set the SSLContextParameters object for setting up TLS. This is required for coapstcp, and for coaps when we are using certificates for TLS (as opposed to RPK or PKS)." } + "headerFilterStrategy": { "index": 10, "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, "description": "To use a custom HeaderFilterStrategy to filter header to and from Camel message." }, + "advancedCertificateVerifier": { "index": 11, "kind": "parameter", "displayName": "Advanced Certificate Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.x509.NewAdvancedCertificateVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedCertificateVerifier to use to determine trust in raw public keys." }, + "advancedPskStore": { "index": 12, "kind": "parameter", "displayName": "Advanced Psk Store", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.pskstore.AdvancedPskStore", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedPskStore to use for pre-shared key." }, + "alias": { "index": 13, "kind": "parameter", "displayName": "Alias", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "NONE", "WANT", "REQUIRE" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the alias used to query the KeyStore for the private key and certificate. This parameter is used when we are enabling TLS with certificates on the service side, and similarly on the client sid [...] + "cipherSuites": { "index": 14, "kind": "parameter", "displayName": "Cipher Suites", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the cipherSuites String. This is a comma separated String of ciphersuites to configure. If it is not specified, then it falls back to getting the ciphersuites from the sslContextParameters object." }, + "clientAuthentication": { "index": 15, "kind": "parameter", "displayName": "Client Authentication", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "org.eclipse.californium.elements.config.CertificateAuthenticationMode", "enum": [ "NONE", "WANTED", "NEEDED" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the configuration options for server-side client-authentication requirements. The value must be one of NONE [...] + "privateKey": { "index": 16, "kind": "parameter", "displayName": "Private Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PrivateKey", "deprecated": false, "autowired": false, "secret": true, "description": "Set the configured private key for use with Raw Public Key." }, + "publicKey": { "index": 17, "kind": "parameter", "displayName": "Public Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PublicKey", "deprecated": false, "autowired": false, "secret": false, "description": "Set the configured public key for use with Raw Public Key." }, + "recommendedCipherSuitesOnly": { "index": 18, "kind": "parameter", "displayName": "Recommended Cipher Suites Only", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "The CBC cipher suites are not recommended. If you want to use them, you first need to set the recommendedCipherSuitesOnly option to false." }, + "sslContextParameters": { "index": 19, "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, "description": "Set the SSLContextParameters object for setting up TLS. This is required for coapstcp, and for coaps when we are using certificates for TLS (as opposed to RPK or PKS)." } } } diff --git a/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coaps+tcp.json b/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coaps+tcp.json index 575d35e40843..1b784f71a304 100644 --- a/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coaps+tcp.json +++ b/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coaps+tcp.json @@ -29,7 +29,8 @@ "bridgeErrorHandler": { "index": 1, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the like [...] "lazyStartProducer": { "index": 2, "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 [...] "client": { "index": 3, "kind": "property", "displayName": "Client", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "object", "javaType": "org.eclipse.californium.core.CoapClient", "deprecated": false, "autowired": false, "secret": false, "description": "To use a shared client for the producers" }, - "autowiredEnabled": { "index": 4, "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": 4, "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 [...] + "headerFilterStrategy": { "index": 5, "kind": "property", "displayName": "Header Filter Strategy", "group": "filter", "label": "filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message." } }, "headers": { "CamelCoapETag": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "byte[]", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The CoAP ETag for the response.", "constantName": "org.apache.camel.coap.CoAPConstants#COAP_ETAG" }, @@ -49,14 +50,15 @@ "notify": { "index": 7, "kind": "parameter", "displayName": "Notify", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Notify observers that the resource of this URI has changed, based on RFC 7641. Use this flag on a destination endpoint, with a URI that matches an existing source endpoint URI." }, "client": { "index": 8, "kind": "parameter", "displayName": "Client", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "object", "javaType": "org.eclipse.californium.core.CoapClient", "deprecated": false, "autowired": false, "secret": false, "description": "To use a shared client for the producers" }, "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 [...] - "advancedCertificateVerifier": { "index": 10, "kind": "parameter", "displayName": "Advanced Certificate Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.x509.NewAdvancedCertificateVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedCertificateVerifier to use to determine trust in raw public keys." }, - "advancedPskStore": { "index": 11, "kind": "parameter", "displayName": "Advanced Psk Store", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.pskstore.AdvancedPskStore", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedPskStore to use for pre-shared key." }, - "alias": { "index": 12, "kind": "parameter", "displayName": "Alias", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "NONE", "WANT", "REQUIRE" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the alias used to query the KeyStore for the private key and certificate. This parameter is used when we are enabling TLS with certificates on the service side, and similarly on the client sid [...] - "cipherSuites": { "index": 13, "kind": "parameter", "displayName": "Cipher Suites", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the cipherSuites String. This is a comma separated String of ciphersuites to configure. If it is not specified, then it falls back to getting the ciphersuites from the sslContextParameters object." }, - "clientAuthentication": { "index": 14, "kind": "parameter", "displayName": "Client Authentication", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "org.eclipse.californium.elements.config.CertificateAuthenticationMode", "enum": [ "NONE", "WANTED", "NEEDED" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the configuration options for server-side client-authentication requirements. The value must be one of NONE [...] - "privateKey": { "index": 15, "kind": "parameter", "displayName": "Private Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PrivateKey", "deprecated": false, "autowired": false, "secret": true, "description": "Set the configured private key for use with Raw Public Key." }, - "publicKey": { "index": 16, "kind": "parameter", "displayName": "Public Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PublicKey", "deprecated": false, "autowired": false, "secret": false, "description": "Set the configured public key for use with Raw Public Key." }, - "recommendedCipherSuitesOnly": { "index": 17, "kind": "parameter", "displayName": "Recommended Cipher Suites Only", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "The CBC cipher suites are not recommended. If you want to use them, you first need to set the recommendedCipherSuitesOnly option to false." }, - "sslContextParameters": { "index": 18, "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, "description": "Set the SSLContextParameters object for setting up TLS. This is required for coapstcp, and for coaps when we are using certificates for TLS (as opposed to RPK or PKS)." } + "headerFilterStrategy": { "index": 10, "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, "description": "To use a custom HeaderFilterStrategy to filter header to and from Camel message." }, + "advancedCertificateVerifier": { "index": 11, "kind": "parameter", "displayName": "Advanced Certificate Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.x509.NewAdvancedCertificateVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedCertificateVerifier to use to determine trust in raw public keys." }, + "advancedPskStore": { "index": 12, "kind": "parameter", "displayName": "Advanced Psk Store", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.pskstore.AdvancedPskStore", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedPskStore to use for pre-shared key." }, + "alias": { "index": 13, "kind": "parameter", "displayName": "Alias", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "NONE", "WANT", "REQUIRE" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the alias used to query the KeyStore for the private key and certificate. This parameter is used when we are enabling TLS with certificates on the service side, and similarly on the client sid [...] + "cipherSuites": { "index": 14, "kind": "parameter", "displayName": "Cipher Suites", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the cipherSuites String. This is a comma separated String of ciphersuites to configure. If it is not specified, then it falls back to getting the ciphersuites from the sslContextParameters object." }, + "clientAuthentication": { "index": 15, "kind": "parameter", "displayName": "Client Authentication", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "org.eclipse.californium.elements.config.CertificateAuthenticationMode", "enum": [ "NONE", "WANTED", "NEEDED" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the configuration options for server-side client-authentication requirements. The value must be one of NONE [...] + "privateKey": { "index": 16, "kind": "parameter", "displayName": "Private Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PrivateKey", "deprecated": false, "autowired": false, "secret": true, "description": "Set the configured private key for use with Raw Public Key." }, + "publicKey": { "index": 17, "kind": "parameter", "displayName": "Public Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PublicKey", "deprecated": false, "autowired": false, "secret": false, "description": "Set the configured public key for use with Raw Public Key." }, + "recommendedCipherSuitesOnly": { "index": 18, "kind": "parameter", "displayName": "Recommended Cipher Suites Only", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "The CBC cipher suites are not recommended. If you want to use them, you first need to set the recommendedCipherSuitesOnly option to false." }, + "sslContextParameters": { "index": 19, "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, "description": "Set the SSLContextParameters object for setting up TLS. This is required for coapstcp, and for coaps when we are using certificates for TLS (as opposed to RPK or PKS)." } } } diff --git a/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coaps.json b/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coaps.json index f4daf9b59fbc..935ccf7054f9 100644 --- a/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coaps.json +++ b/components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coaps.json @@ -29,7 +29,8 @@ "bridgeErrorHandler": { "index": 1, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the like [...] "lazyStartProducer": { "index": 2, "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 [...] "client": { "index": 3, "kind": "property", "displayName": "Client", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "object", "javaType": "org.eclipse.californium.core.CoapClient", "deprecated": false, "autowired": false, "secret": false, "description": "To use a shared client for the producers" }, - "autowiredEnabled": { "index": 4, "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": 4, "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 [...] + "headerFilterStrategy": { "index": 5, "kind": "property", "displayName": "Header Filter Strategy", "group": "filter", "label": "filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message." } }, "headers": { "CamelCoapETag": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "byte[]", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The CoAP ETag for the response.", "constantName": "org.apache.camel.coap.CoAPConstants#COAP_ETAG" }, @@ -49,14 +50,15 @@ "notify": { "index": 7, "kind": "parameter", "displayName": "Notify", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Notify observers that the resource of this URI has changed, based on RFC 7641. Use this flag on a destination endpoint, with a URI that matches an existing source endpoint URI." }, "client": { "index": 8, "kind": "parameter", "displayName": "Client", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "object", "javaType": "org.eclipse.californium.core.CoapClient", "deprecated": false, "autowired": false, "secret": false, "description": "To use a shared client for the producers" }, "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 [...] - "advancedCertificateVerifier": { "index": 10, "kind": "parameter", "displayName": "Advanced Certificate Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.x509.NewAdvancedCertificateVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedCertificateVerifier to use to determine trust in raw public keys." }, - "advancedPskStore": { "index": 11, "kind": "parameter", "displayName": "Advanced Psk Store", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.pskstore.AdvancedPskStore", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedPskStore to use for pre-shared key." }, - "alias": { "index": 12, "kind": "parameter", "displayName": "Alias", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "NONE", "WANT", "REQUIRE" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the alias used to query the KeyStore for the private key and certificate. This parameter is used when we are enabling TLS with certificates on the service side, and similarly on the client sid [...] - "cipherSuites": { "index": 13, "kind": "parameter", "displayName": "Cipher Suites", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the cipherSuites String. This is a comma separated String of ciphersuites to configure. If it is not specified, then it falls back to getting the ciphersuites from the sslContextParameters object." }, - "clientAuthentication": { "index": 14, "kind": "parameter", "displayName": "Client Authentication", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "org.eclipse.californium.elements.config.CertificateAuthenticationMode", "enum": [ "NONE", "WANTED", "NEEDED" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the configuration options for server-side client-authentication requirements. The value must be one of NONE [...] - "privateKey": { "index": 15, "kind": "parameter", "displayName": "Private Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PrivateKey", "deprecated": false, "autowired": false, "secret": true, "description": "Set the configured private key for use with Raw Public Key." }, - "publicKey": { "index": 16, "kind": "parameter", "displayName": "Public Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PublicKey", "deprecated": false, "autowired": false, "secret": false, "description": "Set the configured public key for use with Raw Public Key." }, - "recommendedCipherSuitesOnly": { "index": 17, "kind": "parameter", "displayName": "Recommended Cipher Suites Only", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "The CBC cipher suites are not recommended. If you want to use them, you first need to set the recommendedCipherSuitesOnly option to false." }, - "sslContextParameters": { "index": 18, "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, "description": "Set the SSLContextParameters object for setting up TLS. This is required for coapstcp, and for coaps when we are using certificates for TLS (as opposed to RPK or PKS)." } + "headerFilterStrategy": { "index": 10, "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, "description": "To use a custom HeaderFilterStrategy to filter header to and from Camel message." }, + "advancedCertificateVerifier": { "index": 11, "kind": "parameter", "displayName": "Advanced Certificate Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.x509.NewAdvancedCertificateVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedCertificateVerifier to use to determine trust in raw public keys." }, + "advancedPskStore": { "index": 12, "kind": "parameter", "displayName": "Advanced Psk Store", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.californium.scandium.dtls.pskstore.AdvancedPskStore", "deprecated": false, "autowired": false, "secret": false, "description": "Set the AdvancedPskStore to use for pre-shared key." }, + "alias": { "index": 13, "kind": "parameter", "displayName": "Alias", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "NONE", "WANT", "REQUIRE" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the alias used to query the KeyStore for the private key and certificate. This parameter is used when we are enabling TLS with certificates on the service side, and similarly on the client sid [...] + "cipherSuites": { "index": 14, "kind": "parameter", "displayName": "Cipher Suites", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the cipherSuites String. This is a comma separated String of ciphersuites to configure. If it is not specified, then it falls back to getting the ciphersuites from the sslContextParameters object." }, + "clientAuthentication": { "index": 15, "kind": "parameter", "displayName": "Client Authentication", "group": "security", "label": "security", "required": false, "type": "enum", "javaType": "org.eclipse.californium.elements.config.CertificateAuthenticationMode", "enum": [ "NONE", "WANTED", "NEEDED" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the configuration options for server-side client-authentication requirements. The value must be one of NONE [...] + "privateKey": { "index": 16, "kind": "parameter", "displayName": "Private Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PrivateKey", "deprecated": false, "autowired": false, "secret": true, "description": "Set the configured private key for use with Raw Public Key." }, + "publicKey": { "index": 17, "kind": "parameter", "displayName": "Public Key", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.PublicKey", "deprecated": false, "autowired": false, "secret": false, "description": "Set the configured public key for use with Raw Public Key." }, + "recommendedCipherSuitesOnly": { "index": 18, "kind": "parameter", "displayName": "Recommended Cipher Suites Only", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "The CBC cipher suites are not recommended. If you want to use them, you first need to set the recommendedCipherSuitesOnly option to false." }, + "sslContextParameters": { "index": 19, "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, "description": "Set the SSLContextParameters object for setting up TLS. This is required for coapstcp, and for coaps when we are using certificates for TLS (as opposed to RPK or PKS)." } } } diff --git a/components/camel-coap/src/main/java/org/apache/camel/coap/CamelCoapResource.java b/components/camel-coap/src/main/java/org/apache/camel/coap/CamelCoapResource.java index 25cd4fc109aa..161d8612c357 100644 --- a/components/camel-coap/src/main/java/org/apache/camel/coap/CamelCoapResource.java +++ b/components/camel-coap/src/main/java/org/apache/camel/coap/CamelCoapResource.java @@ -22,6 +22,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.apache.camel.Message; +import org.apache.camel.spi.HeaderFilterStrategy; import org.eclipse.californium.core.CoapResource; import org.eclipse.californium.core.coap.CoAP.ResponseCode; import org.eclipse.californium.core.coap.MediaTypeRegistry; @@ -99,13 +100,22 @@ final class CamelCoapResource extends CoapResource { camelExchange = consumer.createExchange(false); consumer.createUoW(camelExchange); + HeaderFilterStrategy strategy = consumer.getCoapEndpoint().getHeaderFilterStrategy(); OptionSet options = exchange.getRequest().getOptions(); for (String s : options.getUriQuery()) { int i = s.indexOf('='); + String name; + String value; if (i == -1) { - camelExchange.getIn().setHeader(s, ""); + name = s; + value = ""; } else { - camelExchange.getIn().setHeader(s.substring(0, i), s.substring(i + 1)); + name = s.substring(0, i); + value = s.substring(i + 1); + } + if (strategy == null + || !strategy.applyFilterToExternalHeaders(name, value, camelExchange)) { + camelExchange.getIn().setHeader(name, value); } } diff --git a/components/camel-coap/src/main/java/org/apache/camel/coap/CoAPComponent.java b/components/camel-coap/src/main/java/org/apache/camel/coap/CoAPComponent.java index 4b0b19cd9d68..19adfe6da90b 100644 --- a/components/camel-coap/src/main/java/org/apache/camel/coap/CoAPComponent.java +++ b/components/camel-coap/src/main/java/org/apache/camel/coap/CoAPComponent.java @@ -32,6 +32,8 @@ import org.apache.camel.CamelContext; import org.apache.camel.Consumer; import org.apache.camel.Endpoint; import org.apache.camel.Processor; +import org.apache.camel.spi.HeaderFilterStrategy; +import org.apache.camel.spi.HeaderFilterStrategyAware; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.RestConfiguration; import org.apache.camel.spi.RestConsumerFactory; @@ -59,7 +61,7 @@ import org.slf4j.LoggerFactory; * Represents the component that manages {@link CoAPEndpoint}. */ @Component("coap,coaps,coap+tcp,coaps+tcp") -public class CoAPComponent extends DefaultComponent implements RestConsumerFactory { +public class CoAPComponent extends DefaultComponent implements RestConsumerFactory, HeaderFilterStrategyAware { static final int DEFAULT_PORT = 5684; private static final Logger LOG = LoggerFactory.getLogger(CoAPComponent.class); @@ -67,6 +69,9 @@ public class CoAPComponent extends DefaultComponent implements RestConsumerFacto private String configurationFile; @Metadata(label = "producer,advanced") private CoapClient client; + @Metadata(label = "filter", + description = "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message.") + private HeaderFilterStrategy headerFilterStrategy; final Map<Integer, CoapServer> servers = new ConcurrentHashMap<>(); @@ -156,10 +161,26 @@ public class CoAPComponent extends DefaultComponent implements RestConsumerFacto coapBuilder.setConnector(connector); } + @Override + public HeaderFilterStrategy getHeaderFilterStrategy() { + return headerFilterStrategy; + } + + /** + * To use a custom {@link org.apache.camel.spi.HeaderFilterStrategy} to filter header to and from Camel message. + */ + @Override + public void setHeaderFilterStrategy(HeaderFilterStrategy headerFilterStrategy) { + this.headerFilterStrategy = headerFilterStrategy; + } + @Override protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { CoAPEndpoint endpoint = new CoAPEndpoint(uri, this); endpoint.setClient(client); + if (headerFilterStrategy != null) { + endpoint.setHeaderFilterStrategy(headerFilterStrategy); + } setProperties(endpoint, parameters); return endpoint; } diff --git a/components/camel-coap/src/main/java/org/apache/camel/coap/CoAPEndpoint.java b/components/camel-coap/src/main/java/org/apache/camel/coap/CoAPEndpoint.java index 929d2694fb92..fa3d2690d8ed 100644 --- a/components/camel-coap/src/main/java/org/apache/camel/coap/CoAPEndpoint.java +++ b/components/camel-coap/src/main/java/org/apache/camel/coap/CoAPEndpoint.java @@ -38,6 +38,8 @@ import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.spi.EndpointServiceLocation; +import org.apache.camel.spi.HeaderFilterStrategy; +import org.apache.camel.spi.HeaderFilterStrategyAware; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.spi.UriPath; @@ -76,7 +78,7 @@ import static org.eclipse.californium.scandium.config.DtlsConfig.DTLS_RECOMMENDE */ @UriEndpoint(firstVersion = "2.16.0", scheme = "coap,coaps,coap+tcp,coaps+tcp", title = "CoAP", syntax = "coap:uri", category = { Category.IOT }, headersClass = CoAPConstants.class) -public class CoAPEndpoint extends DefaultEndpoint implements EndpointServiceLocation { +public class CoAPEndpoint extends DefaultEndpoint implements EndpointServiceLocation, HeaderFilterStrategyAware { final static Logger LOGGER = LoggerFactory.getLogger(CoAPEndpoint.class); @UriPath private URI uri; @@ -109,6 +111,9 @@ public class CoAPEndpoint extends DefaultEndpoint implements EndpointServiceLoca private boolean notify; @UriParam(label = "producer,advanced") private CoapClient client; + @UriParam(label = "advanced", + description = "To use a custom HeaderFilterStrategy to filter header to and from Camel message.") + private HeaderFilterStrategy headerFilterStrategy; private CoAPComponent component; @@ -272,6 +277,22 @@ public class CoAPEndpoint extends DefaultEndpoint implements EndpointServiceLoca this.client = client; } + @Override + public HeaderFilterStrategy getHeaderFilterStrategy() { + if (headerFilterStrategy == null) { + headerFilterStrategy = new CoAPHeaderFilterStrategy(); + } + return headerFilterStrategy; + } + + /** + * To use a custom {@link org.apache.camel.spi.HeaderFilterStrategy} to filter header to and from Camel message. + */ + @Override + public void setHeaderFilterStrategy(HeaderFilterStrategy headerFilterStrategy) { + this.headerFilterStrategy = headerFilterStrategy; + } + /** * Get the SSLContextParameters object for setting up TLS. This is required for coaps+tcp, and for coaps when we are * using certificates for TLS (as opposed to RPK or PKS). diff --git a/components/camel-coap/src/main/java/org/apache/camel/coap/CoAPHeaderFilterStrategy.java b/components/camel-coap/src/main/java/org/apache/camel/coap/CoAPHeaderFilterStrategy.java new file mode 100644 index 000000000000..8df5f09fd979 --- /dev/null +++ b/components/camel-coap/src/main/java/org/apache/camel/coap/CoAPHeaderFilterStrategy.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.coap; + +import org.apache.camel.support.DefaultHeaderFilterStrategy; + +/** + * Default header filter strategy for CoAP endpoints. + * <p> + * Filters out Camel internal headers (starting with "Camel" or "camel") in both directions to prevent external CoAP + * clients from injecting internal Camel headers via query parameters. + */ +public class CoAPHeaderFilterStrategy extends DefaultHeaderFilterStrategy { + + public CoAPHeaderFilterStrategy() { + setOutFilterStartsWith(CAMEL_FILTER_STARTS_WITH); + setInFilterStartsWith(CAMEL_FILTER_STARTS_WITH); + } +}
