Handle key-spec flags with modules#10237
Handle key-spec flags with modules#10237oranagra merged 7 commits intoredis:unstablefrom oranagra:modules_keyspec_flags
Conversation
- add COMMAND GETKEYSANDFLAGS sub-command - add RM_KeyAtPosWithFlags and GetCommandKeysWithFlags - RM_KeyAtPos and RM_CreateCommand use flags requiring full access - expose `variable_flags` flag in COMMAND INFO key-specs - getKeysFromCommandWithSpecs prefers key-specs over getkeys-api - add tests for all of these
enjoy-binbin
left a comment
There was a problem hiding this comment.
just looking around
|
@redis/core-team please approve the new module APIs, and command (COMMAND GETKEYSANDFLAGS) |
zuiderkwast
left a comment
There was a problem hiding this comment.
It won't hurt to check the GETKEYS (or GETKEYSANDFLAGS) output for the commands in keyspecs.tcl. That even serves as examples to easier understand the keyspecs in each test case. (I wrote these earlier.)
test "Module key specs: Two ranges" {
...
+ assert_equal [r command getkeys kspec.tworanges foo bar baz quux] {foo bar}
}
test "Module key specs: Keyword-only spec clears the legacy triple" {
...
+ assert_equal [r command getkeys kspec.keyword foo KEYS bar baz] {bar baz}
}
test "Module key specs: Complex specs, case 1" {
...
+ assert_equal [r command getkeys kspec.complex1 foo dummy KEYS 1 bar baz STORE quux] {foo quux bar}
}
test "Module key specs: Complex specs, case 2" {
...
+ assert_equal [r command getkeys kspec.complex2 foo bar 2 baz quux banana STORE dst dummy MOREKEYS hey ho] {dst foo bar baz quux hey ho}
}|
i think that test-wise, that's kinda already covered by |
|
approved in core-team meeting. |
…ges (#1784) doc changes for redis/redis#10237 Co-authored-by: Itamar Haber <[email protected]>
|
@oranagra I had a question about this decision
If a module command declares it's appropriate categories while creating a command, why do we still set the flag to be requiring full access? This decision makes the ACL key permissions to be ineffective on module commands. |
what do you mean? the |
Yes,Thanks 👍 |
variable_flagsflag in COMMAND INFO key-specsfix #10189, fix #10144