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 GETUSER` command.
1
+
In this stage, you'll add support for the `ACL GETUSER` command.
2
2
3
-
### The `ACL GETUSER`command
3
+
### The `ACL GETUSER`Command
4
4
5
-
The [`ACL GETUSER`](https://redis.io/docs/latest/commands/acl-getuser/)is used to retrieve the properties the specified user. In Redis, the `default` user is present from the start, without having to create it explicitly.
5
+
The [`ACL GETUSER`](https://redis.io/docs/latest/commands/acl-getuser/)command retrieves the properties of a specified user. In Redis, the `default` user is present from the start and does not need to be created.
6
6
7
-
The `ACL GETUSER` returns multiple properties of the user, among which `flags` is one. In this stage, you'll add support for responding to the `ACL GETUSER` command with only the flags property.
7
+
For example:
8
8
9
-
Example usage:
10
9
```bash
11
10
> ACL GETUSER default
12
11
1) "flags"
13
12
2) (empty array)
13
+
...
14
14
```
15
15
16
-
The second element of the resposne is the flags array. This is because a user can have multiple flags associated with it. In this stage, you can hardcode the flags array to be an empty array.
16
+
The return value is nested RESP array of property name-value pairs for a user:
For this stage, you'll implement just the `flags` property.
23
+
24
+
### The `flags` Property
25
+
26
+
The `flags` property represents a set of attributes that describe how a user behaves or what special permissions they have. Each flag is a short label that defines part of the user’s configuration.
27
+
28
+
For example, after creating or modifying a user, the flags array might look like this:
29
+
30
+
```bash
31
+
> ACL GETUSER alice
32
+
1) "flags"
33
+
2) 1) "on"
34
+
2) "allkeys"
35
+
3) "allcommands"
36
+
```
37
+
38
+
For this stage, since the `default` user has no `flags` to report yet, you will hardcode the value to be an empty RESP array (`[]`).
17
39
18
40
### Tests
19
41
@@ -23,7 +45,7 @@ The tester will execute your program like this:
23
45
$ ./your_program.sh
24
46
```
25
47
26
-
It'll then send an `ACL GETUSER` command specifying the `default` user.
48
+
It will then send an `ACL GETUSER` command specifying the `default` user:
27
49
28
50
```bash
29
51
# Expect RESP array: ["flags", []]
@@ -33,13 +55,7 @@ $ redis-cli
33
55
2) (empty array)
34
56
```
35
57
36
-
The tester will validate the following for the response:
37
-
38
-
1. The first element of the array is the string `flags`, encoded as a RESP bulk string.
39
-
2. The second element of the array is a RESP array.
40
-
41
-
### Notes
42
-
43
-
- A user can have multiple flags. This is why the value of flags property is an array.
58
+
The tester will verify that the response is a RESP array with two elements:
44
59
45
-
- The second element of the array is the flags array, which contains the user flags. We'll get to this in the later stages.
0 commit comments