Skip to content

Commit

Permalink
Make Jasypt beans conditional so that can be overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
Croway committed May 6, 2024
1 parent 52be4e2 commit 37e55a6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
public class JasyptEncryptedPropertiesAutoconfiguration {

@Bean
@ConditionalOnMissingBean(JasyptEncryptedPropertiesConfiguration.class)
public JasyptEncryptedPropertiesConfiguration JasyptEncryptedPropertiesAutoconfiguration(
final ConfigurableEnvironment environment) {
JasyptEncryptedPropertiesConfiguration config = new JasyptEncryptedPropertiesConfiguration();
Expand Down Expand Up @@ -98,6 +99,7 @@ public StringEncryptor stringEncryptor(EnvironmentStringPBEConfig environmentVar
}

@Bean
@ConditionalOnMissingBean(EncryptablePropertySourcesPlaceholderConfigurer.class)
public EncryptablePropertySourcesPlaceholderConfigurer propertyConfigurer(StringEncryptor stringEncryptor) {
return new EncryptablePropertySourcesPlaceholderConfigurer(stringEncryptor);
}
Expand All @@ -107,6 +109,7 @@ public EncryptablePropertySourcesPlaceholderConfigurer propertyConfigurer(String
* properties inside the camel context.
*/
@Bean
@ConditionalOnMissingBean(PropertiesParser.class)
public PropertiesParser encryptedPropertiesParser(PropertyResolver propertyResolver,
StringEncryptor stringEncryptor) {
return new JasyptSpringEncryptedPropertiesParser(propertyResolver, stringEncryptor);
Expand Down

0 comments on commit 37e55a6

Please sign in to comment.