This is an automated email from the ASF dual-hosted git repository.

Croway 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 29180bb3d73 CAMEL-25675: camel-spring-boot - Hashicorp Vault options 
for the aws-iam, azure-msi and gcp-gce logins
29180bb3d73 is described below

commit 29180bb3d730d096e1c1d469fc2aa595bc40c0a6
Author: croway <[email protected]>
AuthorDate: Mon Nov 16 08:49:56 2026 +0100

    CAMEL-25675: camel-spring-boot - Hashicorp Vault options for the aws-iam, 
azure-msi and gcp-gce logins
    
    Adds camel.vault.hashicorp.aws-iam-server-id, aws-region, aws-sts-endpoint,
    azure-resource and azure-client-id, which Camel added to
    HashicorpVaultConfiguration together with the aws-iam, azure-msi and
    gcp-gce logins, so that VaultConfigurationPropertiesMappingTest passes
    again (Camel-Spring-Boot Daily main #460-#464). The authentication option
    now lists the cloud logins as well.
    
    azure-resource defaults to https://management.azure.com/, as in Camel,
    because the properties are copied onto the Camel configuration including
    the null ones.
---
 .../src/main/docs/spring-boot.json                 | 39 +++++++++-
 .../HashicorpVaultConfigurationProperties.java     | 90 ++++++++++++++++++++--
 .../vault/HashicorpVaultConfigurationTest.java     |  4 +
 3 files changed, 121 insertions(+), 12 deletions(-)

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 b99955d9abd..ec2f3b1d9bb 100644
--- a/core/camel-spring-boot/src/main/docs/spring-boot.json
+++ b/core/camel-spring-boot/src/main/docs/spring-boot.json
@@ -1947,16 +1947,47 @@
     {
       "name": "camel.vault.hashicorp.auth-mount-path",
       "type": "java.lang.String",
-      "description": "The path the login method is mounted at in hashicorp 
vault (without auth\/), when it is not the default path of the login method: 
approle, kubernetes or jwt",
+      "description": "The path the login method is mounted at in hashicorp 
vault (without auth\/), when it is not the default path of the login method: 
approle, kubernetes, jwt, cert, aws (for aws-iam), azure (for azure-msi) or gcp 
(for gcp-gce)",
       "sourceType": 
"org.apache.camel.spring.boot.vault.HashicorpVaultConfigurationProperties"
     },
     {
       "name": "camel.vault.hashicorp.authentication",
       "type": "java.lang.String",
-      "description": "How to log in to hashicorp vault: token (a fixed token), 
approle (a role ID and a secret ID), kubernetes (the service account token of 
the pod), jwt (a JWT, such as a workload identity token) or cert (the TLS 
client certificate of the keyStore). Camel renews the token before it expires, 
and logs in again when the token can no longer be renewed.",
+      "description": "How to log in to hashicorp vault: token (a fixed token), 
approle (a role ID and a secret ID), kubernetes (the service account token of 
the pod), jwt (a JWT, such as a workload identity token), cert (the TLS client 
certificate of the keyStore), aws-iam (the AWS credentials of the application), 
azure-msi (the Azure managed identity) or gcp-gce (the service account of the 
Google Compute Engine instance). Camel renews the token before it expires, and 
logs in again when  [...]
       "sourceType": 
"org.apache.camel.spring.boot.vault.HashicorpVaultConfigurationProperties",
       "defaultValue": "token"
     },
+    {
+      "name": "camel.vault.hashicorp.aws-iam-server-id",
+      "type": "java.lang.String",
+      "description": "The value of the X-Vault-AWS-IAM-Server-ID header of the 
aws-iam login, when the AWS login of hashicorp vault requires one 
(iam_server_id_header_value)",
+      "sourceType": 
"org.apache.camel.spring.boot.vault.HashicorpVaultConfigurationProperties"
+    },
+    {
+      "name": "camel.vault.hashicorp.aws-region",
+      "type": "java.lang.String",
+      "description": "The AWS region the aws-iam login signs its request for, 
which must be the region of awsStsEndpoint. When not set: us-east-1 with the 
global endpoint, else the region of the AWS SDK default region chain (such as 
the AWS_REGION environment variable).",
+      "sourceType": 
"org.apache.camel.spring.boot.vault.HashicorpVaultConfigurationProperties"
+    },
+    {
+      "name": "camel.vault.hashicorp.aws-sts-endpoint",
+      "type": "java.lang.String",
+      "description": "The AWS STS endpoint of the aws-iam login, which the AWS 
login of hashicorp vault must accept (its sts_endpoint). When not set, the 
global endpoint https:\/\/sts.amazonaws.com\/.",
+      "sourceType": 
"org.apache.camel.spring.boot.vault.HashicorpVaultConfigurationProperties"
+    },
+    {
+      "name": "camel.vault.hashicorp.azure-client-id",
+      "type": "java.lang.String",
+      "description": "The client ID of a user-assigned managed identity, for 
the azure-msi login. When not set, the system-assigned managed identity.",
+      "sourceType": 
"org.apache.camel.spring.boot.vault.HashicorpVaultConfigurationProperties"
+    },
+    {
+      "name": "camel.vault.hashicorp.azure-resource",
+      "type": "java.lang.String",
+      "description": "The resource (audience) of the managed identity token of 
the azure-msi login, which must be the resource of the Azure login of hashicorp 
vault",
+      "sourceType": 
"org.apache.camel.spring.boot.vault.HashicorpVaultConfigurationProperties",
+      "defaultValue": "https:\/\/management.azure.com\/"
+    },
     {
       "name": "camel.vault.hashicorp.cloud",
       "type": "java.lang.Boolean",
@@ -1985,7 +2016,7 @@
     {
       "name": "camel.vault.hashicorp.key-store",
       "type": "java.lang.String",
-      "description": "The file with the TLS client certificate and its private 
key, which Camel presents to hashicorp vault: for the cert login, or for a 
Vault that requires client certificates. A PKCS12 or JKS key store, or PEM with 
the certificate and the PKCS#8 private key.",
+      "description": "The file with the TLS client certificate and its private 
key, which Camel presents to hashicorp vault: for the cert login, or for a 
Vault that requires client certificates. A PKCS12 or JKS key store, or PEM with 
the certificate and its unencrypted private key, in PKCS#8 or, for an RSA key, 
in PKCS#1.",
       "sourceType": 
"org.apache.camel.spring.boot.vault.HashicorpVaultConfigurationProperties"
     },
     {
@@ -2023,7 +2054,7 @@
     {
       "name": "camel.vault.hashicorp.role",
       "type": "java.lang.String",
-      "description": "The hashicorp vault role to log in as, for the 
kubernetes and jwt logins. The jwt login can leave it out when the login method 
has a default role.",
+      "description": "The hashicorp vault role to log in as, for the 
kubernetes, jwt, cert, aws-iam, azure-msi and gcp-gce logins. The jwt login can 
leave it out when the login method has a default role, the aws-iam login to log 
in as the role named as the IAM principal, and the cert login to let Vault pick 
the certificate role that trusts the certificate.",
       "sourceType": 
"org.apache.camel.spring.boot.vault.HashicorpVaultConfigurationProperties"
     },
     {
diff --git 
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/HashicorpVaultConfigurationProperties.java
 
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/HashicorpVaultConfigurationProperties.java
index 80e4e138030..1c0cc49dae8 100644
--- 
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/HashicorpVaultConfigurationProperties.java
+++ 
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/HashicorpVaultConfigurationProperties.java
@@ -24,11 +24,12 @@ public class HashicorpVaultConfigurationProperties {
 
     /**
      * How to log in to hashicorp vault: token (a fixed token), approle (a 
role ID and a secret ID), kubernetes (the
-     * service account token of the pod), jwt (a JWT, such as a workload 
identity token) or cert (the TLS client
-     * certificate of the keyStore). Camel renews the token before it expires, 
and logs in again when the token can no
-     * longer be renewed.
+     * service account token of the pod), jwt (a JWT, such as a workload 
identity token), cert (the TLS client
+     * certificate of the keyStore), aws-iam (the AWS credentials of the 
application), azure-msi (the Azure managed
+     * identity) or gcp-gce (the service account of the Google Compute Engine 
instance). Camel renews the token before
+     * it expires, and logs in again when the token can no longer be renewed.
      */
-    @Metadata(defaultValue = "token", enums = 
"token,approle,kubernetes,jwt,cert")
+    @Metadata(defaultValue = "token", enums = 
"token,approle,kubernetes,jwt,cert,aws-iam,azure-msi,gcp-gce")
     private String authentication = "token";
 
     /**
@@ -47,8 +48,10 @@ public class HashicorpVaultConfigurationProperties {
     private String secretId;
 
     /**
-     * The hashicorp vault role to log in as, for the kubernetes and jwt 
logins. The jwt login can leave it out when the
-     * login method has a default role.
+     * The hashicorp vault role to log in as, for the kubernetes, jwt, cert, 
aws-iam, azure-msi and gcp-gce logins. The
+     * jwt login can leave it out when the login method has a default role, 
the aws-iam login to log in as the role
+     * named as the IAM principal, and the cert login to let Vault pick the 
certificate role that trusts the
+     * certificate.
      */
     private String role;
 
@@ -66,7 +69,7 @@ public class HashicorpVaultConfigurationProperties {
 
     /**
      * The path the login method is mounted at in hashicorp vault (without 
auth/), when it is not the default path of
-     * the login method: approle, kubernetes or jwt
+     * the login method: approle, kubernetes, jwt, cert, aws (for aws-iam), 
azure (for azure-msi) or gcp (for gcp-gce)
      */
     private String authMountPath;
 
@@ -85,7 +88,7 @@ public class HashicorpVaultConfigurationProperties {
     /**
      * The file with the TLS client certificate and its private key, which 
Camel presents to hashicorp vault: for the
      * cert login, or for a Vault that requires client certificates. A PKCS12 
or JKS key store, or PEM with the
-     * certificate and the PKCS#8 private key.
+     * certificate and its unencrypted private key, in PKCS#8 or, for an RSA 
key, in PKCS#1.
      */
     private String keyStore;
 
@@ -94,6 +97,37 @@ public class HashicorpVaultConfigurationProperties {
      */
     private String keyStorePassword;
 
+    /**
+     * The value of the X-Vault-AWS-IAM-Server-ID header of the aws-iam login, 
when the AWS login of hashicorp vault
+     * requires one (iam_server_id_header_value)
+     */
+    private String awsIamServerId;
+
+    /**
+     * The AWS region the aws-iam login signs its request for, which must be 
the region of awsStsEndpoint. When not set:
+     * us-east-1 with the global endpoint, else the region of the AWS SDK 
default region chain (such as the AWS_REGION
+     * environment variable).
+     */
+    private String awsRegion;
+
+    /**
+     * The AWS STS endpoint of the aws-iam login, which the AWS login of 
hashicorp vault must accept (its sts_endpoint).
+     * When not set, the global endpoint https://sts.amazonaws.com/.
+     */
+    private String awsStsEndpoint;
+
+    /**
+     * The resource (audience) of the managed identity token of the azure-msi 
login, which must be the resource of the
+     * Azure login of hashicorp vault
+     */
+    private String azureResource = "https://management.azure.com/";;
+
+    /**
+     * The client ID of a user-assigned managed identity, for the azure-msi 
login. When not set, the system-assigned
+     * managed identity.
+     */
+    private String azureClientId;
+
     /**
      * The Hashicorp Vault Host for accessing the service
      */
@@ -230,6 +264,46 @@ public class HashicorpVaultConfigurationProperties {
         this.keyStorePassword = keyStorePassword;
     }
 
+    public String getAwsIamServerId() {
+        return awsIamServerId;
+    }
+
+    public void setAwsIamServerId(String awsIamServerId) {
+        this.awsIamServerId = awsIamServerId;
+    }
+
+    public String getAwsRegion() {
+        return awsRegion;
+    }
+
+    public void setAwsRegion(String awsRegion) {
+        this.awsRegion = awsRegion;
+    }
+
+    public String getAwsStsEndpoint() {
+        return awsStsEndpoint;
+    }
+
+    public void setAwsStsEndpoint(String awsStsEndpoint) {
+        this.awsStsEndpoint = awsStsEndpoint;
+    }
+
+    public String getAzureResource() {
+        return azureResource;
+    }
+
+    public void setAzureResource(String azureResource) {
+        this.azureResource = azureResource;
+    }
+
+    public String getAzureClientId() {
+        return azureClientId;
+    }
+
+    public void setAzureClientId(String azureClientId) {
+        this.azureClientId = azureClientId;
+    }
+
     public String getHost() {
         return host;
     }
diff --git 
a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/HashicorpVaultConfigurationTest.java
 
b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/HashicorpVaultConfigurationTest.java
index 8638ca1c307..fc016a6482c 100644
--- 
a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/HashicorpVaultConfigurationTest.java
+++ 
b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/HashicorpVaultConfigurationTest.java
@@ -47,5 +47,9 @@ public class HashicorpVaultConfigurationTest {
         Assertions.assertEquals(true, 
camelContext.getVaultConfiguration().hashicorp().isRefreshEnabled());
         Assertions.assertEquals(10000, 
camelContext.getVaultConfiguration().hashicorp().getRefreshPeriod());
         Assertions.assertEquals("secret1,secret2", 
camelContext.getVaultConfiguration().hashicorp().getSecrets());
+        // options left unset keep the Camel defaults, as the properties are 
copied onto the Camel configuration
+        Assertions.assertEquals("token", 
camelContext.getVaultConfiguration().hashicorp().getAuthentication());
+        Assertions.assertEquals("https://management.azure.com/";,
+                
camelContext.getVaultConfiguration().hashicorp().getAzureResource());
     }
 }

Reply via email to