Unverified Commit 55c81f2c authored by Madelyn Olson's avatar Madelyn Olson Committed by GitHub
Browse files

ACL V2 - Selectors and key based permissions (#9974)



* Implemented selectors which provide multiple different sets of permissions to users
* Implemented key based permissions 
* Added a new ACL dry-run command to test permissions before execution
* Updated module APIs to support checking key based permissions
Co-authored-by: default avatarOran Agra <oran@redislabs.com>
parent 10bbeb68
...@@ -20,11 +20,20 @@ start_server {tags {"modules acl"}} { ...@@ -20,11 +20,20 @@ start_server {tags {"modules acl"}} {
test {test module check acl for key perm} { test {test module check acl for key perm} {
# give permission for SET and block all keys but x # give permission for SET and block all keys but x
r acl setuser default +set resetkeys ~x r acl setuser default +set resetkeys ~x %W~y %R~z
assert_equal [r aclcheck.set.check.key x 5] OK
catch {r aclcheck.set.check.key y 5} e assert_equal [r aclcheck.set.check.key "*" x 5] OK
set e catch {r aclcheck.set.check.key "*" v 5} e
} {*DENIED KEY*} assert_match "*DENIED KEY*" $e
assert_equal [r aclcheck.set.check.key "W" y 5] OK
catch {r aclcheck.set.check.key "W" v 5} e
assert_match "*DENIED KEY*" $e
assert_equal [r aclcheck.set.check.key "R" z 5] OK
catch {r aclcheck.set.check.key "R" v 5} e
assert_match "*DENIED KEY*" $e
}
test {test module check acl for module user} { test {test module check acl for module user} {
# the module user has access to all keys # the module user has access to all keys
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment