Skip to content

Commit a11769d

Browse files
committed
Polishing.
Remove superfluous dependencies. Fix Javadoc. Update documentation. Add missing import. See gh-761 Original pull request gh-765
1 parent 1e431c3 commit a11769d

File tree

5 files changed

+14
-26
lines changed

5 files changed

+14
-26
lines changed

pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,6 @@
234234
<version>${aws-java-sdk.version}</version>
235235
<optional>true</optional>
236236
</dependency>
237-
<dependency>
238-
<groupId>software.amazon.awssdk</groupId>
239-
<artifactId>sts</artifactId>
240-
<version>${aws-java-sdk.version}</version>
241-
<optional>true</optional>
242-
</dependency>
243237

244238
<!-- GCP SDK -->
245239
<dependency>

spring-vault-core/pom.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -189,21 +189,6 @@
189189
</exclusion>
190190
</exclusions>
191191
</dependency>
192-
<dependency>
193-
<groupId>software.amazon.awssdk</groupId>
194-
<artifactId>sts</artifactId>
195-
<optional>true</optional>
196-
<exclusions>
197-
<exclusion>
198-
<groupId>software.amazon.ion</groupId>
199-
<artifactId>ion-java</artifactId>
200-
</exclusion>
201-
<exclusion>
202-
<groupId>com.fasterxml.jackson.dataformat</groupId>
203-
<artifactId>jackson-dataformat-cbor</artifactId>
204-
</exclusion>
205-
</exclusions>
206-
</dependency>
207192

208193
<dependency>
209194
<groupId>com.google.apis</groupId>

spring-vault-core/src/main/java/org/springframework/vault/config/EnvironmentVaultConfiguration.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import org.apache.commons.logging.Log;
2525
import org.apache.commons.logging.LogFactory;
26+
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
2627

2728
import org.springframework.beans.BeansException;
2829
import org.springframework.context.ApplicationContext;
@@ -47,7 +48,6 @@
4748
import org.springframework.vault.support.SslConfiguration.KeyStoreConfiguration;
4849
import org.springframework.vault.support.VaultToken;
4950
import org.springframework.web.client.RestOperations;
50-
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
5151

5252
/**
5353
* Configuration using Spring's {@link org.springframework.core.env.Environment} to
@@ -98,8 +98,8 @@
9898
* </li>
9999
* <li>Authentication method: {@code vault.authentication} (defaults to {@literal TOKEN},
100100
* supported authentication methods are:
101-
* {@literal TOKEN, APPID, APPROLE, AWS_EC2, AZURE, CERT, CUBBYHOLE, KUBERNETES}, see
102-
* {@link AuthenticationMethod})</li>
101+
* {@literal TOKEN, APPID, APPROLE, AWS_EC2, AWS_IAM, AZURE, CERT, CUBBYHOLE, KUBERNETES},
102+
* see {@link AuthenticationMethod})</li>
103103
* <li>Token authentication
104104
* <ul>
105105
* <li>Vault Token: {@code vault.token}</li>
@@ -130,6 +130,10 @@
130130
* <li>Identity Document URL: {@code vault.aws-ec2.identity-document} (defaults to
131131
* {@link AwsEc2AuthenticationOptions#DEFAULT_PKCS7_IDENTITY_DOCUMENT_URI})</li>
132132
* </ul>
133+
* <li>AWS IAM authentication
134+
* <ul>
135+
* <li>Role: {@code vault.aws-iam.role} (since 3.0.2)</li>
136+
* </ul>
133137
* <li>Azure MSI authentication
134138
* <ul>
135139
* <li>Azure MSI path: {@code vault.azure-msi.azure-path} (since 2.2.1, defaults to
@@ -376,6 +380,7 @@ protected ClientAuthentication awsEc2Authentication() {
376380
}
377381

378382
protected ClientAuthentication awsIamAuthentication() {
383+
379384
String role = getProperty("vault.aws-iam.role");
380385
Assert.isTrue(StringUtils.hasText(role),
381386
"Vault AWS-IAM authentication: Role (vault.aws-iam.role) must not be empty");

spring-vault-core/src/test/java/org/springframework/vault/config/EnvironmentVaultConfigurationAwsIamAuthenticationUnitTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import org.springframework.vault.authentication.ClientAuthentication;
3030

3131
/**
32-
* Unit tests for {@link EnvironmentVaultConfiguration} with AppRole authentication.
32+
* Unit tests for {@link EnvironmentVaultConfiguration} with AWS IAM authentication.
3333
*
3434
* @author Nick Tan
3535
*/

src/main/asciidoc/reference/imperative-template.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ vault.token=00000000-0000-0000-0000-000000000000
178178
** Truststore type: `vault.ssl.trust-store-type` (optional, typically `jks`, supports also `pem`)
179179
** Enabled SSL/TLS protocols: `vault.ssl.enabled-protocols` (since 2.3.2, optional, protocols separated with comma)
180180
** Enabled SSL/TLS cipher suites: `vault.ssl.enabled-cipher-suites` (since 2.3.2, optional, cipher suites separated with comma)
181-
* Authentication method: `vault.authentication` (defaults to `TOKEN`, supported authentication methods are: `TOKEN`, `APPID`, `APPROLE`, `AWS_EC2`, `AZURE`, `CERT`, `CUBBYHOLE`, `KUBERNETES`)
181+
* Authentication method: `vault.authentication` (defaults to `TOKEN`, supported authentication methods are: `TOKEN`, `APPID`, `APPROLE`, `AWS_EC2`, `AWS_IAM`, `AZURE`, `CERT`, `CUBBYHOLE`, `KUBERNETES`)
182182

183183
**Authentication-specific property keys**
184184

@@ -206,6 +206,10 @@ Any other value is used with `StaticUserId`.
206206
* RoleId: `vault.aws-ec2.role-id` (*deprecated:* use `vault.aws-ec2.role` instead)
207207
* Identity Document URL: `vault.aws-ec2.identity-document` (defaults to `http://169.254.169.254/latest/dynamic/instance-identity/pkcs7`)
208208

209+
**<<vault.authentication.awsiam>>**
210+
211+
* Role: `vault.aws-iam.role`
212+
209213
**<<vault.authentication.azuremsi>>**
210214

211215
* Azure MSI path: `vault.azure-msi.azure-path` (defaults to `azure`)

0 commit comments

Comments
 (0)