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-spring-boot.git
The following commit(s) were added to refs/heads/main by this push: new 15815bcfec4 CAMEL-21920 - Camel-IBM-Secrets-Manager: Support Secret Refresh in Camel-Spring-Boot (#1413) 15815bcfec4 is described below commit 15815bcfec4f2c26e2f92134c510164ce442480b Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Thu Apr 3 16:27:28 2025 +0200 CAMEL-21920 - Camel-IBM-Secrets-Manager: Support Secret Refresh in Camel-Spring-Boot (#1413) Signed-off-by: Andrea Cosentino <anco...@gmail.com> --- .../src/main/docs/spring-boot.json | 37 ++++++++++ .../boot/vault/IBMVaultAutoConfiguration.java | 6 ++ .../vault/IBMVaultConfigurationProperties.java | 80 ++++++++++++++++++++++ .../IBMSecretsManagerVaultConfigurationTest.java | 13 +++- 4 files changed, 135 insertions(+), 1 deletion(-) diff --git a/core/camel-spring-boot/src/main/docs/spring-boot.json b/core/camel-spring-boot/src/main/docs/spring-boot.json index ed5ae454e6d..f1b843300a1 100644 --- a/core/camel-spring-boot/src/main/docs/spring-boot.json +++ b/core/camel-spring-boot/src/main/docs/spring-boot.json @@ -1931,6 +1931,43 @@ "description": "The Hashicorp Vault Token for accessing the service", "sourceType": "org.apache.camel.spring.boot.vault.HashicorpVaultConfigurationProperties" }, + { + "name": "camel.vault.ibm.event-stream-bootstrap-servers", + "type": "java.lang.String", + "description": "Specify the Bootstrap servers for consuming notification on IBM Event Stream. Multiple servers can be separated by comma.", + "sourceType": "org.apache.camel.spring.boot.vault.IBMVaultConfigurationProperties" + }, + { + "name": "camel.vault.ibm.event-stream-consumer-poll-timeout", + "type": "java.lang.Long", + "description": "Specify the Consumer Poll Timeout while consuming from IBM Event Stream Topic", + "sourceType": "org.apache.camel.spring.boot.vault.IBMVaultConfigurationProperties", + "defaultValue": 3000 + }, + { + "name": "camel.vault.ibm.event-stream-group-id", + "type": "java.lang.String", + "description": "Specify the Consumer Group ID to access IBM Event Stream", + "sourceType": "org.apache.camel.spring.boot.vault.IBMVaultConfigurationProperties" + }, + { + "name": "camel.vault.ibm.event-stream-password", + "type": "java.lang.String", + "description": "Specify the password to access IBM Event Stream", + "sourceType": "org.apache.camel.spring.boot.vault.IBMVaultConfigurationProperties" + }, + { + "name": "camel.vault.ibm.event-stream-topic", + "type": "java.lang.String", + "description": "Specify the topic name for consuming notification on IBM Event Stream", + "sourceType": "org.apache.camel.spring.boot.vault.IBMVaultConfigurationProperties" + }, + { + "name": "camel.vault.ibm.event-stream-username", + "type": "java.lang.String", + "description": "Specify the username to access IBM Event Stream", + "sourceType": "org.apache.camel.spring.boot.vault.IBMVaultConfigurationProperties" + }, { "name": "camel.vault.ibm.service-url", "type": "java.lang.String", diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/IBMVaultAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/IBMVaultAutoConfiguration.java index d24f5c5dc25..1ef8a88de32 100644 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/IBMVaultAutoConfiguration.java +++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/IBMVaultAutoConfiguration.java @@ -35,6 +35,12 @@ public class IBMVaultAutoConfiguration { IBMSecretsManagerVaultConfiguration answer = new IBMSecretsManagerVaultConfiguration(); answer.setToken(config.getToken()); answer.setServiceUrl(config.getServiceUrl()); + answer.setEventStreamTopic(config.getEventStreamTopic()); + answer.setEventStreamBootstrapServers(config.getEventStreamBootstrapServers()); + answer.setEventStreamUsername(config.getEventStreamUsername()); + answer.setEventStreamPassword(config.getEventStreamPassword()); + answer.setEventStreamGroupId(config.getEventStreamGroupId()); + answer.setEventStreamConsumerPollTimeout(config.getEventStreamConsumerPollTimeout()); return answer; } diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/IBMVaultConfigurationProperties.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/IBMVaultConfigurationProperties.java index 7c92a8565ee..c637c5ed5a5 100644 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/IBMVaultConfigurationProperties.java +++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/IBMVaultConfigurationProperties.java @@ -16,6 +16,7 @@ */ package org.apache.camel.spring.boot.vault; + import org.springframework.boot.context.properties.ConfigurationProperties; @ConfigurationProperties(prefix = "camel.vault.ibm") @@ -31,6 +32,37 @@ public class IBMVaultConfigurationProperties { */ private String serviceUrl; + /** + * Specify the topic name for consuming notification on IBM Event Stream + */ + private String eventStreamTopic; + + /** + * Specify the Bootstrap servers for consuming notification on IBM Event Stream. Multiple servers can be separated + * by comma. + */ + private String eventStreamBootstrapServers; + + /** + * Specify the username to access IBM Event Stream + */ + private String eventStreamUsername; + + /** + * Specify the password to access IBM Event Stream + */ + private String eventStreamPassword; + + /** + * Specify the Consumer Group ID to access IBM Event Stream + */ + private String eventStreamGroupId; + + /** + * Specify the Consumer Poll Timeout while consuming from IBM Event Stream Topic + */ + private long eventStreamConsumerPollTimeout = 3000; + public String getToken() { return token; } @@ -46,4 +78,52 @@ public class IBMVaultConfigurationProperties { public void setServiceUrl(String serviceUrl) { this.serviceUrl = serviceUrl; } + + public String getEventStreamTopic() { + return eventStreamTopic; + } + + public void setEventStreamTopic(String eventStreamTopic) { + this.eventStreamTopic = eventStreamTopic; + } + + public String getEventStreamBootstrapServers() { + return eventStreamBootstrapServers; + } + + public void setEventStreamBootstrapServers(String eventStreamBootstrapServers) { + this.eventStreamBootstrapServers = eventStreamBootstrapServers; + } + + public String getEventStreamUsername() { + return eventStreamUsername; + } + + public void setEventStreamUsername(String eventStreamUsername) { + this.eventStreamUsername = eventStreamUsername; + } + + public String getEventStreamPassword() { + return eventStreamPassword; + } + + public void setEventStreamPassword(String eventStreamPassword) { + this.eventStreamPassword = eventStreamPassword; + } + + public String getEventStreamGroupId() { + return eventStreamGroupId; + } + + public void setEventStreamGroupId(String eventStreamGroupId) { + this.eventStreamGroupId = eventStreamGroupId; + } + + public long getEventStreamConsumerPollTimeout() { + return eventStreamConsumerPollTimeout; + } + + public void setEventStreamConsumerPollTimeout(long eventStreamConsumerPollTimeout) { + this.eventStreamConsumerPollTimeout = eventStreamConsumerPollTimeout; + } } diff --git a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/IBMSecretsManagerVaultConfigurationTest.java b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/IBMSecretsManagerVaultConfigurationTest.java index b346c3220dc..3058ef3a1ae 100644 --- a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/IBMSecretsManagerVaultConfigurationTest.java +++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/IBMSecretsManagerVaultConfigurationTest.java @@ -30,7 +30,12 @@ import org.springframework.test.annotation.DirtiesContext; @EnableAutoConfiguration @SpringBootTest(classes = { IBMSecretsManagerVaultConfigurationTest.class }, properties = { "camel.vault.ibm.token=myToken", - "camel.vault.ibm.service-url=http://myHost" }) + "camel.vault.ibm.service-url=http://myHost", +"camel.vault.ibm.event-stream-bootstrap-servers=http://myServer", +"camel.vault.ibm.event-stream-group-id=sec-group-id", +"camel.vault.ibm.event-stream-topic=sec-topic", +"camel.vault.ibm.event-stream-username=username", +"camel.vault.ibm.event-stream-password=password"}) public class IBMSecretsManagerVaultConfigurationTest { @Autowired @@ -40,5 +45,11 @@ public class IBMSecretsManagerVaultConfigurationTest { public void testIBMSecretsManagerVault() throws Exception { Assertions.assertEquals("myToken", camelContext.getVaultConfiguration().ibmSecretsManager().getToken()); Assertions.assertEquals("http://myHost", camelContext.getVaultConfiguration().ibmSecretsManager().getServiceUrl()); + Assertions.assertEquals("http://myServer", camelContext.getVaultConfiguration().ibmSecretsManager().getEventStreamBootstrapServers()); + Assertions.assertEquals("sec-topic", camelContext.getVaultConfiguration().ibmSecretsManager().getEventStreamTopic()); + Assertions.assertEquals("sec-group-id", camelContext.getVaultConfiguration().ibmSecretsManager().getEventStreamGroupId()); + Assertions.assertEquals("username", camelContext.getVaultConfiguration().ibmSecretsManager().getEventStreamUsername()); + Assertions.assertEquals("password", camelContext.getVaultConfiguration().ibmSecretsManager().getEventStreamPassword()); + Assertions.assertEquals(3000L, camelContext.getVaultConfiguration().ibmSecretsManager().getEventStreamConsumerPollTimeout()); } }