Skip to content

Commit 6b9dfc2

Browse files
authored
Merge pull request #460 from codecrafters-io/TropicolX-patch-85
Revise "The passwords property #pl7"
2 parents 340b542 + 78718d0 commit 6b9dfc2

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

stage_descriptions/auth-04-pl7.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
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.
22

3-
### The `passwords` property
3+
### The `passwords` Property
44

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 a user.
6+
7+
The `default` user does not have any associated passwords unless explicitly configured:
68

7-
Example usage:
89
```bash
910
> ACL GETUSER default
1011
1) "flags"
@@ -13,7 +14,10 @@ Example usage:
1314
4) (empty array)
1415
```
1516

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.
17+
Your `ACL GETUSER` response must now include the following:
18+
19+
1. The string `passwords`, encoded as a bulk string.
20+
2. A RESP array containing the list of passwords. Since the `default` user has none, you must hardcode this to be an empty array.
1721

1822
### Tests
1923

@@ -23,21 +27,20 @@ The tester will execute your program like this:
2327
$ ./your_program.sh
2428
```
2529

26-
It'll then send an `ACL GETUSER` command specifying the `default` user.
30+
It will then send an `ACL GETUSER` command specifying the `default` user:
2731

2832
```bash
29-
$ redis-cli
3033
# Expect RESP array: ["flags", ["nopass"], "passwords", []]
31-
> ACL GETUSER default
34+
$ redis-cli ACL GETUSER default
3235
1) "flags"
3336
2) 1) "nopass"
3437
3) "passwords"
3538
4) (empty array)
3639
```
3740

38-
The tester will validate the following for the response:
41+
The tester will validate that the response is a RESP array with four elements:
3942

4043
1. The first element of the array is the string `flags`, encoded as a RESP bulk string.
4144
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.
45+
3. The third element of the array is the string `passwords`, encoded as a bulk string.
46+
4. The fourth element of the array is an empty array.

0 commit comments

Comments
 (0)