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 2022/03/01 17:50:49 UTC

[camel-spring-boot] branch main updated (4207d9c -> ce3f53f)

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

acosentino pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git.


    from 4207d9c  Regen
     new b6e35bd  CAMEL-17684 - Support ability to load properties from Vault/Secrets cloud services - GCP Secrets Manager - Spring Boot Support
     new 8fb0ad4  CAMEL-17684 - Support ability to load properties from Vault/Secrets cloud services - GCP Secrets Manager - Spring Boot Support
     new e11b747  CAMEL-17684 - Support ability to load properties from Vault/Secrets cloud services - GCP Secrets Manager - Spring Boot Support
     new ce3f53f  CAMEL-17684 - Support ability to load properties from Vault/Secrets cloud services - GCP Secrets Manager - Spring Boot Support

The 4 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.


Summary of changes:
 .../src/main/docs/spring-boot.json                 | 17 +++++++++++
 ...uration.java => GcpVaultAutoConfiguration.java} | 15 +++++-----
 .../GcpVaultConfigurationProperties.java}          | 34 +++++++++++++---------
 .../src/main/resources/META-INF/spring.factories   |  3 +-
 ...ionTest.java => GcpVaultConfigurationTest.java} | 18 +++++-------
 5 files changed, 54 insertions(+), 33 deletions(-)
 copy core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/{AwsVaultAutoConfiguration.java => GcpVaultAutoConfiguration.java} (76%)
 copy core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/{routetemplate/CamelRouteTemplateConfigurationProperties.java => vault/GcpVaultConfigurationProperties.java} (58%)
 copy core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/{AwsVaultConfigurationTest.java => GcpVaultConfigurationTest.java} (64%)

[camel-spring-boot] 02/04: CAMEL-17684 - Support ability to load properties from Vault/Secrets cloud services - GCP Secrets Manager - Spring Boot Support

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

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git

commit 8fb0ad4071321236d1477004ea8089ebaf52777e
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Mar 1 18:44:09 2022 +0100

    CAMEL-17684 - Support ability to load properties from Vault/Secrets cloud services - GCP Secrets Manager - Spring Boot Support
---
 .../boot/vault/GcpVaultAutoConfiguration.java      | 42 +++++++++++++++++++
 .../vault/GcpVaultConfigurationProperties.java     | 49 ++++++++++++++++++++++
 .../boot/vault/GcpVaultConfigurationTest.java      | 48 +++++++++++++++++++++
 3 files changed, 139 insertions(+)

diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/GcpVaultAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/GcpVaultAutoConfiguration.java
new file mode 100644
index 0000000..5318a3f
--- /dev/null
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/GcpVaultAutoConfiguration.java
@@ -0,0 +1,42 @@
+/*
+ * 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.spring.boot.vault;
+
+import org.apache.camel.spring.boot.CamelAutoConfiguration;
+import org.apache.camel.vault.AwsVaultConfiguration;
+import org.apache.camel.vault.GcpVaultConfiguration;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration(proxyBeanMethods = false)
+@ConditionalOnBean(CamelAutoConfiguration.class)
+@EnableConfigurationProperties(GcpVaultConfigurationProperties.class)
+@AutoConfigureAfter(CamelAutoConfiguration.class)
+public class GcpVaultAutoConfiguration {
+
+    @Bean
+    public GcpVaultConfiguration gcpVaultConfiguration(GcpVaultConfigurationProperties config) {
+        GcpVaultConfiguration answer = new GcpVaultConfiguration();
+        answer.setServiceAccountKey(config.getServiceAccountKey());
+        answer.setProjectId(config.getProjectId());
+        return answer;
+    }
+
+}
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/GcpVaultConfigurationProperties.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/GcpVaultConfigurationProperties.java
new file mode 100644
index 0000000..83421a1
--- /dev/null
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/GcpVaultConfigurationProperties.java
@@ -0,0 +1,49 @@
+/*
+ * 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.spring.boot.vault;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+@ConfigurationProperties(prefix = "camel.vault.gcp")
+public class GcpVaultConfigurationProperties {
+
+    /**
+     * The Service Account Key location
+     */
+    private String serviceAccountKey;
+
+    /**
+     * The GCP Project ID
+     */
+    private String projectId;
+
+    public String getServiceAccountKey() {
+        return serviceAccountKey;
+    }
+
+    public void setServiceAccountKey(String serviceAccountKey) {
+        this.serviceAccountKey = serviceAccountKey;
+    }
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+}
diff --git a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/GcpVaultConfigurationTest.java b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/GcpVaultConfigurationTest.java
new file mode 100644
index 0000000..2ba1df8
--- /dev/null
+++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/GcpVaultConfigurationTest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.spring.boot.vault;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.annotation.DirtiesContext;
+
+@DirtiesContext
+@CamelSpringBootTest
+@EnableAutoConfiguration
+@SpringBootTest(
+        classes = {
+                GcpVaultConfigurationTest.class},
+        properties = {
+                "camel.vault.gcp.serviceAccountKey=file:////key.json",
+                "camel.vault.aws.projectId=gcp-project"}
+)
+public class GcpVaultConfigurationTest {
+
+    @Autowired
+    private CamelContext camelContext;
+
+    @Test
+    public void testGcpVault() throws Exception {
+        Assertions.assertEquals("file:////key.json", camelContext.getVaultConfiguration().gcp().getServiceAccountKey());
+        Assertions.assertEquals("gcp-project", camelContext.getVaultConfiguration().gcp().getProjectId());
+    }
+}

[camel-spring-boot] 03/04: CAMEL-17684 - Support ability to load properties from Vault/Secrets cloud services - GCP Secrets Manager - Spring Boot Support

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

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git

commit e11b747f53b14a77388bb757a13a5f846b263856
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Mar 1 18:46:11 2022 +0100

    CAMEL-17684 - Support ability to load properties from Vault/Secrets cloud services - GCP Secrets Manager - Spring Boot Support
---
 .../org/apache/camel/spring/boot/vault/GcpVaultConfigurationTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/GcpVaultConfigurationTest.java b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/GcpVaultConfigurationTest.java
index 2ba1df8..c3f244d 100644
--- a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/GcpVaultConfigurationTest.java
+++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/GcpVaultConfigurationTest.java
@@ -33,7 +33,7 @@ import org.springframework.test.annotation.DirtiesContext;
                 GcpVaultConfigurationTest.class},
         properties = {
                 "camel.vault.gcp.serviceAccountKey=file:////key.json",
-                "camel.vault.aws.projectId=gcp-project"}
+                "camel.vault.gcp.projectId=gcp-project"}
 )
 public class GcpVaultConfigurationTest {
 

[camel-spring-boot] 04/04: CAMEL-17684 - Support ability to load properties from Vault/Secrets cloud services - GCP Secrets Manager - Spring Boot Support

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

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git

commit ce3f53fe7150df35fda325c2aab1948dcc5f7fbc
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Mar 1 18:47:34 2022 +0100

    CAMEL-17684 - Support ability to load properties from Vault/Secrets cloud services - GCP Secrets Manager - Spring Boot Support
---
 core/camel-spring-boot/src/main/docs/spring-boot.json | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/core/camel-spring-boot/src/main/docs/spring-boot.json b/core/camel-spring-boot/src/main/docs/spring-boot.json
index 308c13a..f7869fa 100644
--- a/core/camel-spring-boot/src/main/docs/spring-boot.json
+++ b/core/camel-spring-boot/src/main/docs/spring-boot.json
@@ -120,6 +120,11 @@
       "sourceType": "org.apache.camel.spring.boot.vault.AwsVaultConfigurationProperties"
     },
     {
+      "name": "camel.vault.gcp",
+      "type": "org.apache.camel.spring.boot.vault.GcpVaultConfigurationProperties",
+      "sourceType": "org.apache.camel.spring.boot.vault.GcpVaultConfigurationProperties"
+    },
+    {
       "name": "management.endpoint.camelroutecontroller",
       "type": "org.apache.camel.spring.boot.actuate.endpoint.CamelRouteControllerEndpoint",
       "sourceType": "org.apache.camel.spring.boot.actuate.endpoint.CamelRouteControllerEndpoint"
@@ -1326,6 +1331,18 @@
       "sourceType": "org.apache.camel.spring.boot.vault.AwsVaultConfigurationProperties"
     },
     {
+      "name": "camel.vault.gcp.project-id",
+      "type": "java.lang.String",
+      "description": "The GCP Project ID",
+      "sourceType": "org.apache.camel.spring.boot.vault.GcpVaultConfigurationProperties"
+    },
+    {
+      "name": "camel.vault.gcp.service-account-key",
+      "type": "java.lang.String",
+      "description": "The Service Account Key location",
+      "sourceType": "org.apache.camel.spring.boot.vault.GcpVaultConfigurationProperties"
+    },
+    {
       "name": "management.endpoint.camelroutecontroller.cache.time-to-live",
       "type": "java.time.Duration",
       "description": "Maximum time that a response can be cached.",

[camel-spring-boot] 01/04: CAMEL-17684 - Support ability to load properties from Vault/Secrets cloud services - GCP Secrets Manager - Spring Boot Support

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

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git

commit b6e35bdc22f5083d7d2245b79b3e29dd5fcd3b93
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Mar 1 18:43:50 2022 +0100

    CAMEL-17684 - Support ability to load properties from Vault/Secrets cloud services - GCP Secrets Manager - Spring Boot Support
---
 core/camel-spring-boot/src/main/resources/META-INF/spring.factories | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/core/camel-spring-boot/src/main/resources/META-INF/spring.factories b/core/camel-spring-boot/src/main/resources/META-INF/spring.factories
index dff7aee..f1b6afc 100644
--- a/core/camel-spring-boot/src/main/resources/META-INF/spring.factories
+++ b/core/camel-spring-boot/src/main/resources/META-INF/spring.factories
@@ -47,5 +47,6 @@ org.apache.camel.spring.boot.properties.PropertiesComponentAutoConfiguration,\
 org.apache.camel.spring.boot.security.CamelSSLAutoConfiguration,\
 org.apache.camel.spring.boot.threadpool.CamelThreadPoolAutoConfiguration,\
 org.apache.camel.spring.boot.routetemplate.CamelRouteTemplateAutoConfiguration,\
-org.apache.camel.spring.boot.vault.AwsVaultAutoConfiguration
+org.apache.camel.spring.boot.vault.AwsVaultAutoConfiguration, \
+org.apache.camel.spring.boot.vault.GcpVaultAutoConfiguration