spring-cloud / spring-cloud-vault

Configuration Integration with HashiCorp Vault
http://cloud.spring.io/spring-cloud-vault/
Apache License 2.0
274 stars 152 forks source link

Support for multiple vault paths #569

Closed qqwoadc closed 3 years ago

qqwoadc commented 3 years ago

hi, i need to load properties from multiple vault paths, such as '/secret/mysql/test01/hades' and '/secret/redis/test01/hades',

I've notived that it was supported before in https://github.com/spring-cloud/spring-cloud-vault/pull/80,

just like

spring.cloud.vault.application-name=mysql/test01/hades,redis/test01/hades

image

but now it seems that this method is useless and in RELEASE2.2.0 the code disappeared.

thus how can i load properties from multiple vault paths, can you please give me an example?

I appreciate very much!

mp911de commented 3 years ago

With upgrading to Spring Boot 2.4/Spring Cloud 3.0, you should be able to achieve the same via spring.config.import=vault://mysql/test01/hades,vault://redis/test01/hades.

qqwoadc commented 3 years ago

thank you very much!
But in my company there are quite a lot of projects need to use vault , it cost a lot to upgrade all of them since some is even using springboot 1.*
Besides we use spring-cloud-starter-alibaba-nacos-config to store some configuration , which cant support springboot 2.4 yet. So I would like to venture to ask are there any other solutions? Thank you for your time

qqwoadc commented 3 years ago

@mp911de

mp911de commented 3 years ago

You can always add a VaultConfigurer bean to programmatically register additional context paths as property sources.

qqwoadc commented 3 years ago

OK, i understand ,Thank you