valkey/utils
Oran Agra eef9c6b0ee
New detailed key-spec flags (RO, RW, OW, RM, ACCESS, UPDATE, INSERT, DELETE) (#10122)
The new ACL key based permissions in #9974 require the key-specs (#8324) to have more
explicit flags rather than just READ and WRITE. See discussion in #10040

This PR defines two groups of flags:
One about how redis internally handles the key (mutually-exclusive).
The other is about the logical operation done from the user's point of view (3 mutually exclusive
write flags, and one read flag, all optional).
In both groups, if we can't explicitly flag something as explicit read-only, delete-only, or
insert-only, we flag it as `RW` or `UPDATE`.
here's the definition from the code:
```
/* Key-spec flags *
 * -------------- */
/* The following refer what the command actually does with the value or metadata
 * of the key, and not necessarily the user data or how it affects it.
 * Each key-spec may must have exaclty one of these. Any operation that's not
 * distinctly deletion, overwrite or read-only would be marked as RW. */
#define CMD_KEY_RO (1ULL<<0)     /* Read-Only - Reads the value of the key, but
                                  * doesn't necessarily returns it. */
#define CMD_KEY_RW (1ULL<<1)     /* Read-Write - Modifies the data stored in the
                                  * value of the key or its metadata. */
#define CMD_KEY_OW (1ULL<<2)     /* Overwrite - Overwrites the data stored in
                                  * the value of the key. */
#define CMD_KEY_RM (1ULL<<3)     /* Deletes the key. */
/* The follwing refer to user data inside the value of the key, not the metadata
 * like LRU, type, cardinality. It refers to the logical operation on the user's
 * data (actual input strings / TTL), being used / returned / copied / changed,
 * It doesn't refer to modification or returning of metadata (like type, count,
 * presence of data). Any write that's not INSERT or DELETE, would be an UPADTE.
 * Each key-spec may have one of the writes with or without access, or none: */
#define CMD_KEY_ACCESS (1ULL<<4) /* Returns, copies or uses the user data from
                                  * the value of the key. */
#define CMD_KEY_UPDATE (1ULL<<5) /* Updates data to the value, new value may
                                  * depend on the old value. */
#define CMD_KEY_INSERT (1ULL<<6) /* Adds data to the value with no chance of,
                                  * modification or deletion of existing data. */
#define CMD_KEY_DELETE (1ULL<<7) /* Explicitly deletes some content
                                  * from the value of the key. */
```

Unrelated changes:
- generate-command-code.py is only compatible with python3 (modified the shabang)
- generate-command-code.py print file on json parsing error
- rename `shard_channel` key-spec flag to just `channel`.
- add INCOMPLETE flag in input spec of SORT and SORT_RO
2022-01-18 16:00:00 +02:00
..
create-cluster Use utils/create-cluster from any dir (#9766) 2021-11-11 08:33:09 +02:00
graphs/commits-over-time Added Tcl program to show commits graphicaly. 2015-11-20 15:45:25 +01:00
hashtable Limit the main db and expires dictionaries to expand (#7954) 2020-12-06 11:53:04 +02:00
hyperloglog Fix HyperLogLog test script for new redis-rb API. 2018-03-16 16:34:04 +01:00
lru Fixed some typos, add a spell check ci and others minor fix (#8890) 2021-06-10 15:39:33 +03:00
releasetools Fixes to release scripts (#7547) 2020-07-21 14:07:06 +03:00
srandmember Fixed some typos, add a spell check ci and others minor fix (#8890) 2021-06-10 15:39:33 +03:00
build-static-symbols.tcl Tcl script, make target, and redis.c changes to build the static symbol table automagically 2009-11-10 19:20:32 +01:00
cluster_fail_time.tcl Cluster: Tcl script to check avg pfail->fail time. 2015-01-30 12:03:17 +01:00
corrupt_rdb.c fix corrupt_rdb.c bug.Let the name of input rdb file name be valid. 2019-03-01 17:46:42 +01:00
gen-test-certs.sh Typo fix in gen-test-certs.sh (#8841) 2021-04-25 10:11:16 +03:00
generate-command-code.py New detailed key-spec flags (RO, RW, OW, RM, ACCESS, UPDATE, INSERT, DELETE) (#10122) 2022-01-18 16:00:00 +02:00
generate-command-help.rb Adds the "bitmap" category to redis-cli help(#9474) 2021-09-09 10:16:30 +03:00
generate-commands-json.py Move doc metadata from COMMAND to COMMAND DOCS (#10056) 2022-01-11 17:16:16 +02:00
install_server.sh Do not install SysV init-scripts on systemd-enabled hosts 2019-11-19 18:55:44 +02:00
redis_init_script Add INIT INFO to the provided init script. 2018-03-26 11:29:16 +02:00
redis_init_script.tpl Update redis_init_script.tpl 2014-10-26 11:09:45 -07:00
redis-copy.rb Deprecate utils/redis-copy.rb in favor of redis-copy gem 2013-11-06 08:31:57 +00:00
redis-sha1.rb Fixed some typos, add a spell check ci and others minor fix (#8890) 2021-06-10 15:39:33 +03:00
speed-regression.tcl Fixed some typos, add a spell check ci and others minor fix (#8890) 2021-06-10 15:39:33 +03:00
systemd-redis_multiple_servers@.service Provide example systemd service unit files for redis-server 2019-11-19 18:55:44 +02:00
systemd-redis_server.service Start redis after network is online (#7639) 2020-08-11 12:30:32 +03:00
tracking_collisions.c Fixed some typos, add a spell check ci and others minor fix (#8890) 2021-06-10 15:39:33 +03:00
whatisdoing.sh Changes http to https in texts (#8495) 2021-03-10 19:11:16 +02:00