Skip to content

Commit 4cb0cc9

Browse files
authored
Clarify ACL WHOAMI command details
Updated the explanation of the ACL WHOAMI command, clarifying default authentication behavior and response expectations.
1 parent 516e4ff commit 4cb0cc9

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

stage_descriptions/auth-01-jn4.md

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ In this stage, you'll add support for responding to the `ACL WHOAMI` command.
22

33
### The `ACL WHOAMI` Command
44

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.
66

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:
108

119
```bash
1210
> ACL WHOAMI
1311
"default"
1412
```
1513

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.
1717

1818
### Tests
1919

@@ -23,26 +23,15 @@ The tester will execute your program like this:
2323
$ ./your_program.sh
2424
```
2525

26-
It will then send an `ACL WHOAMI` command.
26+
It will then send an `ACL WHOAMI` command:
2727

2828
```bash
2929
# Expect RESP bulk string: "default"
30-
$ redis-cli
31-
> ACL WHOAMI
30+
$ redis-cli ACL WHOAMI
3231
"default"
3332
```
3433

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).
4635

4736
### Notes
4837

0 commit comments

Comments
 (0)