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 WHOAMI` command.
2
2
3
-
### The `ACL WHOAMI`command
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
-
Example usage:
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 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,22 +23,16 @@ The tester will execute your program like this:
23
23
$ ./your_program.sh
24
24
```
25
25
26
-
It'll 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
-
The tester will validate that the response is the string `default`, which is RESP encoded as:
36
-
37
-
```
38
-
$7\r\n
39
-
default\r\n
40
-
```
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).
41
35
42
36
### Notes
43
37
44
-
- In this stage, you can hardcode the response of the `ACL WHOAMI` command to be `default`. We'll get to enforcing authentication in the later stages.
38
+
- In this stage, you can hardcode the response of the `ACL WHOAMI` command to be `default`. We'll get to enforcing authentication in the later stages.
0 commit comments