I have a password ending in a colon, say abc:, that I want to store encrypted in GIT and decrypt with Spring Cloud Config.
Here's the expected YAML file :
spring:
datasource:
password: "abc:"
Here's the encrypted YAML file :
spring:
datasource:
password: "{cipher}blablabla"
And here's what I receive from Spring Cloud Config after decryption :
spring:
datasource:
password: abc:
Which is interpreted as a key instead of a value by the YAML parser.
Is there a way to tell Spring Cloud Config that I want to surround the decrypted value in quotes or something similar ?
EDIT
My mistake, Spring Could Config server actually adds quotes when needed after decrypting the string. So the result is as expected :
spring:
datasource:
password: 'abc:'
The issue is that when I reference this value using a placeholder the quotes disappear in the process :
a_key:
another_key: ${spring.datasource.password}
becomes when processed by Spring Could Config server :
a_key:
another_key: abc:
So the question really is : how to preserve quotes when referencing a value using placeholders in a YAML file with Spring Cloud Config?