ximtech / jasypt-encrypt-plugin

Application properties encryption/decryption gradle plugin
MIT License
4 stars 1 forks source link

Runtime decryption not working #1

Closed perfectime94 closed 1 year ago

perfectime94 commented 1 year ago

Hello, im using latest version of plugin with springboot 3.0.4 and jdk 19, when i run decryptProperties or encryptProperties task with environment variable JASYPT_ENCRYPTOR_PASSWORD they work flawlessly but when i run the app with bootRun having the same environment variable the properties aren't decrypted at runtime, im using CommandLineRunner to print the property

this is the sample project im using to test it encrypt.zip

ximtech commented 1 year ago

Hi. For decrypting parameters in runtime you need additional library for spring boot application: link image Then all should work fine. As we can see in the console that encryptor has been initialized correctly. image PS: Make sure that same encryption key is used in encryptProperties/decryptProperties gradle task (in intellij it can be fetched from old .run configuration) Debug password with log message: println "Password: " + System.getenv('JASYPT_ENCRYPTOR_PASSWORD')

perfectime94 commented 1 year ago

thanks a lot, i added the starter and its working on runtime.

Again thanks for ur work on this plugin