Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
26f98bca
Commit
26f98bca
authored
Jan 28, 2019
by
antirez
Browse files
ACL: Test: check default behavior and keys ACLs.
parent
6320aa49
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/unit/acl.tcl
View file @
26f98bca
...
@@ -34,4 +34,24 @@ start_server {tags {"acl"}} {
...
@@ -34,4 +34,24 @@ start_server {tags {"acl"}} {
catch
{
r AUTH newuser passwd1
}
e
catch
{
r AUTH newuser passwd1
}
e
set e
set e
}
{
*WRONGPASS*
}
}
{
*WRONGPASS*
}
test
{
By default users are not able to access any command
}
{
catch
{
r SET foo bar
}
e
set e
}
{
*NOPERM*
}
test
{
By default users are not able to access any key
}
{
r ACL setuser newuser +set
catch
{
r SET foo bar
}
e
set e
}
{
*NOPERM*key*
}
test
{
It's possible to allow the access of a subset of keys
}
{
r ACL setuser newuser allcommands ~foo:* ~bar:*
r SET foo:1 a
r SET bar:2 b
catch
{
r SET zap:3 c
}
e
r ACL setuser newuser allkeys
;
# Undo keys ACL
set e
}
{
*NOPERM*key*
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment