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/04 07:48:45 UTC

[camel] branch main updated (ab07cb5 -> 635c0d6)

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


    from ab07cb5  Upgrade Hazelcast to 5.1 (#7102)
     new 2929bb7  CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance
     new bb7edec  CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance
     new e3c8422  CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance
     new b8eac7f  CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance
     new 45a8194  CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance
     new 635c0d6  CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance

The 6 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:
 .../main/camel-main-configuration-metadata.json     |  3 ++-
 .../GoogleSecretManagerPropertiesFunction.java      | 10 ++++++++--
 .../GoogleSecretManagerPropertiesSourceTestIT.java  | 21 +++++++++++++++++++++
 .../apache/camel/vault/GcpVaultConfiguration.java   | 13 +++++++++++++
 .../GcpVaultConfigurationPropertiesConfigurer.java  |  6 ++++++
 .../META-INF/camel-main-configuration-metadata.json |  3 ++-
 core/camel-main/src/main/docs/main.adoc             |  3 ++-
 .../camel/main/GcpVaultConfigurationProperties.java |  8 ++++++++
 .../java/org/apache/camel/main/MainVaultTest.java   |  4 ++--
 9 files changed, 64 insertions(+), 7 deletions(-)

[camel] 02/06: CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance

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

commit bb7edec1a23d1a7d85683b309ae12b5511ed51b8
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Mar 4 06:46:25 2022 +0100

    CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance
---
 .../GoogleSecretManagerPropertiesFunction.java      |  6 ++++++
 .../GoogleSecretManagerPropertiesSourceTestIT.java  | 21 +++++++++++++++++++++
 2 files changed, 27 insertions(+)

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 e562cfa..9059a16 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
@@ -75,6 +75,7 @@ public class GoogleSecretManagerPropertiesFunction extends ServiceSupport implem
 
     private static final String CAMEL_VAULT_GCP_SERVICE_ACCOUNT_KEY = "CAMEL_VAULT_GCP_SERVICE_ACCOUNT_KEY";
     private static final String CAMEL_VAULT_GCP_PROJECT_ID = "CAMEL_VAULT_GCP_PROJECT_ID";
+    private static final String CAMEL_VAULT_GCP_USE_DEFAULT_INSTANCE = "CAMEL_VAULT_GCP_USE_DEFAULT_INSTANCE";
     private CamelContext camelContext;
     private SecretManagerServiceClient client;
     private String projectId;
@@ -83,12 +84,14 @@ public class GoogleSecretManagerPropertiesFunction extends ServiceSupport implem
     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));
         projectId = System.getenv(CAMEL_VAULT_GCP_PROJECT_ID);
         if (ObjectHelper.isEmpty(serviceAccountKey) && ObjectHelper.isEmpty(projectId)) {
             GcpVaultConfiguration gcpVaultConfiguration = getCamelContext().getVaultConfiguration().gcp();
             if (ObjectHelper.isNotEmpty(gcpVaultConfiguration)) {
                 serviceAccountKey = gcpVaultConfiguration.getServiceAccountKey();
                 projectId = gcpVaultConfiguration.getProjectId();
+                useDefaultInstance = gcpVaultConfiguration.isUseDefaultInstance();
             }
         }
         if (ObjectHelper.isNotEmpty(serviceAccountKey) && ObjectHelper.isNotEmpty(projectId)) {
@@ -99,6 +102,9 @@ public class GoogleSecretManagerPropertiesFunction extends ServiceSupport implem
             SecretManagerServiceSettings settings = SecretManagerServiceSettings.newBuilder()
                     .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)).build();
             client = SecretManagerServiceClient.create(settings);
+        } else if ( useDefaultInstance && ObjectHelper.isNotEmpty(projectId)) {
+            SecretManagerServiceSettings settings = SecretManagerServiceSettings.newBuilder().build();
+            client = SecretManagerServiceClient.create(settings);
         } else {
             throw new RuntimeCamelException(
                     "Using the GCP Secret Manager Properties Function requires setting GCP service account key and project Id as application properties or environment variables");
diff --git a/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesSourceTestIT.java b/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesSourceTestIT.java
index 76972dc..0e85630 100644
--- a/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesSourceTestIT.java
+++ b/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesSourceTestIT.java
@@ -187,4 +187,25 @@ public class GoogleSecretManagerPropertiesSourceTestIT extends CamelTestSupport
         template.sendBody("direct:password", "Hello World");
         assertMockEndpointsSatisfied();
     }
+
+    @EnabledIfEnvironmentVariable(named = "CAMEL_VAULT_GCP_USE_DEFAULT_INSTACE", matches = ".*")
+    @EnabledIfEnvironmentVariable(named = "CAMEL_VAULT_GCP_PROJECT_ID", matches = ".*")
+    @EnabledIfEnvironmentVariable(named = "GOOGLE_APPLICATION_CREDENTIALS", matches = ".*")
+    @Test
+    public void testComplexPropertiesDefaultInstanceFunction() throws Exception {
+        context.addRoutes(new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:username").setBody(simple("{{gcp:test-3:admin}}")).to("mock:bar");
+                from("direct:password").setBody(simple("{{gcp:test-1:secret}}")).to("mock:bar");
+            }
+        });
+        context.start();
+
+        getMockEndpoint("mock:bar").expectedBodiesReceived("admin", "secret");
+
+        template.sendBody("direct:username", "Hello World");
+        template.sendBody("direct:password", "Hello World");
+        assertMockEndpointsSatisfied();
+    }
 }

[camel] 06/06: CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance

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

commit 635c0d6cc066916a063ecabfef890e5aa133ad86
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Mar 4 08:46:33 2022 +0100

    CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance
---
 .../manager/integration/GoogleSecretManagerPropertiesSourceTestIT.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesSourceTestIT.java b/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesSourceTestIT.java
index 0e85630..036c450 100644
--- a/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesSourceTestIT.java
+++ b/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesSourceTestIT.java
@@ -188,7 +188,7 @@ public class GoogleSecretManagerPropertiesSourceTestIT extends CamelTestSupport
         assertMockEndpointsSatisfied();
     }
 
-    @EnabledIfEnvironmentVariable(named = "CAMEL_VAULT_GCP_USE_DEFAULT_INSTACE", matches = ".*")
+    @EnabledIfEnvironmentVariable(named = "CAMEL_VAULT_GCP_USE_DEFAULT_INSTANCE", matches = ".*")
     @EnabledIfEnvironmentVariable(named = "CAMEL_VAULT_GCP_PROJECT_ID", matches = ".*")
     @EnabledIfEnvironmentVariable(named = "GOOGLE_APPLICATION_CREDENTIALS", matches = ".*")
     @Test

[camel] 05/06: CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance

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

commit 45a8194034091cb875ccd6234102d81638b7a733
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Mar 4 08:40:45 2022 +0100

    CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance
---
 .../google/secret/manager/GoogleSecretManagerPropertiesFunction.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 59b0ec8..b5d7a6a 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
@@ -22,13 +22,13 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.api.gax.rpc.ApiException;
 import com.google.auth.Credentials;
 import com.google.auth.oauth2.ServiceAccountCredentials;
 import com.google.cloud.secretmanager.v1.AccessSecretVersionResponse;
 import com.google.cloud.secretmanager.v1.SecretManagerServiceClient;
 import com.google.cloud.secretmanager.v1.SecretManagerServiceSettings;
 import com.google.cloud.secretmanager.v1.SecretVersionName;
-import io.grpc.StatusRuntimeException;
 import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
 import org.apache.camel.RuntimeCamelException;
@@ -176,7 +176,7 @@ public class GoogleSecretManagerPropertiesFunction extends ServiceSupport implem
             if (ObjectHelper.isEmpty(returnValue)) {
                 returnValue = defaultValue;
             }
-        } catch (StatusRuntimeException ex) {
+        } catch (ApiException ex) {
             if (ObjectHelper.isNotEmpty(defaultValue)) {
                 returnValue = defaultValue;
             } else {

[camel] 04/06: CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance

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

commit b8eac7ffdb480469ba3b6bd52e58c512ffbfd83f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Mar 4 07:36:13 2022 +0100

    CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance
---
 .../apache/camel/catalog/main/camel-main-configuration-metadata.json   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 19e2c3c..6050deb 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
@@ -232,6 +232,7 @@
     { "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.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" }
+    { "name": "camel.vault.gcp.serviceAccountKey", "description": "The Service Account Key location", "sourceType": "org.apache.camel.vault.GcpVaultConfiguration", "type": "string", "javaType": "java.lang.String" },
+    { "name": "camel.vault.gcp.useDefaultInstance", "description": "Define if we want to use the GCP Client Default Instance or not", "sourceType": "org.apache.camel.vault.GcpVaultConfiguration", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }
   ]
 }

[camel] 01/06: CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance

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

commit 2929bb7e37906fbc82c8d95f1e382081bca1de30
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 3 18:52:05 2022 +0100

    CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance
---
 .../java/org/apache/camel/vault/GcpVaultConfiguration.java  | 13 +++++++++++++
 .../main/GcpVaultConfigurationPropertiesConfigurer.java     |  6 ++++++
 .../META-INF/camel-main-configuration-metadata.json         |  3 ++-
 core/camel-main/src/main/docs/main.adoc                     |  3 ++-
 .../apache/camel/main/GcpVaultConfigurationProperties.java  |  8 ++++++++
 .../src/test/java/org/apache/camel/main/MainVaultTest.java  |  4 ++--
 6 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/core/camel-api/src/main/java/org/apache/camel/vault/GcpVaultConfiguration.java b/core/camel-api/src/main/java/org/apache/camel/vault/GcpVaultConfiguration.java
index 205cbe5..bc50bcf 100644
--- a/core/camel-api/src/main/java/org/apache/camel/vault/GcpVaultConfiguration.java
+++ b/core/camel-api/src/main/java/org/apache/camel/vault/GcpVaultConfiguration.java
@@ -27,6 +27,8 @@ public class GcpVaultConfiguration extends VaultConfiguration {
     private String serviceAccountKey;
     @Metadata
     private String projectId;
+    @Metadata
+    private boolean useDefaultInstance;
 
     public String getServiceAccountKey() {
         return serviceAccountKey;
@@ -50,4 +52,15 @@ public class GcpVaultConfiguration extends VaultConfiguration {
         this.projectId = projectId;
     }
 
+    public boolean isUseDefaultInstance() {
+        return useDefaultInstance;
+    }
+
+    /**
+     * Define if we want to use the GCP Client Default Instance or not
+     */
+    public void setUseDefaultInstance(boolean useDefaultInstance) {
+        this.useDefaultInstance = useDefaultInstance;
+    }
+
 }
diff --git a/core/camel-main/src/generated/java/org/apache/camel/main/GcpVaultConfigurationPropertiesConfigurer.java b/core/camel-main/src/generated/java/org/apache/camel/main/GcpVaultConfigurationPropertiesConfigurer.java
index 8f0e826..83b3680 100644
--- a/core/camel-main/src/generated/java/org/apache/camel/main/GcpVaultConfigurationPropertiesConfigurer.java
+++ b/core/camel-main/src/generated/java/org/apache/camel/main/GcpVaultConfigurationPropertiesConfigurer.java
@@ -29,6 +29,8 @@ public class GcpVaultConfigurationPropertiesConfigurer extends org.apache.camel.
         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;
+        case "usedefaultinstance":
+        case "UseDefaultInstance": target.setUseDefaultInstance(property(camelContext, boolean.class, value)); return true;
         default: return false;
         }
     }
@@ -44,6 +46,8 @@ public class GcpVaultConfigurationPropertiesConfigurer extends org.apache.camel.
         case "ProjectId": return java.lang.String.class;
         case "serviceaccountkey":
         case "ServiceAccountKey": return java.lang.String.class;
+        case "usedefaultinstance":
+        case "UseDefaultInstance": return boolean.class;
         default: return null;
         }
     }
@@ -60,6 +64,8 @@ public class GcpVaultConfigurationPropertiesConfigurer extends org.apache.camel.
         case "ProjectId": return target.getProjectId();
         case "serviceaccountkey":
         case "ServiceAccountKey": return target.getServiceAccountKey();
+        case "usedefaultinstance":
+        case "UseDefaultInstance": return target.isUseDefaultInstance();
         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 19e2c3c..6050deb 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
@@ -232,6 +232,7 @@
     { "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.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" }
+    { "name": "camel.vault.gcp.serviceAccountKey", "description": "The Service Account Key location", "sourceType": "org.apache.camel.vault.GcpVaultConfiguration", "type": "string", "javaType": "java.lang.String" },
+    { "name": "camel.vault.gcp.useDefaultInstance", "description": "Define if we want to use the GCP Client Default Instance or not", "sourceType": "org.apache.camel.vault.GcpVaultConfiguration", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }
   ]
 }
diff --git a/core/camel-main/src/main/docs/main.adoc b/core/camel-main/src/main/docs/main.adoc
index 4f8222c..2e83fd0 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -210,13 +210,14 @@ The camel.vault.aws supports 4 options, which are listed below.
 |===
 
 === Camel GCP Vault configurations
-The camel.vault.gcp supports 2 options, which are listed below.
+The camel.vault.gcp supports 3 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
+| *camel.vault.gcp.useDefault{zwsp}Instance* | Define if we want to use the GCP Client Default Instance or not | false | boolean
 |===
 
 === Fault Tolerance EIP Circuit Breaker configurations
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 38353bd..f441291 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
@@ -65,4 +65,12 @@ public class GcpVaultConfigurationProperties extends GcpVaultConfiguration imple
         return this;
     }
 
+    /**
+     * The GCP Project ID
+     */
+    public GcpVaultConfigurationProperties withUseDefaultInstance(boolean useDefaultInstance) {
+        setUseDefaultInstance(useDefaultInstance);
+        return this;
+    }
+
 }
diff --git a/core/camel-main/src/test/java/org/apache/camel/main/MainVaultTest.java b/core/camel-main/src/test/java/org/apache/camel/main/MainVaultTest.java
index d4c7ac3..cd4bceb 100644
--- a/core/camel-main/src/test/java/org/apache/camel/main/MainVaultTest.java
+++ b/core/camel-main/src/test/java/org/apache/camel/main/MainVaultTest.java
@@ -94,7 +94,7 @@ public class MainVaultTest {
 
         Assertions.assertEquals("file:////myKey", cfg.getServiceAccountKey());
         Assertions.assertEquals("gcp-project", cfg.getProjectId());
-
+        Assertions.assertEquals(false, cfg.isUseDefaultInstance());
         main.stop();
     }
 
@@ -116,7 +116,7 @@ public class MainVaultTest {
 
         Assertions.assertEquals("file:////myKey", cfg.getServiceAccountKey());
         Assertions.assertEquals("gcp-project", cfg.getProjectId());
-
+        Assertions.assertEquals(false, cfg.isUseDefaultInstance());
         main.stop();
     }
 

[camel] 03/06: CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance

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

commit e3c84228e30b2ea340e8a7dce5eccf8426eada6f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Mar 4 06:49:22 2022 +0100

    CAMEL-17739 - Camel Google Secret Manager Properties Source: Support the usage of client default instance
---
 .../google/secret/manager/GoogleSecretManagerPropertiesFunction.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 9059a16..59b0ec8 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
@@ -102,7 +102,7 @@ public class GoogleSecretManagerPropertiesFunction extends ServiceSupport implem
             SecretManagerServiceSettings settings = SecretManagerServiceSettings.newBuilder()
                     .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)).build();
             client = SecretManagerServiceClient.create(settings);
-        } else if ( useDefaultInstance && ObjectHelper.isNotEmpty(projectId)) {
+        } else if (useDefaultInstance && ObjectHelper.isNotEmpty(projectId)) {
             SecretManagerServiceSettings settings = SecretManagerServiceSettings.newBuilder().build();
             client = SecretManagerServiceClient.create(settings);
         } else {