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 2025/02/28 16:24:54 UTC
(camel) 02/02: CAMEL-21768 - Camel-IBM-Secrets-Manager: Create a properties function
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch CAMEL-21768
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 4f384f2adce684e05af388d1405522c945a13466
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Feb 28 17:24:33 2025 +0100
CAMEL-21768 - Camel-IBM-Secrets-Manager: Create a properties function
Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
components/camel-ibm-secrets-manager/pom.xml | 11 +++--------
.../secrets/manager/IBMSecretsManagerPropertiesFunction.java | 6 ++----
2 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/components/camel-ibm-secrets-manager/pom.xml b/components/camel-ibm-secrets-manager/pom.xml
index f3a4a1112c1..d4d31bbb0c3 100644
--- a/components/camel-ibm-secrets-manager/pom.xml
+++ b/components/camel-ibm-secrets-manager/pom.xml
@@ -43,15 +43,10 @@
<artifactId>camel-support</artifactId>
</dependency>
- <dependency>
- <groupId>com.ibm.cloud</groupId>
- <artifactId>secrets-manager</artifactId>
- <version>${ibm-secrets-manager-version}</version>
- </dependency>
-
<dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
+ <groupId>com.ibm.cloud</groupId>
+ <artifactId>secrets-manager</artifactId>
+ <version>${ibm-secrets-manager-version}</version>
</dependency>
<!-- for testing -->
diff --git a/components/camel-ibm-secrets-manager/src/main/java/org/apache/camel/component/ibm/secrets/manager/IBMSecretsManagerPropertiesFunction.java b/components/camel-ibm-secrets-manager/src/main/java/org/apache/camel/component/ibm/secrets/manager/IBMSecretsManagerPropertiesFunction.java
index 7c12ac7b5d4..d398fb673ca 100644
--- a/components/camel-ibm-secrets-manager/src/main/java/org/apache/camel/component/ibm/secrets/manager/IBMSecretsManagerPropertiesFunction.java
+++ b/components/camel-ibm-secrets-manager/src/main/java/org/apache/camel/component/ibm/secrets/manager/IBMSecretsManagerPropertiesFunction.java
@@ -20,7 +20,6 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import com.fasterxml.jackson.core.JsonProcessingException;
import com.ibm.cloud.sdk.core.http.Response;
import com.ibm.cloud.sdk.core.security.IamAuthenticator;
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.SecretsManager;
@@ -166,7 +165,7 @@ public class IBMSecretsManagerPropertiesFunction extends ServiceSupport implemen
if (key != null) {
try {
returnValue = getSecretFromSource(key, subkey, defaultValue, version);
- } catch (JsonProcessingException e) {
+ } catch (Exception e) {
throw new RuntimeCamelException("Something went wrong while recovering " + key + " from vault");
}
}
@@ -175,8 +174,7 @@ public class IBMSecretsManagerPropertiesFunction extends ServiceSupport implemen
}
private String getSecretFromSource(
- String key, String subkey, String defaultValue, String version)
- throws JsonProcessingException {
+ String key, String subkey, String defaultValue, String version) {
// capture name of secret
secrets.add(key);