"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/unit/acl.tcl" between
redis-6.2-rc3.tar.gz and redis-6.2.0.tar.gz

About: redis is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

acl.tcl  (redis-6.2-rc3):acl.tcl  (redis-6.2.0)
skipping to change at line 220 skipping to change at line 220
test {ACLs can include single subcommands} { test {ACLs can include single subcommands} {
r ACL setuser newuser +@all -client r ACL setuser newuser +@all -client
r ACL setuser newuser +client|id +client|setname r ACL setuser newuser +client|id +client|setname
r CLIENT ID; # Should not fail r CLIENT ID; # Should not fail
r CLIENT SETNAME foo ; # Should not fail r CLIENT SETNAME foo ; # Should not fail
catch {r CLIENT KILL type master} e catch {r CLIENT KILL type master} e
set e set e
} {*NOPERM*} } {*NOPERM*}
test {ACLs set can include subcommands, if already full command exists} {
r ACL setuser bob +memory|doctor
set cmdstr [dict get [r ACL getuser bob] commands]
assert_equal {-@all +memory|doctor} $cmdstr
# Validate the commands have got engulfed to +memory.
r ACL setuser bob +memory
set cmdstr [dict get [r ACL getuser bob] commands]
assert_equal {-@all +memory} $cmdstr
# Appending to the existing access string of bob.
r ACL setuser bob +@all +client|id
# Validate the new commands has got engulfed to +@all.
set cmdstr [dict get [r ACL getuser bob] commands]
assert_equal {+@all} $cmdstr
r CLIENT ID; # Should not fail
r MEMORY DOCTOR; # Should not fail
}
# Note that the order of the generated ACL rules is not stable in Redis # Note that the order of the generated ACL rules is not stable in Redis
# so we need to match the different parts and not as a whole string. # so we need to match the different parts and not as a whole string.
test {ACL GETUSER is able to translate back command permissions} { test {ACL GETUSER is able to translate back command permissions} {
# Subtractive # Subtractive
r ACL setuser newuser reset +@all ~* -@string +incr -debug +debug|digest r ACL setuser newuser reset +@all ~* -@string +incr -debug +debug|digest
set cmdstr [dict get [r ACL getuser newuser] commands] set cmdstr [dict get [r ACL getuser newuser] commands]
assert_match {*+@all*} $cmdstr assert_match {*+@all*} $cmdstr
assert_match {*-@string*} $cmdstr assert_match {*-@string*} $cmdstr
assert_match {*+incr*} $cmdstr assert_match {*+incr*} $cmdstr
assert_match {*-debug +debug|digest**} $cmdstr assert_match {*-debug +debug|digest**} $cmdstr
 End of changes. 1 change blocks. 
0 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)