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 <claus.ib...@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")