1
0
mirror of https://github.com/redis/go-redis.git synced 2025-11-10 00:00:57 +03:00

feat(acl): add acl support and test (#3576)

* feat: add acl support and command test

* validate client name before kill it

---------

Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
This commit is contained in:
destinyoooo
2025-11-05 00:19:09 +08:00
committed by GitHub
parent 71bb3cae4f
commit e2f6700d79
3 changed files with 60 additions and 0 deletions

View File

@@ -92,6 +92,21 @@ var _ = Describe("ACL user commands", Label("NonRedisEnterprise"), func() {
Expect(err).NotTo(HaveOccurred())
Expect(res).To(HaveLen(1))
Expect(res[0]).To(ContainSubstring("default"))
res, err = client.ACLUsers(ctx).Result()
Expect(err).NotTo(HaveOccurred())
Expect(res).To(HaveLen(1))
Expect(res[0]).To(Equal("default"))
res1, err := client.ACLWhoAmI(ctx).Result()
Expect(err).NotTo(HaveOccurred())
Expect(res1).To(Equal("default"))
})
It("gen password", func() {
password, err := client.ACLGenPass(ctx, 0).Result()
Expect(err).NotTo(HaveOccurred())
Expect(password).NotTo(BeEmpty())
})
It("setuser and deluser", func() {