Version
Spring cloud config server 4.0.2
Explanation
in this commit b2508eb97c6aac0284896d83edd50c38c83d1e87
encrypt and decrypt controller
https://github.com/spring-cloud/spring-cloud-config/commit/b2508eb97c6aac0284896d83edd50c38c83d1e87#diff-f18a83930fb437413479ed50adc18dedbf115b37e560d8481185a796c24444d8R107-L131
https://github.com/spring-cloud/spring-cloud-config/commit/b2508eb97c6aac0284896d83edd50c38c83d1e87#diff-f18a83930fb437413479ed50adc18dedbf115b37e560d8481185a796c24444d8R127-L150
stop to propagate data variable to EnvironmentPrefixHelper.getEncryptorKeys()
Sample with custom TextEncryptorLocator
@Configuration(proxyBeanMethods = false)
public class Encryption {
private final DefaultTextEncryptionAutoConfiguration defaultTextEncryptionAutoConfiguration;
public Encryption() {
defaultTextEncryptionAutoConfiguration = new DefaultTextEncryptionAutoConfiguration();
}
@Bean
public TextEncryptorLocator textEncryptorLocator(MultiKeyProperties multiKeyProperties) {
return keys -> {
KeyProperties keyPropertiesForClient = multiKeyProperties.encrypt().get(keys.get("application"));
return defaultTextEncryptionAutoConfiguration.defaultTextEncryptor(keyPropertiesForClient);
};
}
}
$ curl -s localhost:8090/encrypt --data-urlencode '{"key":"one","secret":"value"}Hello world 2'
the keys map contained nothing except name and profiles entry