Skip to content

Commit 52278ec

Browse files
DOC-4439 tried ACL set/del commands
1 parent f3167cb commit 52278ec

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

doctests/cmds_cnxmgmt_test.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,32 @@ func ExampleClient_cmd_auth() {
4444

4545
fmt.Println(authResult2) // >>> OK
4646
// REMOVE_START
47-
rdb.ConfigSet(ctx, "require_pass", "")
47+
confRes, err := rdb.ConfigSet(ctx, "requirepass", "").Result()
48+
fmt.Println(confRes)
4849
// REMOVE_END
4950
// STEP_END
5051

5152
// STEP_START auth2
53+
// REMOVE_START
54+
res, err := rdb.ACLSetUser(ctx, "test-user", "on", ">strong_password", "+acl").Result()
55+
fmt.Println(res)
56+
// REMOVE_END
5257
authResult3, err := rdb.Conn().AuthACL(ctx,
5358
"test_user", "strong_password",
5459
).Result()
5560

5661
if err != nil {
57-
fmt.Println(err)
62+
panic(err)
5863
}
5964

6065
fmt.Println(authResult3) // >>> OK
66+
// REMOVE_START
67+
rdb.ACLDelUser(ctx, "test-user")
68+
// REMOVE_END
6169
// STEP_END
6270

6371
// Output:
6472
// OK
6573
// OK
66-
// WRONGPASS invalid username-password pair or user is disabled.
74+
// OK
6775
}

0 commit comments

Comments
 (0)