ACL GETUSER
ACL GETUSER username
- Group
- ACL
- Complexity
- O(N) where N is the number of rules of the user
- Arity
- 3 (exactly, counting the command name)
- HotKV Cloud
- All plans
- On-Premise
- no license needed
ACL GETUSER describes one user. It is the structured counterpart of the
user’s line in ACL LIST, and is handy for checking
what a series of ACL SETUSER calls produced.
Return value
Section titled “Return value”Nil (RESP2) or null (RESP3) when the user does not exist. Otherwise a map in RESP3, or a flat array of field and value pairs in RESP2, with these fields:
| Field | Value |
|---|---|
flags |
Set (array in RESP2): on or off, nopass when set, and sanitize-payload or skip-sanitize-payload |
passwords |
Array of the SHA-256 hashes of the user’s passwords, in hex |
commands |
Bulk string: the command rules, starting with +@all or -@all |
keys |
Bulk string: the key patterns (~pattern, %R~pattern, %W~pattern), ~* for all keys |
channels |
Bulk string: the channel patterns (&pattern), &* for all channels |
selectors |
Array of maps (flat arrays in RESP2), one per selector, each with commands, keys and channels |
Passwords themselves are never shown, only their hashes.
Examples
Section titled “Examples”127.0.0.1:6379> ACL SETUSER alice on >s3cret ~app:* %R~shared:* &news:* -@all +@read +setOK127.0.0.1:6379> ACL GETUSER alice 1) "flags" 2) 1) "on" 2) "sanitize-payload" 3) "passwords" 4) 1) "1ec1c26b50d5d3c58d9583181af8076655fe00756bf7285940ba3670f99fcba0" 5) "commands" 6) "-@all +@read +set" 7) "keys" 8) "~app:* %R~shared:*" 9) "channels"10) "&news:*"11) "selectors"12) (empty array)127.0.0.1:6379> ACL GETUSER nosuchuser(nil)Compatibility
Section titled “Compatibility”Same fields and order as Redis 7 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.