This is an automated email from the ASF dual-hosted git repository.
oscerd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 56babadfcd2c CAMEL-24470: camel-ibm-secrets-manager - honor Event
Stream credentials from environment variables in the reload trigger task
(#25648)
56babadfcd2c is described below
commit 56babadfcd2cc941bd9be9f1fa959804ca4cbf03
Author: Andrea Cosentino <[email protected]>
AuthorDate: Tue Aug 25 10:51:32 2026 +0200
CAMEL-24470: camel-ibm-secrets-manager - honor Event Stream credentials
from environment variables in the reload trigger task (#25648)
IBMEventStreamReloadTriggerTask.doStart() inverted the credential-resolution
logic: after reading the CAMEL_VAULT_IBM_EVENTSTREAM_* environment
variables it
built the Kafka consumer only when they were all empty and threw otherwise,
so
supplying the documented environment variables always failed at startup
with the
exact message claiming those variables were required. Resolve the
credentials
from the environment variables when present, fall back to the vault
configuration otherwise, keep defaulting the username to "token" when not
supplied, and only throw when a required value is still missing.
Signed-off-by: Andrea Cosentino <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
---
.../manager/vault/IBMEventStreamReloadTriggerTask.java | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git
a/components/camel-ibm/camel-ibm-secrets-manager/src/main/java/org/apache/camel/component/ibm/secrets/manager/vault/IBMEventStreamReloadTriggerTask.java
b/components/camel-ibm/camel-ibm-secrets-manager/src/main/java/org/apache/camel/component/ibm/secrets/manager/vault/IBMEventStreamReloadTriggerTask.java
index fde6214e6e25..276e1df3f7ba 100644
---
a/components/camel-ibm/camel-ibm-secrets-manager/src/main/java/org/apache/camel/component/ibm/secrets/manager/vault/IBMEventStreamReloadTriggerTask.java
+++
b/components/camel-ibm/camel-ibm-secrets-manager/src/main/java/org/apache/camel/component/ibm/secrets/manager/vault/IBMEventStreamReloadTriggerTask.java
@@ -119,15 +119,16 @@ public class IBMEventStreamReloadTriggerTask extends
ServiceSupport implements C
groupId = ibmVaultConfiguration.getEventStreamGroupId();
topic = ibmVaultConfiguration.getEventStreamTopic();
if (ObjectHelper.isEmpty(username)) {
- if
(ObjectHelper.isNotEmpty(ibmVaultConfiguration.getEventStreamUsername())) {
- username =
ibmVaultConfiguration.getEventStreamUsername();
- } else {
- username = "token";
- }
+ username = ibmVaultConfiguration.getEventStreamUsername();
}
password = ibmVaultConfiguration.getEventStreamPassword();
}
- } else {
+ }
+ if (ObjectHelper.isEmpty(username)) {
+ username = "token";
+ }
+ if (ObjectHelper.isEmpty(bootstrapServers) ||
ObjectHelper.isEmpty(groupId) || ObjectHelper.isEmpty(topic)
+ || ObjectHelper.isEmpty(password)) {
throw new RuntimeCamelException(
"Using the IBM Secrets Refresh Task requires setting IBM
Event Stream bootstrap servers, topic, groupId, username and password as
application properties or environment variables");
}