Skip to content

Commit

Permalink
Test HASH module ACL support
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 committed Dec 26, 2024
1 parent f48b43d commit 2c83186
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public class CommandDetailParser {
aclCategoriesMap.put("@hyperloglog", AclCategory.HYPERLOGLOG);
aclCategoriesMap.put("@geo", AclCategory.GEO);
aclCategoriesMap.put("@stream", AclCategory.STREAM);
// TODO:
aclCategoriesMap.put("@pubsub", AclCategory.PUBSUB);
aclCategoriesMap.put("@admin", AclCategory.ADMIN);
aclCategoriesMap.put("@fast", AclCategory.FAST);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,13 @@ void aclWhoami() {
assertThat(redis.aclWhoami()).isEqualTo("default");
}

@Test
void aclHashCommands() {
assertThat(redis.aclDeluser("foo")).isNotNull();
AclSetuserArgs args = AclSetuserArgs.Builder.on().addCategory(AclCategory.HASH);
assertThat(redis.aclSetuser("foo", args)).isEqualTo("OK");
assertThat(redis.aclGetuser("foo")).contains("-@all +@hash");
assertThat(redis.aclDeluser("foo")).isNotNull();
}

}

0 comments on commit 2c83186

Please sign in to comment.