File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
main/java/org/springframework/vault/authentication
test/java/org/springframework/vault/authentication Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 2020import software .amazon .awssdk .auth .credentials .AwsCredentials ;
2121import software .amazon .awssdk .auth .credentials .AwsCredentialsProvider ;
2222import software .amazon .awssdk .auth .credentials .StaticCredentialsProvider ;
23+ import software .amazon .awssdk .regions .Region ;
2324import software .amazon .awssdk .regions .providers .AwsRegionProvider ;
2425import software .amazon .awssdk .regions .providers .DefaultAwsRegionProviderChain ;
2526
@@ -212,6 +213,19 @@ public AwsIamAuthenticationOptionsBuilder credentialsProvider(AwsCredentialsProv
212213 return this ;
213214 }
214215
216+ /**
217+ * Configure a {@link Region}, used for computing the signature.
218+ * @param region must not be {@literal null}.
219+ * @return {@code this} {@link AwsIamAuthenticationOptionsBuilder}.
220+ * @since 3.0.2
221+ */
222+ public AwsIamAuthenticationOptionsBuilder region (Region region ) {
223+
224+ Assert .notNull (region , "Region must not be null" );
225+
226+ return regionProvider (() -> region );
227+ }
228+
215229 /**
216230 * Configure an {@link AwsRegionProvider}, required to calculate the region to be
217231 * used for computing the signature.
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ void shouldUsingAuthenticationSteps() {
8989 + "}" ));
9090
9191 AwsIamAuthenticationOptions options = AwsIamAuthenticationOptions .builder ().role ("foo-role" )
92- .regionProvider (() -> Region .US_WEST_1 ).credentials (AwsBasicCredentials .create ("foo" , "bar" )).build ();
92+ .region ( Region .US_WEST_1 ).credentials (AwsBasicCredentials .create ("foo" , "bar" )).build ();
9393
9494 AuthenticationSteps steps = AwsIamAuthentication .createAuthenticationSteps (options );
9595 AuthenticationStepsExecutor executor = new AuthenticationStepsExecutor (steps , this .restTemplate );
You can’t perform that action at this time.
0 commit comments