You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2024/09/10 12:51:56 UTC
(camel) 03/05: CAMEL-21179 - Secret Properties Functions: Supporting secret name containing "/" - Google Secret Manager
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch CAMEL-21179-gcp
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 0842aed1596ce72d5cfc2ef6e5d82c1afed0ad06
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Sep 10 14:36:14 2024 +0200
CAMEL-21179 - Secret Properties Functions: Supporting secret name containing "/" - Google Secret Manager
Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
...ogleSecretManagerPropertiesNoEnvSourceTestIT.java | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesNoEnvSourceTestIT.java b/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesNoEnvSourceTestIT.java
index 679b7e5b88c..11e3637874b 100644
--- a/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesNoEnvSourceTestIT.java
+++ b/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesNoEnvSourceTestIT.java
@@ -308,4 +308,24 @@ public class GoogleSecretManagerPropertiesNoEnvSourceTestIT extends CamelTestSup
template.sendBody("direct:version", "Hello World");
MockEndpoint.assertIsSatisfied(context);
}
+
+ @Test
+ public void testComplexCustomPropertiesFunctionWithSlash() throws Exception {
+ context.getVaultConfiguration().gcp().setServiceAccountKey(System.getProperty("camel.vault.gcp.serviceAccountKey"));
+ context.getVaultConfiguration().gcp().setProjectId(System.getProperty("camel.vault.gcp.projectId"));
+ context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:username").setBody(simple("{{gcp:postgresql_account_admin_prod#username}}")).to("mock:bar");
+ from("direct:password").setBody(simple("{{gcp:postgresql_account_admin_prod#password}}")).to("mock:bar");
+ }
+ });
+ context.start();
+
+ getMockEndpoint("mock:bar").expectedBodiesReceived("admin", "secret");
+
+ template.sendBody("direct:username", "Hello World");
+ template.sendBody("direct:password", "Hello World");
+ MockEndpoint.assertIsSatisfied(context);
+ }
}