Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions stage_descriptions/auth-04-pl7.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
In this stage, you'll add support for responding to the `ACL GETUSER` command with the passwords property.
In this stage, you'll add support for responding to the `ACL GETUSER` command with the `passwords` property.

### The `passwords` property
### The `passwords` Property

A user in the Redis ACL system can have zero or more passwords associated with them. The `ACL GETUSER` command also returns the `passwords` property of the specified user.
The `passwords` property lists all hash-encoded passwords associated with a user.

The `default` user does not have any associated passwords unless explicitly configured:

Example usage:
```bash
> ACL GETUSER default
1) "flags"
Expand All @@ -13,7 +14,10 @@ Example usage:
4) (empty array)
```

The fourth element of the response is the passwords array. The default user does not have any associated passwords unless explicitly configured. This is why the passwords array is empty for the default user.
Your `ACL GETUSER` response must now include the following:

1. The string `passwords`, encoded as a bulk string.
2. A RESP array containing the list of passwords. Since the `default` user has none, you must hardcode this to be an empty array.

### Tests

Expand All @@ -23,21 +27,20 @@ The tester will execute your program like this:
$ ./your_program.sh
```

It'll then send an `ACL GETUSER` command specifying the `default` user.
It will then send an `ACL GETUSER` command specifying the `default` user:

```bash
$ redis-cli
# Expect RESP array: ["flags", ["nopass"], "passwords", []]
> ACL GETUSER default
$ redis-cli ACL GETUSER default
1) "flags"
2) 1) "nopass"
3) "passwords"
4) (empty array)
```

The tester will validate the following for the response:
The tester will validate that the response is a RESP array with four elements:

1. The first element of the array is the string `flags`, encoded as a RESP bulk string.
2. The second element of the array is a RESP array and contains the `nopass` flag.
3. The third element of the array is the string `passwords`, encoded as a RESP bulk string.
4. The fourth element of the array is an empty array because no passwords have been specified for the default user.
3. The third element of the array is the string `passwords`, encoded as a bulk string.
4. The fourth element of the array is an empty array.
Loading