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
Copy file name to clipboardExpand all lines: stage_descriptions/auth-01-jn4.md
+8-19Lines changed: 8 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,18 @@ In this stage, you'll add support for responding to the `ACL WHOAMI` command.
2
2
3
3
### The `ACL WHOAMI` Command
4
4
5
-
The [`ACL WHOAMI`](https://redis.io/docs/latest/commands/acl-whoami/) command is used to return the username the current connection is authenticated with.
5
+
The [`ACL WHOAMI`](https://redis.io/docs/latest/commands/acl-whoami/) command returns the username associated with the current connection.
6
6
7
-
In Redis, every new connection is automatically authenticated using the `default` user. This feature can be turned off, making every new connection unauthenticated at first. We'll get to that in the later stages.
8
-
9
-
For example
7
+
By default, every new connection in Redis is automatically authenticated as the `default` user. For example:
10
8
11
9
```bash
12
10
> ACL WHOAMI
13
11
"default"
14
12
```
15
13
16
-
It returns the username of the currently authenticated user, encoded as a [RESP bulk string](https://redis.io/docs/latest/develop/reference/protocol-spec/#bulk-strings).
14
+
The command returns the username of the currently authenticated user, encoded as a [RESP bulk string](https://redis.io/docs/latest/develop/reference/protocol-spec/#bulk-strings).
15
+
16
+
This default authentication behavior can be changed so that new connections start out unauthenticated. We'll cover that in later stages.
17
17
18
18
### Tests
19
19
@@ -23,26 +23,15 @@ The tester will execute your program like this:
23
23
$ ./your_program.sh
24
24
```
25
25
26
-
It will then send an `ACL WHOAMI` command.
26
+
It will then send an `ACL WHOAMI` command:
27
27
28
28
```bash
29
29
# Expect RESP bulk string: "default"
30
-
$ redis-cli
31
-
> ACL WHOAMI
30
+
$ redis-cli ACL WHOAMI
32
31
"default"
33
32
```
34
33
35
-
Your server should respond with the bulk string `default`:
36
-
37
-
```
38
-
$7\r\n
39
-
default\r\n
40
-
```
41
-
42
-
The tester will verify that:
43
-
- Your server responds to the `ACL WHOAMI` command
44
-
- The response is the string `"default"` encoded as a RESP bulk string
45
-
- The RESP encoding is correct (length prefix `$7\r\n` followed by `default\r\n`)
34
+
The tester will expect to receive `$7\r\ndefault\r\n` as a response. That's the string `default` encoded as a [bulk string](https://redis.io/docs/latest/develop/reference/protocol-spec/#bulk-strings).
0 commit comments