Handle enabling/changing redis password without application restart
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 17.6k
- Forks
- 2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 40
Description
It seems to be not possible to enable or change redis password without application restart.
Even in case when I want to enable password and I supply password to the driver (it logs warning that the password is not required), when the password is enabled in redis, the driver returns error "not authenticated"; it doesn't try to authenticate using password that was passed in config.
For changing password there is no option. It would not be required if redis supported user accounts - you'd be able to simply create another account, switch application to use it and then remove the old account. Redis doesn't and apparently will not have accounts.
Of course the issue can be resolved by creating a wrapper around redis driver that would create a new client when authentication fails, but it seems as either too much of a change in applications or too much of an effort to make the wrapper that behaves exactly as the driver...
Maybe there is a simpler solution to this problem, like subscribing to some event, authenticating and replaying the last command when authentication fails? Please let me know if there is.
Otherwise it would be nice to have these two features inside driver:
- Handle enabling password:
- If the password is passed
- and it was not required by redis
- and at some later time some command was rejected as not authenticated
- driver will try authenticating again using the passed password
- if authentication is successful, it will resend command
- if authentication failed it would return error
- Support feature of password change using new_password option (or something like this). In this case when authentication fails, the driver will try authenticating using the new password and if it was successful the driver will use it afterwards in case of re-connects.
If you are OK with these features I could implement.
Please let me know.
Thank you.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the driver's authentication, command-retry, and reconnect handling; the issue does not name specific files or tests. Compare the proposed behavior for enabling a password with the new_password rotation flow, then define how failed authentication, command replay, and future reconnects should behave before implementing or testing it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, redis, typescript
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100