spring-cloud-config: CipherEnvironmentEncryptor doesn't work with complex types on Spring Boot 1.4
Given a config like this:
mine[0].someValue=Foo
mine[0].someKey={cipher}XXXX
mine[1].someValue=Bar
mine[1].someKey={cipher}XXXX
Only the ciphered values get bound to the @ConfigurationProperties. I think that the root cause is the way that CipherEnvironmentEncryptor creates new property sources combined with Spring Boot issue 4313 which is much stricter in the way that it merges properties from different sources.
If I’m reading the code correctly ciphered values are extracted to a new property source that’s added above the original source. If CipherEnvironmentEncryptor could create a new source that includes all the old values I believe the problem would go away.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 20 (13 by maintainers)
@spencergibb @ryanjbaxter @dsyer @philwebb We finally verified the patch from #130 … Worked beautifully! Thank you guys!
There’s not an easy way to fix this in Boot without causing regressions. If EnvironmentDecryptApplicationInitializer could be changed to add both the decrypted values, and any original values as well (i.e. so there’s not a split across sources) then I think things will work again.