Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
846 changes: 423 additions & 423 deletions src/commands.def

Large diffs are not rendered by default.

14 changes: 4 additions & 10 deletions src/commands/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,13 @@ following keys. To be safe, assume all of them are optional.
if type is "pure-token". If type is anything else, then `"token"` indicates
the argument is preceded by an extra (fixed string) argument.

Implicit ACL categories
ACL categories
-----------------------

The ACL categories specified as `"acl_categories"` are not the ones actually used.
The effective ACL categories are affected also by command flags.

The logic for this can be found in the function `setImplicitACLCategories()` in
`server.c`. Here are the rules (unless they have changed since this
documentation was written):
The ACL categories specified as `"acl_categories"` are the ones that are actually used.
**Note:** commands categories should follow specific rules that are checked in `utils/generate-command-code.py`

**ACL Category Rules:**
* Command flag WRITE implies ACL category WRITE.
* Command flag READONLY and not ACL category SCRIPTING implies ACL category READ.
"Exclude scripting commands from the RO category."
Expand All @@ -153,9 +150,6 @@ documentation was written):
* Command flag BLOCKING implies ACL category BLOCKING.
* Not ACL category FAST implies ACL category SLOW. "If it's not fast, it's slow."

There's an issue about explicitly listing all categories, removing this
discrepancy: https://github.com/valkey-io/valkey/issues/417

Key specs
---------

Expand Down
3 changes: 3 additions & 0 deletions src/commands/acl-cat.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"type": "string",
"optional": true
}
],
"acl_categories": [
"SLOW"
]
}
}
11 changes: 8 additions & 3 deletions src/commands/acl-deluser.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"SENTINEL"
],
"command_tips": [
"REQUEST_POLICY:ALL_NODES",
"RESPONSE_POLICY:ALL_SUCCEEDED"
],
"REQUEST_POLICY:ALL_NODES",
"RESPONSE_POLICY:ALL_SUCCEEDED"
],
"reply_schema": {
"type": "integer",
"description": "The number of users that were deleted."
Expand All @@ -28,6 +28,11 @@
"type": "string",
"multiple": true
}
],
"acl_categories": [
"ADMIN",
"DANGEROUS",
"SLOW"
]
}
}
5 changes: 5 additions & 0 deletions src/commands/acl-dryrun.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
"optional": true,
"multiple": true
}
],
"acl_categories": [
"ADMIN",
"DANGEROUS",
"SLOW"
]
}
}
3 changes: 3 additions & 0 deletions src/commands/acl-genpass.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"type": "integer",
"optional": true
}
],
"acl_categories": [
"SLOW"
]
}
}
7 changes: 6 additions & 1 deletion src/commands/acl-getuser.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
"type": "null"
}
]
}
},
"acl_categories": [
"ADMIN",
"DANGEROUS",
"SLOW"
]
}
}
5 changes: 4 additions & 1 deletion src/commands/acl-help.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"items": {
"type": "string"
}
}
},
"acl_categories": [
"SLOW"
]
}
}
7 changes: 6 additions & 1 deletion src/commands/acl-list.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"items": {
"type": "string"
}
}
},
"acl_categories": [
"ADMIN",
"DANGEROUS",
"SLOW"
]
}
}
7 changes: 6 additions & 1 deletion src/commands/acl-load.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
],
"reply_schema": {
"const": "OK"
}
},
"acl_categories": [
"ADMIN",
"DANGEROUS",
"SLOW"
]
}
}
5 changes: 5 additions & 0 deletions src/commands/acl-log.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@
}
]
}
],
"acl_categories": [
"ADMIN",
"DANGEROUS",
"SLOW"
]
}
}
11 changes: 8 additions & 3 deletions src/commands/acl-save.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@
"SENTINEL"
],
"command_tips": [
"REQUEST_POLICY:ALL_NODES",
"RESPONSE_POLICY:ALL_SUCCEEDED"
"REQUEST_POLICY:ALL_NODES",
"RESPONSE_POLICY:ALL_SUCCEEDED"
],
"reply_schema": {
"const": "OK"
}
},
"acl_categories": [
"ADMIN",
"DANGEROUS",
"SLOW"
]
}
}
11 changes: 8 additions & 3 deletions src/commands/acl-setuser.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"SENTINEL"
],
"command_tips": [
"REQUEST_POLICY:ALL_NODES",
"RESPONSE_POLICY:ALL_SUCCEEDED"
],
"REQUEST_POLICY:ALL_NODES",
"RESPONSE_POLICY:ALL_SUCCEEDED"
],
"reply_schema": {
"const": "OK"
},
Expand All @@ -42,6 +42,11 @@
"optional": true,
"multiple": true
}
],
"acl_categories": [
"ADMIN",
"DANGEROUS",
"SLOW"
]
}
}
7 changes: 6 additions & 1 deletion src/commands/acl-users.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"items": {
"type": "string"
}
}
},
"acl_categories": [
"ADMIN",
"DANGEROUS",
"SLOW"
]
}
}
5 changes: 4 additions & 1 deletion src/commands/acl-whoami.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"reply_schema": {
"type": "string",
"description": "The username of the current connection."
}
},
"acl_categories": [
"SLOW"
]
}
}
3 changes: 3 additions & 0 deletions src/commands/acl.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"arity": -2,
"command_flags": [
"SENTINEL"
],
"acl_categories": [
"SLOW"
]
}
}
4 changes: 3 additions & 1 deletion src/commands/append.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"FAST"
],
"acl_categories": [
"STRING"
"FAST",
"STRING",
"WRITE"
],
"key_specs": [
{
Expand Down
3 changes: 2 additions & 1 deletion src/commands/asking.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"FAST"
],
"acl_categories": [
"CONNECTION"
"CONNECTION",
"FAST"
],
"reply_schema": {
"const": "OK"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"ALLOW_BUSY"
],
"acl_categories": [
"CONNECTION"
"CONNECTION",
"FAST"
],
"reply_schema": {
"const": "OK"
Expand Down
7 changes: 6 additions & 1 deletion src/commands/bgrewriteaof.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"reply_schema": {
"description": "A simple string reply indicating that the rewriting started or is about to start ASAP",
"type": "string"
}
},
"acl_categories": [
"ADMIN",
"DANGEROUS",
"SLOW"
]
}
}
7 changes: 6 additions & 1 deletion src/commands/bgsave.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
"const": "Scheduled background saving cancelled"
}
]
}
},
"acl_categories": [
"ADMIN",
"DANGEROUS",
"SLOW"
]
}
}
4 changes: 3 additions & 1 deletion src/commands/bitcount.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"READONLY"
],
"acl_categories": [
"BITMAP"
"BITMAP",
"READ",
"SLOW"
],
"key_specs": [
{
Expand Down
4 changes: 3 additions & 1 deletion src/commands/bitfield.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"DENYOOM"
],
"acl_categories": [
"BITMAP"
"BITMAP",
"SLOW",
"WRITE"
],
"key_specs": [
{
Expand Down
4 changes: 3 additions & 1 deletion src/commands/bitfield_ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"FAST"
],
"acl_categories": [
"BITMAP"
"BITMAP",
"FAST",
"READ"
],
"key_specs": [
{
Expand Down
4 changes: 3 additions & 1 deletion src/commands/bitop.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"DENYOOM"
],
"acl_categories": [
"BITMAP"
"BITMAP",
"SLOW",
"WRITE"
],
"key_specs": [
{
Expand Down
4 changes: 3 additions & 1 deletion src/commands/bitpos.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"READONLY"
],
"acl_categories": [
"BITMAP"
"BITMAP",
"READ",
"SLOW"
],
"key_specs": [
{
Expand Down
5 changes: 4 additions & 1 deletion src/commands/blmove.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"BLOCKING"
],
"acl_categories": [
"LIST"
"BLOCKING",
"LIST",
"SLOW",
"WRITE"
],
"key_specs": [
{
Expand Down
5 changes: 4 additions & 1 deletion src/commands/blmpop.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"BLOCKING"
],
"acl_categories": [
"LIST"
"BLOCKING",
"LIST",
"SLOW",
"WRITE"
],
"key_specs": [
{
Expand Down
5 changes: 4 additions & 1 deletion src/commands/blpop.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
"BLOCKING"
],
"acl_categories": [
"LIST"
"BLOCKING",
"LIST",
"SLOW",
"WRITE"
],
"key_specs": [
{
Expand Down
5 changes: 4 additions & 1 deletion src/commands/brpop.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
"BLOCKING"
],
"acl_categories": [
"LIST"
"BLOCKING",
"LIST",
"SLOW",
"WRITE"
],
"key_specs": [
{
Expand Down
Loading
Loading