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.git
commit 0777c0030775999e434c9c95a3c4279d932c1d02 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Wed Jul 13 14:28:09 2022 +0200 CAMEL-18208 - vault: allow to retrieve a specific secret version/revision - Azure Key Vault --- .../src/main/docs/azure-key-vault-component.adoc | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/components/camel-azure/camel-azure-key-vault/src/main/docs/azure-key-vault-component.adoc b/components/camel-azure/camel-azure-key-vault/src/main/docs/azure-key-vault-component.adoc index 97abc1a04d0..d4cdb75ce55 100644 --- a/components/camel-azure/camel-azure-key-vault/src/main/docs/azure-key-vault-component.adoc +++ b/components/camel-azure/camel-azure-key-vault/src/main/docs/azure-key-vault-component.adoc @@ -142,6 +142,44 @@ You could specify a default value in case the particular field of secret is not In this case if the secret doesn't exist or the secret exists, but the username field is not part of the secret, the property will fallback to "admin" as value. +There is also the syntax to get a particular version of the secret for both the approach, with field/default value specified or only with secret: + +[source,xml] +---- +<camelContext> + <route> + <from uri="direct:start"/> + <to uri="{{azure:route@bf9b4f4b-8e63-43fd-a73c-3e2d3748b451}}"/> + </route> +</camelContext> +---- + +This approach will return the RAW route secret with version 'bf9b4f4b-8e63-43fd-a73c-3e2d3748b451'. + +[source,xml] +---- +<camelContext> + <route> + <from uri="direct:start"/> + <to uri="{{azure:route:default@bf9b4f4b-8e63-43fd-a73c-3e2d3748b451}}"/> + </route> +</camelContext> +---- + +This approach will return the route secret value with version 'bf9b4f4b-8e63-43fd-a73c-3e2d3748b451' or default value in case the secret doesn't exist or the version doesn't exist. + +[source,xml] +---- +<camelContext> + <route> + <from uri="direct:start"/> + <log message="Username is {{azure:database/username:admin@bf9b4f4b-8e63-43fd-a73c-3e2d3748b451}}"/> + </route> +</camelContext> +---- + +This approach will return the username field of the database secret with version 'bf9b4f4b-8e63-43fd-a73c-3e2d3748b451' or admin in case the secret doesn't exist or the version doesn't exist. + For the moment we are not considering the rotation function, if any will be applied, but it is in the work to be done. The only requirement is adding the camel-azure-key-vault jar to your Camel application.