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

Spring Cloud Bootstrap not properly decrypting ENV

Open mdlck opened this issue 3 years ago • 0 comments

Describe the bug Spring Cloud Bootstrap is not properly decryping an environment variable if it is written with _ (as it should be) instead of . (not recommended). During runtime it then appears to be still encrypted and with the {cipher}-prefix.

For example: If i have an environment variable named CONFIGPROPS_VAR2ENCRYPTED and Autowire a related @ConfigurationProperties-Bean -> it's still encrypted :( If i have an environment variable named CONFIGPROPS.VAR3ENCRYPTED and Autowire a related @ConfigurationProperties-Bean -> it's decrypted :o

Sample I made a minimum sample project that shows this bug: https://github.com/mdlck/spring-cloud-bug Just start the JUnit-Test with the ENV-Variables from the README.md. From my point of view, it should not fail, but it does. :/

Spring Boot Version: 2.7.6 Spring Cloud Version: 2021.0.5

mdlck avatar Dec 07 '22 14:12 mdlck