You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2023/12/12 13:13:29 UTC
(camel) branch main updated: CAMEL-20220 - Camel Azure Key Vault: Support Azure Identity in the component and secrets function - Docs (#12423)
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
The following commit(s) were added to refs/heads/main by this push:
new f79ab6c2bd5 CAMEL-20220 - Camel Azure Key Vault: Support Azure Identity in the component and secrets function - Docs (#12423)
f79ab6c2bd5 is described below
commit f79ab6c2bd595adb4f3eee3bb602d814e27e6610
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Dec 12 14:13:22 2023 +0100
CAMEL-20220 - Camel Azure Key Vault: Support Azure Identity in the component and secrets function - Docs (#12423)
* CAMEL-20220 - Camel Azure Key Vault: Support Azure Identity in the component and secrets function - Docs
Signed-off-by: Andrea Cosentino <an...@gmail.com>
* CAMEL-20220 - Camel Azure Key Vault: Support Azure Identity in the component and secrets function - Security Docs
Signed-off-by: Andrea Cosentino <an...@gmail.com>
---------
Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
.../src/main/docs/azure-key-vault-component.adoc | 32 ++++++++++++++++++++++
.../azure/key/vault/KeyVaultConfiguration.java | 4 +--
.../azure/key/vault/KeyVaultEndpoint.java | 1 -
docs/user-manual/modules/ROOT/pages/security.adoc | 32 ++++++++++++++++++++++
4 files changed, 65 insertions(+), 4 deletions(-)
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 1e64b2b4174..7b950138fcf 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
@@ -73,6 +73,22 @@ camel.vault.azure.clientSecret = clientSecret
camel.vault.azure.vaultName = vaultName
----
+Or you can enable the usage of Azure Identity in the following way:
+
+[source,bash]
+----
+export $CAMEL_VAULT_AZURE_IDENTITY_ENABLED=true
+export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
+----
+
+You can also enable the usage of Azure Identity in the `application.properties` file such as:
+
+[source,properties]
+----
+camel.vault.azure.azureIdentityEnabled = true
+camel.vault.azure.vaultName = vaultName
+----
+
At this point you'll be able to reference a property in the following way:
[source,xml]
@@ -209,6 +225,22 @@ camel.vault.azure.clientSecret = clientSecret
camel.vault.azure.vaultName = vaultName
----
+If you want to use Azure Identity with environment variables, you can do in the following way:
+
+[source,bash]
+----
+export $CAMEL_VAULT_AZURE_IDENTITY_ENABLED=true
+export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
+----
+
+You can also enable the usage of Azure Identity in the `application.properties` file such as:
+
+[source,properties]
+----
+camel.vault.azure.azureIdentityEnabled = true
+camel.vault.azure.vaultName = vaultName
+----
+
To enable the automatic refresh you'll need additional properties to set:
[source,properties]
diff --git a/components/camel-azure/camel-azure-key-vault/src/main/java/org/apache/camel/component/azure/key/vault/KeyVaultConfiguration.java b/components/camel-azure/camel-azure-key-vault/src/main/java/org/apache/camel/component/azure/key/vault/KeyVaultConfiguration.java
index 2e3fb12b957..0605858194d 100644
--- a/components/camel-azure/camel-azure-key-vault/src/main/java/org/apache/camel/component/azure/key/vault/KeyVaultConfiguration.java
+++ b/components/camel-azure/camel-azure-key-vault/src/main/java/org/apache/camel/component/azure/key/vault/KeyVaultConfiguration.java
@@ -23,7 +23,6 @@ import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriParams;
import org.apache.camel.spi.UriPath;
-import static org.apache.camel.component.azure.key.vault.CredentialType.AZURE_IDENTITY;
import static org.apache.camel.component.azure.key.vault.CredentialType.CLIENT_SECRET;
@UriParams
@@ -43,7 +42,7 @@ public class KeyVaultConfiguration implements Cloneable {
@UriParam(label = "producer")
private KeyVaultOperation operation = KeyVaultOperation.createSecret;
@UriParam(label = "common", enums = "CLIENT_SECRET,AZURE_IDENTITY",
- defaultValue = "CLIENT_SECRET")
+ defaultValue = "CLIENT_SECRET")
private CredentialType credentialType = CLIENT_SECRET;
/**
@@ -112,7 +111,6 @@ public class KeyVaultConfiguration implements Cloneable {
this.operation = operation;
}
-
public CredentialType getCredentialType() {
return credentialType;
}
diff --git a/components/camel-azure/camel-azure-key-vault/src/main/java/org/apache/camel/component/azure/key/vault/KeyVaultEndpoint.java b/components/camel-azure/camel-azure-key-vault/src/main/java/org/apache/camel/component/azure/key/vault/KeyVaultEndpoint.java
index 17bdcbca647..e1c6da18ede 100644
--- a/components/camel-azure/camel-azure-key-vault/src/main/java/org/apache/camel/component/azure/key/vault/KeyVaultEndpoint.java
+++ b/components/camel-azure/camel-azure-key-vault/src/main/java/org/apache/camel/component/azure/key/vault/KeyVaultEndpoint.java
@@ -17,7 +17,6 @@
package org.apache.camel.component.azure.key.vault;
import com.azure.core.credential.TokenCredential;
-import com.azure.identity.ClientSecretCredential;
import com.azure.identity.ClientSecretCredentialBuilder;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.security.keyvault.secrets.SecretClient;
diff --git a/docs/user-manual/modules/ROOT/pages/security.adoc b/docs/user-manual/modules/ROOT/pages/security.adoc
index e749620a357..36f7a26eceb 100644
--- a/docs/user-manual/modules/ROOT/pages/security.adoc
+++ b/docs/user-manual/modules/ROOT/pages/security.adoc
@@ -330,6 +330,22 @@ camel.vault.azure.clientSecret = clientSecret
camel.vault.azure.vaultName = vaultName
----
+Or you can enable the usage of Azure Identity in the following way:
+
+[source,bash]
+----
+export $CAMEL_VAULT_AZURE_IDENTITY_ENABLED=true
+export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
+----
+
+You can also enable the usage of Azure Identity in the `application.properties` file such as:
+
+[source,properties]
+----
+camel.vault.azure.azureIdentityEnabled = true
+camel.vault.azure.vaultName = vaultName
+----
+
At this point you'll be able to reference a property in the following way:
[source,xml]
@@ -647,6 +663,22 @@ camel.vault.azure.clientSecret = clientSecret
camel.vault.azure.vaultName = vaultName
----
+If you want to use Azure Identity with environment variables, you can do in the following way:
+
+[source,bash]
+----
+export $CAMEL_VAULT_AZURE_IDENTITY_ENABLED=true
+export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
+----
+
+You can also enable the usage of Azure Identity in the `application.properties` file such as:
+
+[source,properties]
+----
+camel.vault.azure.azureIdentityEnabled = true
+camel.vault.azure.vaultName = vaultName
+----
+
To enable the automatic refresh you'll need additional properties to set:
[source,properties]