Skip to content

Commit 340b542

Browse files
authored
Merge pull request #459 from codecrafters-io/TropicolX-patch-84
Revise "The nopass flag #ql6"
2 parents c886fc2 + 09eb371 commit 340b542

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

stage_descriptions/auth-03-ql6.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,24 @@ In this stage, you'll add support for responding to the `ACL GETUSER` command wi
22

33
### The `nopass` flag
44

5-
The `nopass` flag is one of the user flags in Redis.
5+
The `nopass` flag is one of the user flags in Redis. It controls the password authentication behaviour:
66

7-
- If the `nopass` flag is set for a user, the authentication succeeds with an arbitrary password for the user.
8-
- Setting the `nopass` flag clears the associated passwords for the given user.
9-
- The default user has the `nopass` flag set. Due to this, new connections are automatically authenticated as the `default` user. (This behavior can be changed, and we'll get to this in the later stages.)
7+
- If `nopass` is set for a user, authentication succeeds with any password (or no password)
8+
- Setting `nopass` clears any passwords associated with the user
109

11-
Example usage:
10+
The `default` user has `nopass` set by default, which is why new connections are automatically authenticated.
11+
12+
For example:
1213
```bash
1314
> ACL GETUSER default
1415
1) "flags"
1516
2) 1) "nopass"
17+
...
1618
```
1719

18-
The flags are encoded as a RESP array of bulk strings. Each flag is a bulk string (e.g., `nopass`). We'll get to enforcing the behavior of the `nopass` flag in later stages.
20+
The flags are encoded as a RESP array of bulk strings.
1921

20-
In this stage, you only need to respond to the `ACL GETUSER` command with the `nopass` flag set.
22+
For this stage, you only need to respond to the `ACL GETUSER` command with the `nopass` flag set. We'll get to enforcing the behavior of the `nopass` flag in later stages.
2123

2224
### Tests
2325

@@ -27,7 +29,7 @@ The tester will execute your program like this:
2729
$ ./your_program.sh
2830
```
2931

30-
It'll then send an `ACL GETUSER` command specifying the `default` user.
32+
It will then send an `ACL GETUSER` command specifying the `default` user.
3133

3234
```bash
3335
# Expect RESP array: ["flags", ["nopass"]]
@@ -37,7 +39,6 @@ $ redis-cli
3739
2) 1) "nopass"
3840
```
3941

40-
The tester will validate the following for the response:
41-
42-
1. The first element of the array is the string `flags`, encoded as a RESP bulk string.
43-
2. The second element of the array is a RESP array, and contains the `nopass` flag.
42+
The tester will verify that the response is a RESP array with two elements:
43+
1. The first element is the bulk string `flags`.
44+
2. The second element is a RESP array containing one element: the bulk string `nopass`.

0 commit comments

Comments
 (0)