You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this stage, you'll add support for responding to the `ACL GETUSER` command with the passwords property.
1
+
In this stage, you'll add support for responding to the `ACL GETUSER` command with the `passwords` property.
2
2
3
3
### The `passwords` property
4
4
5
-
A user in the Redis ACL system can have zero or more passwords associated with them. The `ACL GETUSER` command also returns the `passwords` property of the specified user.
5
+
The `passwords` property lists all hash-encoded passwords associated with the user. The `default` user does not have any associated passwords unless explicitly configured:
6
6
7
-
Example usage:
8
7
```bash
9
8
> ACL GETUSER default
10
9
1) "flags"
@@ -13,7 +12,10 @@ Example usage:
13
12
4) (empty array)
14
13
```
15
14
16
-
The fourth element of the response is the passwords array. The default user does not have any associated passwords unless explicitly configured. This is why the passwords array is empty for the default user.
15
+
Your `ACL GETUSER` response must now include the `passwords` property and its value:
16
+
17
+
- The string `passwords`, encoded as a bulk string.
18
+
- A RESP array containing the list of passwords. Since the `default` user has none, you must hardcode this to an empty array.
17
19
18
20
### Tests
19
21
@@ -23,7 +25,7 @@ The tester will execute your program like this:
23
25
$ ./your_program.sh
24
26
```
25
27
26
-
It will then send an `ACL GETUSER` command specifying the `default` user.
28
+
It will then send an `ACL GETUSER` command specifying the `default` user:
27
29
28
30
```bash
29
31
$ redis-cli
@@ -35,9 +37,9 @@ $ redis-cli
35
37
4) (empty array)
36
38
```
37
39
38
-
The tester will validate the following for the response:
40
+
The tester will validate that the response is a RESP array with four elements:
39
41
40
42
1. The first element of the array is the string `flags`, encoded as a RESP bulk string.
41
43
2. The second element of the array is a RESP array and contains the `nopass` flag.
42
-
3. The third element of the array is the string `passwords`, encoded as a RESP bulk string.
43
-
4. The fourth element of the array is an empty array because no passwords have been specified for the default user.
44
+
3. The third element of the array is the string `passwords`, encoded as a bulk string.
45
+
4. The fourth element of the array is an empty array.
0 commit comments