spring-cloud-config icon indicating copy to clipboard operation
spring-cloud-config copied to clipboard

composite vault setup with different namespace

Open himnay opened this issue 1 year ago • 2 comments

1Describe the bug I am trying to access the HTTP header property X-Vault-namespace from my clienthttprequestinterceptor but since this field is added after the vaultclient createnamespace is executed. how can I force to execute my custom clienthttprequestinterceptor to get execute at the last Sample spring: cloud: config: server: composite: - type: vault namespace: /xyz/abc // other properties related to the vault - type: vault namespace: /alpha/beta // other properties related to the vault

himnay avatar Dec 02 '24 18:12 himnay

Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.

ryanjbaxter avatar Dec 04 '24 15:12 ryanjbaxter

You might want to try creating a Bean of type VaultRestTemplateFactory https://github.com/spring-cloud/spring-cloud-config/blob/0c5e4f57cbfadb32ead8a91adbd4ae705e9c6e1f/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/VaultEnvironmentRepositoryFactory.java#L77

ryanjbaxter avatar Dec 04 '24 16:12 ryanjbaxter