-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add ability to reset password in JedisFactory for JedisPool and JedisSentinelPool #2314
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
Conversation
} | ||
|
||
public void setPassword(final String user, final String password) throws IllegalArgumentException { | ||
if (!java.util.Objects.equals(this.user, user)) { |
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.
@sazzad16 why do we force same user?
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.
@gkorland In redis-cli on Redis ACL, after doing AUTH user pass
once, if we want to AUTH
again, we have to do AUTH user newpass
not just AUTH newpass
. I tried to imitate that here.
I also thought, this would help to us to avoid any mistaken password change as a wrong password (but a valid one for other user) would break the whole pool.
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.
Please add a JavaDoc explaining it
this.factory = factory; | ||
|
||
HostAndPort master = initSentinels(sentinels, masterName); | ||
initPool(poolConfig, factory); |
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.
@sazzad16 perhaps I get it wrong, but do you need to call initPool twice?
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.
@gkorland initPool(poolConfig, factory);
was usually get called within initPool(master);
(Line 219). But as we are doing this.factory = factory;
(Line 192) now, the if (factory == null)
check (Line 216) would not let initPool(poolConfig, factory);
to happen at usual place. So we're doing it here.
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.
Please at least leave a comment in the code explaining this double call.
076440a
to
1de4e0f
Compare
Original author: @yapei123 (#1606)
Closes #1602
Closes #1606
Closes #533
Closes #2245