-
Notifications
You must be signed in to change notification settings - Fork 985
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
ACL SETUSER
not retaining argument order
#1847
Comments
Thanks for bringing this up. I wasn't aware that Redis considers the order of ACL items. Right now, We could do this also for all the other arguments passed to |
Thank you for the suggestion! I have attempted a fix in #1848 - please take a look and let me know your thoughts. |
ACL SETUSER
not setting as expectedACL SETUSER
not retaining argument order
Bug Report
Current Behavior
Currently, when calling ACL SETUSER, the order that the commands are built are unexpected.
If I want to issue the redis command
acl setuser default on -@connection +hello
then I would use the lettuce code for the
setuser
args:However, this ends up building this redis command:
ACL SETUSER DEFAULT ON +HELLO -@CONNECTION
This is not the correct behavior as redis will interpret this to mean that
hello
is not an allowed command (sincehello
is part of theconnection
category).Here is an example from redis-cli:
As you can see the behavior is different based on the ordering of the arguments.
Input Code
Details above.
Expected behavior/code
I expect that the order I build the arguments using
AclSetuserArgs
should be preserved when building the command that is sent to redis.Environment
Possible Solution
Within
AclSetuserArgs.Builder
we could build the string command as we go using aStringBuilder
? Then theargs.build()
method would just calltoString()
on theStringBuilder
.Additional context
Just as an FYI this is different from #1846 (a bug fix that I opened today related to setting the
nocommands
option onSETUSER
.The text was updated successfully, but these errors were encountered: