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 7af119d2ffe72ee281f59578d4e42ef98e011f2f
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Tue Sep 20 18:35:38 2022 +0200

    CAMEL-18504 - camel-google-secret-manager - Add dev console for secrets
    
    Signed-off-by: Andrea Cosentino <anco...@gmail.com>
---
 components/camel-google/camel-google-secret-manager/pom.xml  |  5 ++++-
 .../manager/GoogleSecretManagerPropertiesFunction.java       | 12 ++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/components/camel-google/camel-google-secret-manager/pom.xml 
b/components/camel-google/camel-google-secret-manager/pom.xml
index ea378bec96b..d43d6946bdf 100644
--- a/components/camel-google/camel-google-secret-manager/pom.xml
+++ b/components/camel-google/camel-google-secret-manager/pom.xml
@@ -68,7 +68,10 @@
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-support</artifactId>
         </dependency>
-
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-console</artifactId>
+        </dependency>
         <dependency>
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
diff --git 
a/components/camel-google/camel-google-secret-manager/src/main/java/org/apache/camel/component/google/secret/manager/GoogleSecretManagerPropertiesFunction.java
 
b/components/camel-google/camel-google-secret-manager/src/main/java/org/apache/camel/component/google/secret/manager/GoogleSecretManagerPropertiesFunction.java
index dcb9ca73b36..a51a2c44218 100644
--- 
a/components/camel-google/camel-google-secret-manager/src/main/java/org/apache/camel/component/google/secret/manager/GoogleSecretManagerPropertiesFunction.java
+++ 
b/components/camel-google/camel-google-secret-manager/src/main/java/org/apache/camel/component/google/secret/manager/GoogleSecretManagerPropertiesFunction.java
@@ -82,12 +82,13 @@ public class GoogleSecretManagerPropertiesFunction extends 
ServiceSupport implem
     private SecretManagerServiceClient client;
     private String projectId;
     private final Set<String> secrets = new HashSet<>();
-
+    boolean useDefaultInstance;
+    
     @Override
     protected void doStart() throws Exception {
         super.doStart();
         String serviceAccountKey = 
System.getenv(CAMEL_VAULT_GCP_SERVICE_ACCOUNT_KEY);
-        boolean useDefaultInstance = 
Boolean.parseBoolean(System.getenv(CAMEL_VAULT_GCP_USE_DEFAULT_INSTANCE));
+        useDefaultInstance = 
Boolean.parseBoolean(System.getenv(CAMEL_VAULT_GCP_USE_DEFAULT_INSTANCE));
         projectId = System.getenv(CAMEL_VAULT_GCP_PROJECT_ID);
         if (ObjectHelper.isEmpty(serviceAccountKey) && 
ObjectHelper.isEmpty(projectId)) {
             GcpVaultConfiguration gcpVaultConfiguration = 
getCamelContext().getVaultConfiguration().gcp();
@@ -231,4 +232,11 @@ public class GoogleSecretManagerPropertiesFunction extends 
ServiceSupport implem
     public Set<String> getSecrets() {
         return secrets;
     }
+    
+    /**
+     * Whether login is using default instance or service account key file
+     */
+    public boolean isUseDefaultInstance() {
+        return useDefaultInstance;
+    }
 }

Reply via email to