New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@EnableEncryptableProperties not working with xml based definitions #58
Comments
Can you share the XML config? Or do you have an app in github that I can take a look at? |
Hi Ulises, here is the project: https://github.com/chupetoide/acme/tree/master |
Hey, I took a quick look, it looks like you don't need this: <context:property-placeholder
location="classpath:application-xml.properties"
file-encoding="UTF-8"
/> If for some reason some of your XML bean definitions don't get properties resolved, try just: <context:property-placeholder/> Without adding any locations to it.
For you it should be enough with the Environment since that is where <encryption:encryptable-property-placeholder
encryptor="jasyptStringEncryptor"
location="classpath:application-xml.properties"
file-encoding="UTF-8"
/> All in all, I think you should either choose to use |
Both properties are resolved but the XML-based are not decrypted. We should use Spring XML-based configuration to allow our customers to modify the configuration without re-packaging it. The
I added this namespaces and this property configuration: <encryption:string-encryptor id="myEncryptor" password="password" pool-size="5"/>
<encryption:encryptable-property-placeholder
encryptor="myEncryptor"
location="classpath:application-xml.properties"
file-encoding="UTF-8"
/> But don't worry. I'll write my own |
I have an application with Spring 4.3.5 with xml based configuration and I have some property sources definitions there.
I'd like to encrypt some property values so I added jasypt-spring-boot (1.15) to my pom.xml and I guess I am in the method 2 scenario (don't use @SpringBootApplication or @EnableAutoConfiguration Auto Configuration annotations). I created a new Java App configuration class with @EnableEncryptableProperties but it only works with @propertysource java annotations. It doesn't process the xml based definitions. Is that the expected behavior ?
I also tried this suggestion but it didn't work.
The text was updated successfully, but these errors were encountered: