This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch CAMEL-21826 in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
commit 224bbacfd245de8a582b5984a1ee5dd95f2cdea8 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Tue Mar 4 15:15:01 2025 +0100 CAMEL-21826 - Camel-IBM-Secrtes-manager: Support properties function in Spring boot Signed-off-by: Andrea Cosentino <anco...@gmail.com> --- .../springboot/catalog/components/azure-files.json | 2 +- .../camel/springboot/catalog/components/file.json | 2 +- .../camel/springboot/catalog/components/ftp.json | 2 +- .../camel/springboot/catalog/components/ftps.json | 2 +- .../camel/springboot/catalog/components/sftp.json | 2 +- .../camel/springboot/catalog/components/smb.json | 2 +- .../src/main/docs/spring-boot.json | 17 ++++++++ .../IBMSecretsManagerVaultAutoConfiguration.java | 45 ++++++++++++++++++++ ...SecretsManagerVaultConfigurationProperties.java | 49 ++++++++++++++++++++++ ...rk.boot.autoconfigure.AutoConfiguration.imports | 1 + .../IBMSecretsManagerVaultConfigurationTest.java | 44 +++++++++++++++++++ 11 files changed, 162 insertions(+), 6 deletions(-) diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/azure-files.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/azure-files.json index c58419f9588..3e055073a83 100644 --- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/azure-files.json +++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/azure-files.json @@ -104,7 +104,7 @@ "filterDirectory": { "index": 53, "kind": "parameter", "displayName": "Filter Directory", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters the directory based on Simple language. For example to filter on current date, you can use a simple date pattern such as ${date:now:yyyMMdd}" }, "filterFile": { "index": 54, "kind": "parameter", "displayName": "Filter File", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters the file based on Simple language. For example to filter on file size, you can use ${file:size} 5000" }, "idempotent": { "index": 55, "kind": "parameter", "displayName": "Idempotent", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "description": "Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entries. If noop=true then idempotent w [...] - "idempotentEager": { "index": 56, "kind": "parameter", "displayName": "Idempotent Eager", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "true", "description": "Sets whether to eagerly add the filename to the idempotent repository or wait until the exchange is complete." }, + "idempotentEager": { "index": 56, "kind": "parameter", "displayName": "Idempotent Eager", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "false", "description": "Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entri [...] "idempotentKey": { "index": 57, "kind": "parameter", "displayName": "Idempotent Key", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom idempotent key. By default the absolute path of the file is used. You can use the File Language, for example to use the file name and file size, you can do: idempotentKey=${file:name}-${file:size}" }, "idempotentRepository": { "index": 58, "kind": "parameter", "displayName": "Idempotent Repository", "group": "filter", "label": "consumer,filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.IdempotentRepository", "deprecated": false, "autowired": false, "secret": false, "description": "A pluggable repository org.apache.camel.spi.IdempotentRepository which by default use MemoryIdempotentRepository if none is specified and idempotent is true." }, "include": { "index": 59, "kind": "parameter", "displayName": "Include", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Is used to include files, if filename matches the regex pattern (matching is case in-sensitive). Notice if you use symbols such as plus sign and others you would need to configure this using the RAW() syntax if configuring th [...] diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/file.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/file.json index cbb4df982b7..99b5bb12978 100644 --- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/file.json +++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/file.json @@ -108,7 +108,7 @@ "filterDirectory": { "index": 56, "kind": "parameter", "displayName": "Filter Directory", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters the directory based on Simple language. For example to filter on current date, you can use a simple date pattern such as ${date:now:yyyMMdd}" }, "filterFile": { "index": 57, "kind": "parameter", "displayName": "Filter File", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters the file based on Simple language. For example to filter on file size, you can use ${file:size} 5000" }, "idempotent": { "index": 58, "kind": "parameter", "displayName": "Idempotent", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "description": "Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entries. If noop=true then idempotent w [...] - "idempotentEager": { "index": 59, "kind": "parameter", "displayName": "Idempotent Eager", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "true", "description": "Sets whether to eagerly add the filename to the idempotent repository or wait until the exchange is complete." }, + "idempotentEager": { "index": 59, "kind": "parameter", "displayName": "Idempotent Eager", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "false", "description": "Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entri [...] "idempotentKey": { "index": 60, "kind": "parameter", "displayName": "Idempotent Key", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom idempotent key. By default the absolute path of the file is used. You can use the File Language, for example to use the file name and file size, you can do: idempotentKey=${file:name}-${file:size}" }, "idempotentRepository": { "index": 61, "kind": "parameter", "displayName": "Idempotent Repository", "group": "filter", "label": "consumer,filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.IdempotentRepository", "deprecated": false, "autowired": false, "secret": false, "description": "A pluggable repository org.apache.camel.spi.IdempotentRepository which by default use MemoryIdempotentRepository if none is specified and idempotent is true." }, "include": { "index": 62, "kind": "parameter", "displayName": "Include", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Is used to include files, if filename matches the regex pattern (matching is case in-sensitive). Notice if you use symbols such as plus sign and others you would need to configure this using the RAW() syntax if configuring th [...] diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/ftp.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/ftp.json index 20ba08e63f1..12ee44eaa84 100644 --- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/ftp.json +++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/ftp.json @@ -127,7 +127,7 @@ "filterDirectory": { "index": 73, "kind": "parameter", "displayName": "Filter Directory", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters the directory based on Simple language. For example to filter on current date, you can use a simple date pattern such as ${date:now:yyyMMdd}" }, "filterFile": { "index": 74, "kind": "parameter", "displayName": "Filter File", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters the file based on Simple language. For example to filter on file size, you can use ${file:size} 5000" }, "idempotent": { "index": 75, "kind": "parameter", "displayName": "Idempotent", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "description": "Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entries. If noop=true then idempotent w [...] - "idempotentEager": { "index": 76, "kind": "parameter", "displayName": "Idempotent Eager", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "true", "description": "Sets whether to eagerly add the filename to the idempotent repository or wait until the exchange is complete." }, + "idempotentEager": { "index": 76, "kind": "parameter", "displayName": "Idempotent Eager", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "false", "description": "Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entri [...] "idempotentKey": { "index": 77, "kind": "parameter", "displayName": "Idempotent Key", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom idempotent key. By default the absolute path of the file is used. You can use the File Language, for example to use the file name and file size, you can do: idempotentKey=${file:name}-${file:size}" }, "idempotentRepository": { "index": 78, "kind": "parameter", "displayName": "Idempotent Repository", "group": "filter", "label": "consumer,filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.IdempotentRepository", "deprecated": false, "autowired": false, "secret": false, "description": "A pluggable repository org.apache.camel.spi.IdempotentRepository which by default use MemoryIdempotentRepository if none is specified and idempotent is true." }, "include": { "index": 79, "kind": "parameter", "displayName": "Include", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Is used to include files, if filename matches the regex pattern (matching is case in-sensitive). Notice if you use symbols such as plus sign and others you would need to configure this using the RAW() syntax if configuring th [...] diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/ftps.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/ftps.json index 890b3358e7d..35dd0f091cc 100644 --- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/ftps.json +++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/ftps.json @@ -128,7 +128,7 @@ "filterDirectory": { "index": 73, "kind": "parameter", "displayName": "Filter Directory", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters the directory based on Simple language. For example to filter on current date, you can use a simple date pattern such as ${date:now:yyyMMdd}" }, "filterFile": { "index": 74, "kind": "parameter", "displayName": "Filter File", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters the file based on Simple language. For example to filter on file size, you can use ${file:size} 5000" }, "idempotent": { "index": 75, "kind": "parameter", "displayName": "Idempotent", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "description": "Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entries. If noop=true then idempotent w [...] - "idempotentEager": { "index": 76, "kind": "parameter", "displayName": "Idempotent Eager", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "true", "description": "Sets whether to eagerly add the filename to the idempotent repository or wait until the exchange is complete." }, + "idempotentEager": { "index": 76, "kind": "parameter", "displayName": "Idempotent Eager", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "false", "description": "Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entri [...] "idempotentKey": { "index": 77, "kind": "parameter", "displayName": "Idempotent Key", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom idempotent key. By default the absolute path of the file is used. You can use the File Language, for example to use the file name and file size, you can do: idempotentKey=${file:name}-${file:size}" }, "idempotentRepository": { "index": 78, "kind": "parameter", "displayName": "Idempotent Repository", "group": "filter", "label": "consumer,filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.IdempotentRepository", "deprecated": false, "autowired": false, "secret": false, "description": "A pluggable repository org.apache.camel.spi.IdempotentRepository which by default use MemoryIdempotentRepository if none is specified and idempotent is true." }, "include": { "index": 79, "kind": "parameter", "displayName": "Include", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Is used to include files, if filename matches the regex pattern (matching is case in-sensitive). Notice if you use symbols such as plus sign and others you would need to configure this using the RAW() syntax if configuring th [...] diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/sftp.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/sftp.json index dceb772ae20..fc60266364a 100644 --- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/sftp.json +++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/sftp.json @@ -125,7 +125,7 @@ "filterDirectory": { "index": 72, "kind": "parameter", "displayName": "Filter Directory", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters the directory based on Simple language. For example to filter on current date, you can use a simple date pattern such as ${date:now:yyyMMdd}" }, "filterFile": { "index": 73, "kind": "parameter", "displayName": "Filter File", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters the file based on Simple language. For example to filter on file size, you can use ${file:size} 5000" }, "idempotent": { "index": 74, "kind": "parameter", "displayName": "Idempotent", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "description": "Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entries. If noop=true then idempotent w [...] - "idempotentEager": { "index": 75, "kind": "parameter", "displayName": "Idempotent Eager", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "true", "description": "Sets whether to eagerly add the filename to the idempotent repository or wait until the exchange is complete." }, + "idempotentEager": { "index": 75, "kind": "parameter", "displayName": "Idempotent Eager", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "false", "description": "Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entri [...] "idempotentKey": { "index": 76, "kind": "parameter", "displayName": "Idempotent Key", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom idempotent key. By default the absolute path of the file is used. You can use the File Language, for example to use the file name and file size, you can do: idempotentKey=${file:name}-${file:size}" }, "idempotentRepository": { "index": 77, "kind": "parameter", "displayName": "Idempotent Repository", "group": "filter", "label": "consumer,filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.IdempotentRepository", "deprecated": false, "autowired": false, "secret": false, "description": "A pluggable repository org.apache.camel.spi.IdempotentRepository which by default use MemoryIdempotentRepository if none is specified and idempotent is true." }, "include": { "index": 78, "kind": "parameter", "displayName": "Include", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Is used to include files, if filename matches the regex pattern (matching is case in-sensitive). Notice if you use symbols such as plus sign and others you would need to configure this using the RAW() syntax if configuring th [...] diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/smb.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/smb.json index 37147c33c97..7d15e660d6b 100644 --- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/smb.json +++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/smb.json @@ -104,7 +104,7 @@ "filterDirectory": { "index": 52, "kind": "parameter", "displayName": "Filter Directory", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters the directory based on Simple language. For example to filter on current date, you can use a simple date pattern such as ${date:now:yyyMMdd}" }, "filterFile": { "index": 53, "kind": "parameter", "displayName": "Filter File", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters the file based on Simple language. For example to filter on file size, you can use ${file:size} 5000" }, "idempotent": { "index": 54, "kind": "parameter", "displayName": "Idempotent", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "description": "Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entries. If noop=true then idempotent w [...] - "idempotentEager": { "index": 55, "kind": "parameter", "displayName": "Idempotent Eager", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "true", "description": "Sets whether to eagerly add the filename to the idempotent repository or wait until the exchange is complete." }, + "idempotentEager": { "index": 55, "kind": "parameter", "displayName": "Idempotent Eager", "group": "filter", "label": "consumer,filter", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "false", "description": "Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entri [...] "idempotentKey": { "index": 56, "kind": "parameter", "displayName": "Idempotent Key", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom idempotent key. By default the absolute path of the file is used. You can use the File Language, for example to use the file name and file size, you can do: idempotentKey=${file:name}-${file:size}" }, "idempotentRepository": { "index": 57, "kind": "parameter", "displayName": "Idempotent Repository", "group": "filter", "label": "consumer,filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.IdempotentRepository", "deprecated": false, "autowired": false, "secret": false, "description": "A pluggable repository org.apache.camel.spi.IdempotentRepository which by default use MemoryIdempotentRepository if none is specified and idempotent is true." }, "include": { "index": 58, "kind": "parameter", "displayName": "Include", "group": "filter", "label": "consumer,filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Is used to include files, if filename matches the regex pattern (matching is case in-sensitive). Notice if you use symbols such as plus sign and others you would need to configure this using the RAW() syntax if configuring th [...] 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 83273ca07aa..64874e204f5 100644 --- a/core/camel-spring-boot/src/main/docs/spring-boot.json +++ b/core/camel-spring-boot/src/main/docs/spring-boot.json @@ -161,6 +161,11 @@ "type": "org.apache.camel.spring.boot.vault.HashicorpVaultConfigurationProperties", "sourceType": "org.apache.camel.spring.boot.vault.HashicorpVaultConfigurationProperties" }, + { + "name": "camel.vault.ibm", + "type": "org.apache.camel.spring.boot.vault.IBMSecretsManagerVaultConfigurationProperties", + "sourceType": "org.apache.camel.spring.boot.vault.IBMSecretsManagerVaultConfigurationProperties" + }, { "name": "camel.vault.kubernetes", "type": "org.apache.camel.spring.boot.vault.KubernetesVaultConfigurationProperties", @@ -1926,6 +1931,18 @@ "description": "The Hashicorp Vault Token for accessing the service", "sourceType": "org.apache.camel.spring.boot.vault.HashicorpVaultConfigurationProperties" }, + { + "name": "camel.vault.ibm.service-url", + "type": "java.lang.String", + "description": "The IBM Secrets Manager Service URL", + "sourceType": "org.apache.camel.spring.boot.vault.IBMSecretsManagerVaultConfigurationProperties" + }, + { + "name": "camel.vault.ibm.token", + "type": "java.lang.String", + "description": "The IBM Secrets Manager Token", + "sourceType": "org.apache.camel.spring.boot.vault.IBMSecretsManagerVaultConfigurationProperties" + }, { "name": "camel.vault.kubernetes.refresh-enabled", "type": "java.lang.Boolean", diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/IBMSecretsManagerVaultAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/IBMSecretsManagerVaultAutoConfiguration.java new file mode 100644 index 00000000000..9302479ffe1 --- /dev/null +++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/IBMSecretsManagerVaultAutoConfiguration.java @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.spring.boot.vault; + +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.vault.IBMSecretsManagerVaultConfiguration; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration(proxyBeanMethods = false) +@ConditionalOnBean(CamelAutoConfiguration.class) +@EnableConfigurationProperties(IBMSecretsManagerVaultConfigurationProperties.class) +@AutoConfigureAfter(CamelAutoConfiguration.class) +public class IBMSecretsManagerVaultAutoConfiguration { + + @Bean + public IBMSecretsManagerVaultConfiguration ibmSecretsManagerVaultConfiguration(IBMSecretsManagerVaultConfigurationProperties config) { + IBMSecretsManagerVaultConfiguration answer = new IBMSecretsManagerVaultConfiguration(); + answer.setToken(config.getToken()); + answer.setServiceUrl(config.getServiceUrl()); + System.err.println(config.getServiceUrl()); + System.err.println(config.getToken()); + System.err.println(answer.ibmSecretsManager().getServiceUrl()); + System.err.println(answer.ibmSecretsManager().getToken()); + return answer; + } + +} diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/IBMSecretsManagerVaultConfigurationProperties.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/IBMSecretsManagerVaultConfigurationProperties.java new file mode 100644 index 00000000000..38f49da8f25 --- /dev/null +++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/IBMSecretsManagerVaultConfigurationProperties.java @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.spring.boot.vault; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +@ConfigurationProperties(prefix = "camel.vault.ibm") +public class IBMSecretsManagerVaultConfigurationProperties { + + /** + * The IBM Secrets Manager Token + */ + private String token; + + /** + * The IBM Secrets Manager Service URL + */ + private String serviceUrl; + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public String getServiceUrl() { + return serviceUrl; + } + + public void setServiceUrl(String serviceUrl) { + this.serviceUrl = serviceUrl; + } +} diff --git a/core/camel-spring-boot/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/core/camel-spring-boot/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index cf3819c1455..b3be066d94f 100644 --- a/core/camel-spring-boot/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/core/camel-spring-boot/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -41,3 +41,4 @@ org.apache.camel.spring.boot.vault.AzureVaultAutoConfiguration org.apache.camel.spring.boot.vault.HashicorpVaultAutoConfiguration org.apache.camel.spring.boot.vault.KubernetesVaultAutoConfiguration org.apache.camel.spring.boot.vault.KubernetesConfigMapVaultAutoConfiguration +org.apache.camel.spring.boot.vault.IBMSecretsManagerVaultAutoConfiguration 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 new file mode 100644 index 00000000000..b346c3220dc --- /dev/null +++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/IBMSecretsManagerVaultConfigurationTest.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.spring.boot.vault; + +import org.apache.camel.CamelContext; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.DirtiesContext; + +@DirtiesContext +@CamelSpringBootTest +@EnableAutoConfiguration +@SpringBootTest(classes = { IBMSecretsManagerVaultConfigurationTest.class }, properties = { + "camel.vault.ibm.token=myToken", + "camel.vault.ibm.service-url=http://myHost" }) +public class IBMSecretsManagerVaultConfigurationTest { + + @Autowired + private CamelContext camelContext; + + @Test + public void testIBMSecretsManagerVault() throws Exception { + Assertions.assertEquals("myToken", camelContext.getVaultConfiguration().ibmSecretsManager().getToken()); + Assertions.assertEquals("http://myHost", camelContext.getVaultConfiguration().ibmSecretsManager().getServiceUrl()); + } +}