Skip to content

Commit 68e2692

Browse files
authored
Merge pull request #464 from codecrafters-io/TropicolX-patch-89
Revise "Authenticate using AUTH #ws7"
2 parents 01de8c2 + d981a13 commit 68e2692

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

stage_descriptions/auth-08-ws7.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
In this stage, you'll implement enforcing authentication using the `AUTH` command.
22

3-
### Enforcing authentication using `AUTH`
3+
### Enforcing Authentication using `AUTH`
44

5-
After the `AUTH` command returns success, the connection is authenticated as the specified user. For example,
5+
After the `AUTH` command succeeds, the connection becomes authenticated as the specified user. Once authenticated, the connection can execute commands that previously returned `NOAUTH` errors:
6+
7+
For example:
68

79
```bash
810
# Client 1
@@ -18,14 +20,16 @@ $ redis-cli
1820
> ACL WHOAMI
1921
(error) NOAUTH Authentication required.
2022

21-
> AUTH default mypassword
23+
> AUTH default newpassword
2224
OK
2325

2426
# Client 2 is now authenticated as the 'default' user
2527
> ACL WHOAMI
2628
"default"
2729
```
2830

31+
The authentication lasts for the entire connection, so the client does not need to re-authenticate for every command.
32+
2933
### Tests
3034

3135
The tester will execute your program like this:
@@ -34,7 +38,7 @@ The tester will execute your program like this:
3438
$ ./your_program.sh
3539
```
3640

37-
It'll then send commands to two different clients.
41+
It will then send commands to two different clients:
3842

3943
```bash
4044
# Client 1
@@ -62,10 +66,8 @@ OK
6266
"default"
6367
```
6468

65-
The tester will validate the following:
69+
The tester will verify that:
6670

6771
1. A new client receives a `NOAUTH` error when attempting to execute commands before authenticating.
68-
69-
2. The `AUTH` command returns `OK` upon successful authentication.
70-
71-
3. The client can execute `ACL WHOAMI` successfully after authentication.
72+
2. The `AUTH` command returns `OK` as a simple string on successful authentication.
73+
3. The client can execute `ACL WHOAMI` successfully after authentication.

0 commit comments

Comments
 (0)