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-08-ws7.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
1
In this stage, you'll implement enforcing authentication using the `AUTH` command.
2
2
3
-
### Enforcing authentication using `AUTH`
3
+
### Enforcing Authentication using `AUTH`
4
4
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:
6
8
7
9
```bash
8
10
# Client 1
@@ -18,14 +20,16 @@ $ redis-cli
18
20
> ACL WHOAMI
19
21
(error) NOAUTH Authentication required.
20
22
21
-
> AUTH default mypassword
23
+
> AUTH default newpassword
22
24
OK
23
25
24
26
# Client 2 is now authenticated as the 'default' user
25
27
> ACL WHOAMI
26
28
"default"
27
29
```
28
30
31
+
The authentication lasts for the entire connection, so the client does not need to re-authenticate for every command.
32
+
29
33
### Tests
30
34
31
35
The tester will execute your program like this:
@@ -34,7 +38,7 @@ The tester will execute your program like this:
34
38
$ ./your_program.sh
35
39
```
36
40
37
-
It'll then send commands to two different clients.
41
+
It will then send commands to two different clients:
38
42
39
43
```bash
40
44
# Client 1
@@ -62,10 +66,8 @@ OK
62
66
"default"
63
67
```
64
68
65
-
The tester will validate the following:
69
+
The tester will verify that:
66
70
67
71
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