From 733f8b808291e417b625c17ee992ee76e00e7781 Mon Sep 17 00:00:00 2001 From: Oluwabusayo Jacobs <68024640+TropicolX@users.noreply.github.com> Date: Fri, 7 Nov 2025 08:13:08 +0100 Subject: [PATCH 1/3] Revise "Respond to ACL GETUSER #gx8" --- stage_descriptions/auth-02-gx8.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/stage_descriptions/auth-02-gx8.md b/stage_descriptions/auth-02-gx8.md index 5e76f4a1..d64e7129 100644 --- a/stage_descriptions/auth-02-gx8.md +++ b/stage_descriptions/auth-02-gx8.md @@ -2,7 +2,7 @@ In this stage, you'll add support for responding to the `ACL GETUSER` command. ### The `ACL GETUSER` command -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. +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. 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. @@ -13,7 +13,7 @@ Example usage: 2) (empty array) ``` -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. +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. ### Tests @@ -23,7 +23,7 @@ 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 # Expect RESP array: ["flags", []] @@ -41,5 +41,4 @@ The tester will validate the following for the response: ### Notes - A user can have multiple flags. This is why the value of flags property is an array. - -- The second element of the array is the flags array, which contains the user flags. We'll get to this in the later stages. \ No newline at end of file +- The second element of the array is the flags array, which contains the user flags. We'll get to this in the later stages. From 79d524b9444dded9ede82d2bf798c74eb8de0383 Mon Sep 17 00:00:00 2001 From: Oluwabusayo Jacobs <68024640+TropicolX@users.noreply.github.com> Date: Sat, 8 Nov 2025 09:07:39 +0100 Subject: [PATCH 2/3] 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. --- stage_descriptions/auth-02-gx8.md | 46 +++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/stage_descriptions/auth-02-gx8.md b/stage_descriptions/auth-02-gx8.md index d64e7129..3160eb08 100644 --- a/stage_descriptions/auth-02-gx8.md +++ b/stage_descriptions/auth-02-gx8.md @@ -1,19 +1,40 @@ -In this stage, you'll add support for responding to the `ACL GETUSER` command. +In this stage, you'll add support for the `ACL GETUSER` command. ### The `ACL GETUSER` command -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. +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. -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. - -Example usage: +For example: ```bash > ACL GETUSER default 1) "flags" 2) (empty array) +... +``` + +The command expects the response to be a nested RESP array of property name-value pairs for a user: + +```bash +[property_name_1, property_value_1, property_name_2, property_value_2, ...] ``` -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. +For this stage, you'll implement just the `flags` property. + +### The `flags` Property + +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. + +For example, after creating or modifying a user, the flags array might look like this: + +```bash +> ACL GETUSER alice +1) "flags" +2) 1) "on" + 2) "allkeys" + 3) "allcommands" +``` + +For this stage, since the `default` user has no flags to report yet, you will hardcode this to be an empty RESP array (`[]`). ### Tests @@ -23,7 +44,7 @@ The tester will execute your program like this: $ ./your_program.sh ``` -It will then send an `ACL GETUSER` command specifying the `default` user. +It will then send an `ACL GETUSER` command specifying the `default` user: ```bash # Expect RESP array: ["flags", []] @@ -33,12 +54,7 @@ $ redis-cli 2) (empty array) ``` -The tester will validate the following for the response: - -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. - -### Notes +The tester will verify that the response is a RESP array with two elements: -- A user can have multiple flags. This is why the value of flags property is an array. -- The second element of the array is the flags array, which contains the user flags. We'll get to this in the later stages. +1. The first element is the bulk string `flags`. +2. The second element is an empty RESP array. From ff692fc7d77b8883caea215fddf0b46f78aea28d Mon Sep 17 00:00:00 2001 From: Oluwabusayo Jacobs <68024640+TropicolX@users.noreply.github.com> Date: Sun, 9 Nov 2025 05:37:44 +0100 Subject: [PATCH 3/3] Update auth-02-gx8.md --- stage_descriptions/auth-02-gx8.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stage_descriptions/auth-02-gx8.md b/stage_descriptions/auth-02-gx8.md index 3160eb08..00b20d1e 100644 --- a/stage_descriptions/auth-02-gx8.md +++ b/stage_descriptions/auth-02-gx8.md @@ -1,10 +1,11 @@ In this stage, you'll add support for the `ACL GETUSER` command. -### The `ACL GETUSER` command +### The `ACL GETUSER` Command 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. For example: + ```bash > ACL GETUSER default 1) "flags" @@ -12,7 +13,7 @@ For example: ... ``` -The command expects the response to be a nested RESP array of property name-value pairs for a user: +The return value is nested RESP array of property name-value pairs for a user: ```bash [property_name_1, property_value_1, property_name_2, property_value_2, ...] @@ -34,7 +35,7 @@ For example, after creating or modifying a user, the flags array might look like 3) "allcommands" ``` -For this stage, since the `default` user has no flags to report yet, you will hardcode this to be an empty RESP array (`[]`). +For this stage, since the `default` user has no `flags` to report yet, you will hardcode the value to be an empty RESP array (`[]`). ### Tests