Provides a way to disable DecryptEnvironmentPostProcessor.

Fixes gh-927
This commit is contained in:
spencergibb
2021-03-15 21:33:41 -04:00
parent 4995ffc88a
commit cde355e5e5
3 changed files with 21 additions and 1 deletions

View File

@@ -98,6 +98,16 @@ public class EncryptionIntegrationTests {
then(context.getEnvironment().getProperty("foo.password")).isEqualTo("test");
}
@Test
public void decryptEnvironmentPostProcessorDisabled() {
ConfigurableApplicationContext context = new SpringApplicationBuilder(TestAutoConfiguration.class)
.web(WebApplicationType.NONE).properties("spring.config.use-legacy-processing=false", "encrypt.key:pie",
"spring.cloud.decrypt-environment-post-processor.enabled=false",
"foo.password:{cipher}bf29452295df354e6153c5b31b03ef23c70e55fba24299aa85c63438f1c43c95")
.run();
then(context.getEnvironment().getProperty("foo.password")).startsWith("{cipher}bf2945");
}
@Test
public void symmetricConfigurationProperties() {
ConfigurableApplicationContext context = new SpringApplicationBuilder(TestAutoConfiguration.class)