oscerd opened a new pull request, #25648:
URL: https://github.com/apache/camel/pull/25648
# CAMEL-24470: honor Event Stream credentials from environment variables
`IBMEventStreamReloadTriggerTask` (the `ibm-secret-refresh` periodic task
that watches an IBM Event Streams / Kafka topic for secret-rotation events)
inverted its credential-resolution logic in `doStart()`:
```java
if (isEmpty(bootstrapServers) && isEmpty(groupId) && isEmpty(topic) &&
isEmpty(password)) {
// read the values from the vault configuration
} else {
throw new RuntimeCamelException(
"... requires setting IBM Event Stream bootstrap servers, topic,
groupId, username and password ...");
}
```
After reading the documented `CAMEL_VAULT_IBM_EVENTSTREAM_*` environment
variables, non-empty values took the `else` branch and threw at startup with
the exact message claiming those variables were required. The task could
therefore only be configured through the vault configuration object; the
environment-variable path always failed.
## Fix
Same shape as the `IBMSecretsManagerPropertiesFunction` fix in CAMEL-24468:
resolve the credentials from the environment variables when present, fall back
to the vault configuration when they are absent, keep defaulting the username
to `token` (the IBM Event Streams SASL user) when not supplied, and only throw
when a required value (bootstrap servers, group id, topic, password) is still
missing after both sources have been consulted.
## Testing
The module ships only integration tests (they require live IBM credentials)
and the credential path is `System.getenv`-based, so this is not unit-testable
without new test dependencies. Verified with a module build (`BUILD SUCCESS`,
no generated-file drift).
---
_Claude Code on behalf of oscerd_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]