-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add support for ACL authentication #80
base: master
Are you sure you want to change the base?
Conversation
This is fantastic, thank you @ilyaBykonya for submitting it! 🙇 Overall it looks really good, but we do require that a test be added for newly-added or changed functionality, which this PR definitely qualifies for. Fortunately the GitHub Actions CI pipeline is using redis version 7.2.4 so it will be fully testable within the CI pipeline setup here. I've just removed the Actions restriction so you will be able to run further pipelines without my approval, so you can be sure your tests succeed in the CI pipeline by just pushing the changes here (or to a separate branch if you prefer) and letting the pipeline run. Please get in touch with any questions, I'm more than happy to help guide you in any way I can! Thank you again, I really appreciate the contribution! |
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.
Needs added test(s)
* @param password The password with which to authenticate. | ||
* @returns RedisReturnValue detailing the result | ||
*/ | ||
RedisReturnValue authenticate(const char *password); | ||
/** | ||
* Authenticate with the given password. |
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.
* Authenticate with the given password. | |
* Authenticate with the given password and client. |
@@ -107,11 +107,18 @@ class Redis | |||
Redis &operator=(const Redis &&) = delete; | |||
|
|||
/** | |||
* Authenticate with the given password. | |||
* Authenticate with the given password and client. |
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.
* Authenticate with the given password and client. | |
* Authenticate with the given password. |
Redis 6.2 introduced the function of user ACL lists, which limit access and increase the level of system security: https://redis.io/docs/management/security/acl/
The changes in the fork were aimed only at adding support for this functionality.
In the first commit, an overload of the authenticate method was added to work with the new ACL, and the old method simply called: authenticate("default", password); which for new versions of Redis is identical to authenticate(password);
The second commit was caused by the fact that the old version, being the only (old) authentication method for requirepass, was no longer compatible with it. And I've added code duplication to maintain backward compatibility with Redis < 6.2