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.git

commit dd5fa6f956cd334c0cae30f4300ff06a027aba9b
Author: Andrea Cosentino <[email protected]>
AuthorDate: Tue Mar 1 13:12:05 2022 +0100

    CAMEL-17684 - Support ability to load properties from Vault/Secrets cloud 
services - GCP Secrets Manager
---
 .../main/camel-main-configuration-metadata.json    |  5 ++-
 .../AwsVaultConfigurationPropertiesConfigurer.java |  6 +++
 ...GcpVaultConfigurationPropertiesConfigurer.java} | 50 ++++++++++------------
 .../camel-main-configuration-metadata.json         |  5 ++-
 ...ache.camel.main.GcpVaultConfigurationProperties |  2 +
 core/camel-main/src/main/docs/main.adoc            | 10 +++++
 .../main/GcpVaultConfigurationProperties.java      |  1 -
 .../camel/main/VaultConfigurationProperties.java   |  1 -
 8 files changed, 48 insertions(+), 32 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
index 5b98061..19e2c3c 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
@@ -5,6 +5,7 @@
     { "name": "camel.health", "description": "Camel Health Check 
configurations", "sourceType": 
"org.apache.camel.main.HealthConfigurationProperties" },
     { "name": "camel.rest", "description": "Camel Rest-DSL configurations", 
"sourceType": "org.apache.camel.spi.RestConfiguration" },
     { "name": "camel.vault.aws", "description": "Camel AWS Vault 
configurations", "sourceType": "org.apache.camel.vault.AwsVaultConfiguration" },
+    { "name": "camel.vault.gcp", "description": "Camel GCP Vault 
configurations", "sourceType": "org.apache.camel.vault.GcpVaultConfiguration" },
     { "name": "camel.faulttolerance", "description": "Fault Tolerance EIP 
Circuit Breaker configurations", "sourceType": 
"org.apache.camel.main.FaultToleranceConfigurationProperties" },
     { "name": "camel.resilience4j", "description": "Resilience4j EIP Circuit 
Breaker configurations", "sourceType": 
"org.apache.camel.main.Resilience4jConfigurationProperties" },
     { "name": "camel.hystrix", "description": "Hystrix (deprecated) EIP 
Circuit Breaker configurations", "sourceType": 
"org.apache.camel.main.HystrixConfigurationProperties" },
@@ -229,6 +230,8 @@
     { "name": "camel.vault.aws.accessKey", "description": "The AWS access 
key", "sourceType": "org.apache.camel.vault.AwsVaultConfiguration", "type": 
"string", "javaType": "java.lang.String" },
     { "name": "camel.vault.aws.defaultCredentialsProvider", "description": 
"Define if we want to use the AWS Default Credentials Provider or not", 
"sourceType": "org.apache.camel.vault.AwsVaultConfiguration", "type": 
"boolean", "javaType": "boolean", "defaultValue": "false" },
     { "name": "camel.vault.aws.region", "description": "The AWS region", 
"sourceType": "org.apache.camel.vault.AwsVaultConfiguration", "type": "string", 
"javaType": "java.lang.String" },
-    { "name": "camel.vault.aws.secretKey", "description": "The AWS secret 
key", "sourceType": "org.apache.camel.vault.AwsVaultConfiguration", "type": 
"string", "javaType": "java.lang.String" }
+    { "name": "camel.vault.aws.secretKey", "description": "The AWS secret 
key", "sourceType": "org.apache.camel.vault.AwsVaultConfiguration", "type": 
"string", "javaType": "java.lang.String" },
+    { "name": "camel.vault.gcp.projectId", "description": "The GCP Project 
ID", "sourceType": "org.apache.camel.vault.GcpVaultConfiguration", "type": 
"string", "javaType": "java.lang.String" },
+    { "name": "camel.vault.gcp.serviceAccountKey", "description": "The Service 
Account Key location", "sourceType": 
"org.apache.camel.vault.GcpVaultConfiguration", "type": "string", "javaType": 
"java.lang.String" }
   ]
 }
diff --git 
a/core/camel-main/src/generated/java/org/apache/camel/main/AwsVaultConfigurationPropertiesConfigurer.java
 
b/core/camel-main/src/generated/java/org/apache/camel/main/AwsVaultConfigurationPropertiesConfigurer.java
index 910b357..1727ab3 100644
--- 
a/core/camel-main/src/generated/java/org/apache/camel/main/AwsVaultConfigurationPropertiesConfigurer.java
+++ 
b/core/camel-main/src/generated/java/org/apache/camel/main/AwsVaultConfigurationPropertiesConfigurer.java
@@ -27,6 +27,8 @@ public class AwsVaultConfigurationPropertiesConfigurer 
extends org.apache.camel.
         case "AwsVaultConfiguration": 
target.setAwsVaultConfiguration(property(camelContext, 
org.apache.camel.vault.AwsVaultConfiguration.class, value)); return true;
         case "defaultcredentialsprovider":
         case "DefaultCredentialsProvider": 
target.setDefaultCredentialsProvider(property(camelContext, boolean.class, 
value)); return true;
+        case "gcpvaultconfiguration":
+        case "GcpVaultConfiguration": 
target.setGcpVaultConfiguration(property(camelContext, 
org.apache.camel.vault.GcpVaultConfiguration.class, value)); return true;
         case "region":
         case "Region": target.setRegion(property(camelContext, 
java.lang.String.class, value)); return true;
         case "secretkey":
@@ -44,6 +46,8 @@ public class AwsVaultConfigurationPropertiesConfigurer 
extends org.apache.camel.
         case "AwsVaultConfiguration": return 
org.apache.camel.vault.AwsVaultConfiguration.class;
         case "defaultcredentialsprovider":
         case "DefaultCredentialsProvider": return boolean.class;
+        case "gcpvaultconfiguration":
+        case "GcpVaultConfiguration": return 
org.apache.camel.vault.GcpVaultConfiguration.class;
         case "region":
         case "Region": return java.lang.String.class;
         case "secretkey":
@@ -62,6 +66,8 @@ public class AwsVaultConfigurationPropertiesConfigurer 
extends org.apache.camel.
         case "AwsVaultConfiguration": return target.getAwsVaultConfiguration();
         case "defaultcredentialsprovider":
         case "DefaultCredentialsProvider": return 
target.isDefaultCredentialsProvider();
+        case "gcpvaultconfiguration":
+        case "GcpVaultConfiguration": return target.getGcpVaultConfiguration();
         case "region":
         case "Region": return target.getRegion();
         case "secretkey":
diff --git 
a/core/camel-main/src/generated/java/org/apache/camel/main/AwsVaultConfigurationPropertiesConfigurer.java
 
b/core/camel-main/src/generated/java/org/apache/camel/main/GcpVaultConfigurationPropertiesConfigurer.java
similarity index 52%
copy from 
core/camel-main/src/generated/java/org/apache/camel/main/AwsVaultConfigurationPropertiesConfigurer.java
copy to 
core/camel-main/src/generated/java/org/apache/camel/main/GcpVaultConfigurationPropertiesConfigurer.java
index 910b357..8f0e826 100644
--- 
a/core/camel-main/src/generated/java/org/apache/camel/main/AwsVaultConfigurationPropertiesConfigurer.java
+++ 
b/core/camel-main/src/generated/java/org/apache/camel/main/GcpVaultConfigurationPropertiesConfigurer.java
@@ -9,28 +9,26 @@ import org.apache.camel.spi.PropertyConfigurerGetter;
 import org.apache.camel.spi.ConfigurerStrategy;
 import org.apache.camel.spi.GeneratedPropertyConfigurer;
 import org.apache.camel.util.CaseInsensitiveMap;
-import org.apache.camel.main.AwsVaultConfigurationProperties;
+import org.apache.camel.main.GcpVaultConfigurationProperties;
 
 /**
  * Generated by camel build tools - do NOT edit this file!
  */
 @SuppressWarnings("unchecked")
-public class AwsVaultConfigurationPropertiesConfigurer extends 
org.apache.camel.support.component.PropertyConfigurerSupport implements 
GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+public class GcpVaultConfigurationPropertiesConfigurer extends 
org.apache.camel.support.component.PropertyConfigurerSupport implements 
GeneratedPropertyConfigurer, PropertyConfigurerGetter {
 
     @Override
     public boolean configure(CamelContext camelContext, Object obj, String 
name, Object value, boolean ignoreCase) {
-        org.apache.camel.main.AwsVaultConfigurationProperties target = 
(org.apache.camel.main.AwsVaultConfigurationProperties) obj;
+        org.apache.camel.main.GcpVaultConfigurationProperties target = 
(org.apache.camel.main.GcpVaultConfigurationProperties) obj;
         switch (ignoreCase ? name.toLowerCase() : name) {
-        case "accesskey":
-        case "AccessKey": target.setAccessKey(property(camelContext, 
java.lang.String.class, value)); return true;
         case "awsvaultconfiguration":
         case "AwsVaultConfiguration": 
target.setAwsVaultConfiguration(property(camelContext, 
org.apache.camel.vault.AwsVaultConfiguration.class, value)); return true;
-        case "defaultcredentialsprovider":
-        case "DefaultCredentialsProvider": 
target.setDefaultCredentialsProvider(property(camelContext, boolean.class, 
value)); return true;
-        case "region":
-        case "Region": target.setRegion(property(camelContext, 
java.lang.String.class, value)); return true;
-        case "secretkey":
-        case "SecretKey": target.setSecretKey(property(camelContext, 
java.lang.String.class, value)); return true;
+        case "gcpvaultconfiguration":
+        case "GcpVaultConfiguration": 
target.setGcpVaultConfiguration(property(camelContext, 
org.apache.camel.vault.GcpVaultConfiguration.class, value)); return true;
+        case "projectid":
+        case "ProjectId": target.setProjectId(property(camelContext, 
java.lang.String.class, value)); return true;
+        case "serviceaccountkey":
+        case "ServiceAccountKey": 
target.setServiceAccountKey(property(camelContext, java.lang.String.class, 
value)); return true;
         default: return false;
         }
     }
@@ -38,34 +36,30 @@ public class AwsVaultConfigurationPropertiesConfigurer 
extends org.apache.camel.
     @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase() : name) {
-        case "accesskey":
-        case "AccessKey": return java.lang.String.class;
         case "awsvaultconfiguration":
         case "AwsVaultConfiguration": return 
org.apache.camel.vault.AwsVaultConfiguration.class;
-        case "defaultcredentialsprovider":
-        case "DefaultCredentialsProvider": return boolean.class;
-        case "region":
-        case "Region": return java.lang.String.class;
-        case "secretkey":
-        case "SecretKey": return java.lang.String.class;
+        case "gcpvaultconfiguration":
+        case "GcpVaultConfiguration": return 
org.apache.camel.vault.GcpVaultConfiguration.class;
+        case "projectid":
+        case "ProjectId": return java.lang.String.class;
+        case "serviceaccountkey":
+        case "ServiceAccountKey": return java.lang.String.class;
         default: return null;
         }
     }
 
     @Override
     public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
-        org.apache.camel.main.AwsVaultConfigurationProperties target = 
(org.apache.camel.main.AwsVaultConfigurationProperties) obj;
+        org.apache.camel.main.GcpVaultConfigurationProperties target = 
(org.apache.camel.main.GcpVaultConfigurationProperties) obj;
         switch (ignoreCase ? name.toLowerCase() : name) {
-        case "accesskey":
-        case "AccessKey": return target.getAccessKey();
         case "awsvaultconfiguration":
         case "AwsVaultConfiguration": return target.getAwsVaultConfiguration();
-        case "defaultcredentialsprovider":
-        case "DefaultCredentialsProvider": return 
target.isDefaultCredentialsProvider();
-        case "region":
-        case "Region": return target.getRegion();
-        case "secretkey":
-        case "SecretKey": return target.getSecretKey();
+        case "gcpvaultconfiguration":
+        case "GcpVaultConfiguration": return target.getGcpVaultConfiguration();
+        case "projectid":
+        case "ProjectId": return target.getProjectId();
+        case "serviceaccountkey":
+        case "ServiceAccountKey": return target.getServiceAccountKey();
         default: return null;
         }
     }
diff --git 
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
 
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
index 5b98061..19e2c3c 100644
--- 
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
+++ 
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
@@ -5,6 +5,7 @@
     { "name": "camel.health", "description": "Camel Health Check 
configurations", "sourceType": 
"org.apache.camel.main.HealthConfigurationProperties" },
     { "name": "camel.rest", "description": "Camel Rest-DSL configurations", 
"sourceType": "org.apache.camel.spi.RestConfiguration" },
     { "name": "camel.vault.aws", "description": "Camel AWS Vault 
configurations", "sourceType": "org.apache.camel.vault.AwsVaultConfiguration" },
+    { "name": "camel.vault.gcp", "description": "Camel GCP Vault 
configurations", "sourceType": "org.apache.camel.vault.GcpVaultConfiguration" },
     { "name": "camel.faulttolerance", "description": "Fault Tolerance EIP 
Circuit Breaker configurations", "sourceType": 
"org.apache.camel.main.FaultToleranceConfigurationProperties" },
     { "name": "camel.resilience4j", "description": "Resilience4j EIP Circuit 
Breaker configurations", "sourceType": 
"org.apache.camel.main.Resilience4jConfigurationProperties" },
     { "name": "camel.hystrix", "description": "Hystrix (deprecated) EIP 
Circuit Breaker configurations", "sourceType": 
"org.apache.camel.main.HystrixConfigurationProperties" },
@@ -229,6 +230,8 @@
     { "name": "camel.vault.aws.accessKey", "description": "The AWS access 
key", "sourceType": "org.apache.camel.vault.AwsVaultConfiguration", "type": 
"string", "javaType": "java.lang.String" },
     { "name": "camel.vault.aws.defaultCredentialsProvider", "description": 
"Define if we want to use the AWS Default Credentials Provider or not", 
"sourceType": "org.apache.camel.vault.AwsVaultConfiguration", "type": 
"boolean", "javaType": "boolean", "defaultValue": "false" },
     { "name": "camel.vault.aws.region", "description": "The AWS region", 
"sourceType": "org.apache.camel.vault.AwsVaultConfiguration", "type": "string", 
"javaType": "java.lang.String" },
-    { "name": "camel.vault.aws.secretKey", "description": "The AWS secret 
key", "sourceType": "org.apache.camel.vault.AwsVaultConfiguration", "type": 
"string", "javaType": "java.lang.String" }
+    { "name": "camel.vault.aws.secretKey", "description": "The AWS secret 
key", "sourceType": "org.apache.camel.vault.AwsVaultConfiguration", "type": 
"string", "javaType": "java.lang.String" },
+    { "name": "camel.vault.gcp.projectId", "description": "The GCP Project 
ID", "sourceType": "org.apache.camel.vault.GcpVaultConfiguration", "type": 
"string", "javaType": "java.lang.String" },
+    { "name": "camel.vault.gcp.serviceAccountKey", "description": "The Service 
Account Key location", "sourceType": 
"org.apache.camel.vault.GcpVaultConfiguration", "type": "string", "javaType": 
"java.lang.String" }
   ]
 }
diff --git 
a/core/camel-main/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.main.GcpVaultConfigurationProperties
 
b/core/camel-main/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.main.GcpVaultConfigurationProperties
new file mode 100644
index 0000000..ddc3a1e
--- /dev/null
+++ 
b/core/camel-main/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.main.GcpVaultConfigurationProperties
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.main.GcpVaultConfigurationPropertiesConfigurer
diff --git a/core/camel-main/src/main/docs/main.adoc 
b/core/camel-main/src/main/docs/main.adoc
index bc2ca85..4f8222c 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -209,6 +209,16 @@ The camel.vault.aws supports 4 options, which are listed 
below.
 | *camel.vault.aws.secretKey* | The AWS secret key |  | String
 |===
 
+=== Camel GCP Vault configurations
+The camel.vault.gcp supports 2 options, which are listed below.
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *camel.vault.gcp.projectId* | The GCP Project ID |  | String
+| *camel.vault.gcp.serviceAccount{zwsp}Key* | The Service Account Key location 
|  | String
+|===
+
 === Fault Tolerance EIP Circuit Breaker configurations
 The camel.faulttolerance supports 13 options, which are listed below.
 
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/GcpVaultConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/GcpVaultConfigurationProperties.java
index 8ef1720..38353bd 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/GcpVaultConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/GcpVaultConfigurationProperties.java
@@ -18,7 +18,6 @@ package org.apache.camel.main;
 
 import org.apache.camel.spi.BootstrapCloseable;
 import org.apache.camel.spi.Configurer;
-import org.apache.camel.vault.AwsVaultConfiguration;
 import org.apache.camel.vault.GcpVaultConfiguration;
 
 /**
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/VaultConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/VaultConfigurationProperties.java
index 4b13d55..4e53b86 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/VaultConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/VaultConfigurationProperties.java
@@ -17,7 +17,6 @@
 package org.apache.camel.main;
 
 import org.apache.camel.spi.BootstrapCloseable;
-import org.apache.camel.vault.GcpVaultConfiguration;
 import org.apache.camel.vault.VaultConfiguration;
 
 public class VaultConfigurationProperties extends VaultConfiguration 
implements BootstrapCloseable {

Reply via email to