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 2022/08/11 08:57:46 UTC

[camel] branch CAMEL-18370 created (now 41cf2f966c7)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch CAMEL-18370
in repository https://gitbox.apache.org/repos/asf/camel.git


      at 41cf2f966c7 CAMEL-18370: camel-kamelet - RAW parameters are not resolved which causes the parameter to have RAW(xxx) as the value.

This branch includes the following new commits:

     new 7d5b42a5ca8 Polished
     new 41cf2f966c7 CAMEL-18370: camel-kamelet - RAW parameters are not resolved which causes the parameter to have RAW(xxx) as the value.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[camel] 02/02: CAMEL-18370: camel-kamelet - RAW parameters are not resolved which causes the parameter to have RAW(xxx) as the value.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch CAMEL-18370
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 41cf2f966c78c350da68372b8cc8040cd21f22b4
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 11 10:57:23 2022 +0200

    CAMEL-18370: camel-kamelet - RAW parameters are not resolved which causes the parameter to have RAW(xxx) as the value.
---
 .../java/org/apache/camel/component/kamelet/KameletComponent.java  | 7 +++++++
 .../camel/component/kamelet/KameletGlobalPropertiesTest.java       | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletComponent.java b/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletComponent.java
index b7008e42ca0..677a397f62b 100644
--- a/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletComponent.java
+++ b/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletComponent.java
@@ -41,6 +41,7 @@ import org.apache.camel.support.LifecycleStrategySupport;
 import org.apache.camel.support.RouteTemplateHelper;
 import org.apache.camel.support.service.ServiceHelper;
 import org.apache.camel.util.StopWatch;
+import org.apache.camel.util.URISupport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -108,6 +109,12 @@ public class KameletComponent extends DefaultComponent {
         parameters.remove(PARAM_ROUTE_ID);
         parameters.remove(PARAM_LOCATION);
 
+        // manually need to resolve raw parameters as input to the kamelet because
+        // resolveRawParameterValues is false
+        // this ensures that parameters such as passwords are used as-is and not encoded
+        // but this requires to use RAW() syntax in the kamelet template.
+        URISupport.resolveRawParameterValues(parameters);
+
         final KameletEndpoint endpoint;
 
         if (Kamelet.SOURCE_ID.equals(remaining) || Kamelet.SINK_ID.equals(remaining)) {
diff --git a/components/camel-kamelet/src/test/java/org/apache/camel/component/kamelet/KameletGlobalPropertiesTest.java b/components/camel-kamelet/src/test/java/org/apache/camel/component/kamelet/KameletGlobalPropertiesTest.java
index b713f1184fd..471a763cb2f 100644
--- a/components/camel-kamelet/src/test/java/org/apache/camel/component/kamelet/KameletGlobalPropertiesTest.java
+++ b/components/camel-kamelet/src/test/java/org/apache/camel/component/kamelet/KameletGlobalPropertiesTest.java
@@ -163,7 +163,7 @@ public class KameletGlobalPropertiesTest extends CamelTestSupport {
                         .templateParameter("proxyPwd")
                         .from("kamelet:source")
                         .log("info")
-                        .to("http://localhost:8080?proxyAuthUsername={{proxyUsr}}&proxyAuthPassword={{proxyPwd}}");
+                        .to("http://localhost:8080?proxyAuthUsername=RAW({{proxyUsr}})&proxyAuthPassword=RAW({{proxyPwd}})");
 
                 // template
                 routeTemplate("timer-source")


[camel] 01/02: Polished

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch CAMEL-18370
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 7d5b42a5ca8980f5576e16a114dd465e28feec65
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 11 10:34:53 2022 +0200

    Polished
---
 .../main/java/org/apache/camel/component/kamelet/KameletComponent.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletComponent.java b/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletComponent.java
index 054b383ffcc..b7008e42ca0 100644
--- a/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletComponent.java
+++ b/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletComponent.java
@@ -218,7 +218,7 @@ public class KameletComponent extends DefaultComponent {
 
             //
             // Add a custom converter to convert a RouteTemplateDefinition to a RouteDefinition
-            // and make sure consumerU URIs are unique.
+            // and make sure consumer URIs are unique.
             //
             getCamelContext().adapt(ModelCamelContext.class).addRouteTemplateDefinitionConverter(
                     templateId,