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

Loading order has changed since spring cloud 3.0.0 #570

Closed fkohantorabi closed 3 years ago

fkohantorabi commented 3 years ago

Hello,

It seems the loading order of the secrets has changed since the release of 3.0.0. In pre 3.0.0 world, application specific secrets would override the default secrets under application. For example, in the following structure

/secret/dev/my-app
    my.secret=application specific
/secret/dev/application
   my.secret=default 

my.secret would resolve to application specific if application name was my-app and it would resolve to default for any other application but with 3.0.0 release my.secret resolves to default for my-app application.

I have put a small application that demonstrate this at https://github.com/fkohantorabi/VaultOrderBugReport300.

This behaviour shows itself when secrets are imported by spring.config.import=optional:vault://. There is an easy workaround for this by setting spring.config.import=optional:vault://secret/dev/application,optional:vault://secret/dev/my-app.

mp911de commented 3 years ago

Thanks for report. That's a duplicate of #568.