Adding username as parameter for the redis authentication#65
Adding username as parameter for the redis authentication#65kerkmann wants to merge 1 commit intoboj:masterfrom
Conversation
| if username != "" { | ||
| if _, err := c.Do("AUTH", password); err != nil { | ||
| c.Close() | ||
| return nil, err | ||
| } | ||
| } else { | ||
| if _, err := c.Do("AUTH", username, password); err != nil { | ||
| c.Close() | ||
| return nil, err | ||
| } |
There was a problem hiding this comment.
You switched the call in the condition:
- empty
usernamecalls the command using theusernamevariable - a non-empty
usernamecalls the command without using theusernamevariable
There was a problem hiding this comment.
Yes, sorry for the mistaken.
I don't think this PR will be accepted by the author.
The repo is inactive for such a long time.
There was a problem hiding this comment.
Besides, I suggest that using tcp link url to include username and database index is the trick to pass through this dilemma if your library is dependent on redistore.
There was a problem hiding this comment.
Yes, sorry for the mistaken.
I don't think this PR will be accepted by the author.
The repo is inactive for such a long time.
Yes, I am of the same opinion. Perhaps an authentik should use a different library than this one if we want to implement modern Redis features.
- Add import for `strconv` - Remove the `dial` function and its associated comments - Update `NewRediStore` to include `username` parameter - Replace `dial` with `dialClient` in `NewRediStore` - Remove `dialWithDB` function - Add `dialClient` function with username and database handling - Update `NewRediStoreWithDB` to include `username` parameter - Replace `dialWithDB` with `dialClient` in `NewRediStoreWithDB` - Update tests to include `username` parameter in `NewRediStore` and `NewRediStoreWithDB` calls fix #65 Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* refactor: refactor RediStore to support username parameter - Add import for `strconv` - Remove the `dial` function and its associated comments - Update `NewRediStore` to include `username` parameter - Replace `dial` with `dialClient` in `NewRediStore` - Remove `dialWithDB` function - Add `dialClient` function with username and database handling - Update `NewRediStoreWithDB` to include `username` parameter - Replace `dialWithDB` with `dialClient` in `NewRediStoreWithDB` - Update tests to include `username` parameter in `NewRediStore` and `NewRediStoreWithDB` calls fix #65 Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * docs: clarify and update comments for authentication and Redis connection - Update authentication comments to include username and password - Clarify that keyPairs are used for cookie encryption only - Add username parameter to Redis connection details in comments - Simplify and clarify comments on Redis connection parameters and return values Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Intention
I am using Authentik which is using your library. There is an open ticket for settings the Redis username. Sadly the username is not set in this library. Without fixing that issuer here, it's impossible to fix it in Authentik. ^^"
Changes
Adding the username as optional parameter.
I hope the PR is looking good, I am not a go developer. Please let me know if something is wrong/missing.