From 2c83186c12c29dcd72c537592c79b1d12a167758 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Thu, 26 Dec 2024 16:23:04 +0600 Subject: [PATCH] Test HASH module ACL support --- .../lettuce/core/models/command/CommandDetailParser.java | 1 + .../core/commands/AclCommandIntegrationTests.java | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/main/java/io/lettuce/core/models/command/CommandDetailParser.java b/src/main/java/io/lettuce/core/models/command/CommandDetailParser.java index 0f4c03325c..695c8cbecf 100644 --- a/src/main/java/io/lettuce/core/models/command/CommandDetailParser.java +++ b/src/main/java/io/lettuce/core/models/command/CommandDetailParser.java @@ -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); diff --git a/src/test/java/io/lettuce/core/commands/AclCommandIntegrationTests.java b/src/test/java/io/lettuce/core/commands/AclCommandIntegrationTests.java index 7fbeb7cf9f..439dd99480 100644 --- a/src/test/java/io/lettuce/core/commands/AclCommandIntegrationTests.java +++ b/src/test/java/io/lettuce/core/commands/AclCommandIntegrationTests.java @@ -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(); + } + }