${NAME:default}
are resolved at the Environment
level
@ulisesbocchio
hey, sorry for kinda late reply. I tried to use EncryptableEnvironment, and it seemed like the original case worked, but now there's another problem:
user: user
password: ${PASSWORD:ENC(asdf)}
endpoint: https://${user}:${password}@localhost:30000
Trying to resolve turns into:
user: user
password: ENC(asdf)
endpoint: https://user:ENC(asdf)@localhost:30000
This makes sense since resolve happens before decrypt. But seems like this is a bug because the EncryptableEnvironment, when it follows the ${...} resolution, it should also be trying to decrypt if it can. Thoughts?
propVal = placeholderResolver.resolvePlaceholder(propVal);
for now you should probably stick to:
user: user
defaultPassword: ENC(asdf)
password: ${PASSWORD:${defaultPassword}}
endpoint: https://${user}:${password}@localhost:30000
which adds one more level of indirection but the works because defaultPassword
is a top level property
-Djasypt.encryptor.password=password
should be enough in any JVM. Keep in mind though that spring boot has to run.