-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix symmetric encryption #760
Conversation
public class SymmetricKeyEncryptor { | ||
|
||
@Autowired | ||
private TextEncryptor encryptor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class name SymmetricKeyEncryptor
implies it is something to do with symmetric keys, but the @Autowired
will succeed for any TextEncryptor
. I'm kind of worried that this is duplicating a code path in spring-cloud-commons somewhere.
…t work since Dalston SR2. Fixed by creating a default `TextEncryptorLocator` when the '`encrypt.key` is set
63531b2
to
c713f43
Compare
Codecov Report
@@ Coverage Diff @@
## 1.3.x #760 +/- ##
==========================================
+ Coverage 75.59% 75.68% +0.09%
==========================================
Files 81 82 +1
Lines 2651 2653 +2
Branches 379 379
==========================================
+ Hits 2004 2008 +4
+ Misses 486 484 -2
Partials 161 161
Continue to review full report at Codecov.
|
…d make the autowired encryptor non mandatory
I see why this is needed now. But for consistency can we put the new config class in |
@dsyer I originally had it in Using a Qualifier could be an option but felt that might preclude how other clients might be providing a |
Yeah, we'd need to add another condition to prevent the cycle. We need it anyway because if the user provides both |
should having both |
Yes, I guess it would make sense to fail in a helpful way (rather than just a no-unique bean exception). That's a nice to have. |
I took your test and organized the config files a bit differently in fe42a1d. Thanks. Might be worth testing with your concrete use cases. |
Setting property
encrypt.key
to enable symmetric encryption does not work since Dalston SR2. This can be verified using the endpoint/encrypt/status
Fixed by creating a defaultTextEncryptorLocator
when the 'encrypt.key
is set