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
f4c39db4
Commit
f4c39db4
authored
Jan 28, 2019
by
antirez
Browse files
ACL: Test: nopass user flag, commands/groups +/- rules.
parent
26f98bca
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/acl.tcl
View file @
f4c39db4
...
...
@@ -54,4 +54,27 @@ start_server {tags {"acl"}} {
r ACL setuser newuser allkeys
;
# Undo keys ACL
set e
}
{
*NOPERM*key*
}
test
{
Users can be configured to authenticate with any password
}
{
r ACL setuser newuser nopass
r AUTH newuser zipzapblabla
}
{
OK
}
test
{
ACLs can exclude single commands
}
{
r ACL setuser newuser -ping
r INCR mycounter
;
# Should not raise an error
catch
{
r PING
}
e
set e
}
{
*NOPERM*
}
test
{
ACLs can include or excluse whole classes of commands
}
{
r ACL setuser newuser -@all +@set +acl
r SADD myset a b c
;
# Should not raise an error
r ACL setuser newuser +@all -@string
r SADD myset a b c
;
# Again should not raise an error
# String commands instead should raise an error
catch
{
r SET foo bar
}
e
r ACL setuser newuser allcommands
;
# Undo commands ACL
set e
}
{
*NOPERM*
}
}
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