Describe the bug
Using Vault, we group our microservice applications secrets under a common folder/path.
The property org.springframework.cloud.config.server.environment.VaultEnvironmentProperties.pathToKey
seems to cater for this but the pathToKey
property is ignored.
Code to support this functionality existed in org.springframework.cloud.config.server.environment.VaultEnvironmentRepository
but it appears to have not been implemented in org.springframework.cloud.config.server.environment.vault.SpringVaultEnvironmentRepository
Comment From: ryanjbaxter
@mp911de would this be as simple as doing something like this? https://github.com/spring-cloud/spring-cloud-config/blob/main/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/VaultKvAccessStrategyFactory.java#L92-L99
Comment From: mp911de
Yes, for kv2 it's a matter of prepending the data path with data/
. For kv1, it's just the plain path.
Comment From: gostevning
@ryanjbaxter I'm trying to use path-to-key for my application, but it seems to me like the resolved path is prefixed with two 'data' strings. In my case I have the spring.cloud.config.server.vault.path-to-key set to some/special/path, and GET request to vault for a given application/profile is generated as: "https://vault.example.com:443/v1/secret/data/data/some/special/path/my-dummy-app/dev"
To me it looks like the VaultKeyValue2Accessor.createDataPath (spring-vault-core) prepends 'data' as well.
Should I file a new issue on this?
Comment From: ryanjbaxter
Yes looks like you are right, can you please open a new issue?
Comment From: gostevning
@ryanjbaxter #2092