Skip to content

Commit 79d524b

Browse files
authored
Refine documentation for ACL GETUSER command
Clarified the explanation of the `ACL GETUSER` command and the `flags` property. Adjusted example usage and response validation details.
1 parent 733f8b8 commit 79d524b

File tree

1 file changed

+31
-15
lines changed

1 file changed

+31
-15
lines changed

stage_descriptions/auth-02-gx8.md

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,40 @@
1-
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.
22

33
### The `ACL GETUSER` command
44

5-
The [`ACL GETUSER`](https://redis.io/docs/latest/commands/acl-getuser/) is used to retrieve the properties of 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.
66

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.
8-
9-
Example usage:
7+
For example:
108
```bash
119
> ACL GETUSER default
1210
1) "flags"
1311
2) (empty array)
12+
...
13+
```
14+
15+
The command expects the response to be a nested RESP array of property name-value pairs for a user:
16+
17+
```bash
18+
[property_name_1, property_value_1, property_name_2, property_value_2, ...]
1419
```
1520

16-
The second element of the response 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.
21+
For this stage, you'll implement just the `flags` property.
22+
23+
### The `flags` Property
24+
25+
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.
26+
27+
For example, after creating or modifying a user, the flags array might look like this:
28+
29+
```bash
30+
> ACL GETUSER alice
31+
1) "flags"
32+
2) 1) "on"
33+
2) "allkeys"
34+
3) "allcommands"
35+
```
36+
37+
For this stage, since the `default` user has no flags to report yet, you will hardcode this to be an empty RESP array (`[]`).
1738

1839
### Tests
1940

@@ -23,7 +44,7 @@ The tester will execute your program like this:
2344
$ ./your_program.sh
2445
```
2546

26-
It will then send an `ACL GETUSER` command specifying the `default` user.
47+
It will then send an `ACL GETUSER` command specifying the `default` user:
2748

2849
```bash
2950
# Expect RESP array: ["flags", []]
@@ -33,12 +54,7 @@ $ redis-cli
3354
2) (empty array)
3455
```
3556

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
57+
The tester will verify that the response is a RESP array with two elements:
4258

43-
- A user can have multiple flags. This is why the value of flags property is an array.
44-
- The second element of the array is the flags array, which contains the user flags. We'll get to this in the later stages.
59+
1. The first element is the bulk string `flags`.
60+
2. The second element is an empty RESP array.

0 commit comments

Comments
 (0)