Skip to content
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

Usage of StandardEncryptableEnvironment with additional active profile(s) and custom prefix and suffix breaks decryption #380

Open
little-fish opened this issue Jan 12, 2024 · 0 comments

Comments

@little-fish
Copy link

little-fish commented Jan 12, 2024

Hi there.
I need to propagate some properties from the Environment to the System level so I am listening for ApplicationEnvironmentPreparedEvent event. So the only way is to register StandardEncryptableEnvironment within the SpringApplicationBuilder.

I use custom prefix and suffix specified in application.properties:

jasypt.encryptor.property.prefix=ENC://
jasypt.encryptor.property.suffix=

If only I use default Spring profile, all the properties from the event's environment instance are being decrypted just fine. The moment I specify some profile(s) in the spring.profiles.active property, none of the properties obtained from the event's environment are being decrypted (neither from application.properties nor from application-profile.properties).

If I switch back to the default prefix and suffix:

jasypt.encryptor.property.prefix=ENC(
jasypt.encryptor.property.suffix=)

decryption starts to work even with additional active profile(s).

I am using Spring Boot v3.2.1 (it happens with 3.1.x as well) and jasypt-spring-boot v3.0.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant