Merge branch '2.2.x' of https://github.com/rosuvlad/spring-cloud-config into rosuvlad-2.2.x
This commit is contained in:
@@ -103,9 +103,7 @@ public class SpringVaultClientConfiguration extends AbstractVaultConfiguration
|
||||
endpointProvider, requestFactory);
|
||||
|
||||
if (vaultProperties.getNamespace() != null) {
|
||||
restTemplateBuilder.customizers(
|
||||
restTemplate -> restTemplate.getInterceptors().add(VaultClients
|
||||
.createNamespaceInterceptor(vaultProperties.getNamespace())));
|
||||
restTemplateBuilder.customizers(this::applyNamespaceInterceptor);
|
||||
}
|
||||
|
||||
return restTemplateBuilder;
|
||||
@@ -132,6 +130,13 @@ public class SpringVaultClientConfiguration extends AbstractVaultConfiguration
|
||||
return new SslConfiguration(keyStoreConfiguration, trustStoreConfiguration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestOperations restOperations() {
|
||||
RestTemplate restOperations = (RestTemplate) super.restOperations();
|
||||
applyNamespaceInterceptor(restOperations);
|
||||
return restOperations;
|
||||
}
|
||||
|
||||
private SslConfiguration.KeyStoreConfiguration getKeyStoreConfiguration(
|
||||
Resource resourceProperty, String passwordProperty) {
|
||||
|
||||
@@ -147,6 +152,15 @@ public class SpringVaultClientConfiguration extends AbstractVaultConfiguration
|
||||
return SslConfiguration.KeyStoreConfiguration.of(resourceProperty);
|
||||
}
|
||||
|
||||
private RestOperations applyNamespaceInterceptor(RestTemplate restTemplate) {
|
||||
if (vaultProperties.getNamespace() != null) {
|
||||
restTemplate.getInterceptors().add(VaultClients
|
||||
.createNamespaceInterceptor(vaultProperties.getNamespace()));
|
||||
}
|
||||
|
||||
return restTemplate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a new {@link ClientAuthentication}.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user