-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
feature: add the delegating password encoder for apollo-portal simple auth #3804
feature: add the delegating password encoder for apollo-portal simple auth #3804
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3804 +/- ##
============================================
- Coverage 50.16% 49.92% -0.25%
+ Complexity 2446 2444 -2
============================================
Files 479 482 +3
Lines 14807 14853 +46
Branches 1503 1507 +4
============================================
- Hits 7428 7415 -13
- Misses 6858 6917 +59
Partials 521 521
Continue to review full report at Codecov.
|
This feature looks great! However, I have one concern that if we need to change the password from "xxx" to "{bcrypt}xxx", does that mean the user could not upgrade to this version smoothly? e.g.
So how about we leave the password in the original form and we let the new version of apollo-portal adapt them? Does the |
add an adapter for old password.
|
39d6482
to
586a630
Compare
.../java/com/ctrip/framework/apollo/portal/spi/springsecurity/ApolloPasswordEncoderFactory.java
Show resolved
Hide resolved
Is this step mandatory? What if we just leave the password as in the form of "xxx"? |
it do work at the moment of update apollo-portal to the new version. |
Right, this is a must and we should note it in the release note |
for better compatibility, we could split this pr into 2 parts.
do you think it is necessary to do that? |
I think it's not necessary to split this pr into 2 parts. It should be ok as long as the new version of apollo-portal could decode the password in both |
apollo-client/src/test/java/com/ctrip/framework/apollo/spring/JavaConfigAnnotationTest.java
Outdated
Show resolved
Hide resolved
...esources/sql/openapi/ConsumerServiceIntegrationTest.testFindAppIdsAuthorizedByConsumerId.sql
Outdated
Show resolved
Hide resolved
docs/zh/development/portal-how-to-implement-user-login-function.md
Outdated
Show resolved
Hide resolved
# Conflicts: # CHANGES.md
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.
LGTM
What's the purpose of this PR
the best algorithm for password storage should change some day in the future. the
DelegatingPasswordEncoder
can makes the algorithm upgrade seamless.Brief changelog
ApolloPortalDB
.Users
.Password
to 512BCryptPasswordEncoder
with theDelegatingPasswordEncoder
backend of theBCryptPasswordEncoder
PlaceholderPasswordEncoder
which return a random string as encoded password and never matches any encoded password.DelegatingPasswordEncoder
backend of thePlaceholderPasswordEncoder
Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean test
to make sure this pull request doesn't break anything.CHANGES
log.