redict/tests/unit
Binbin d616925835
Allow SET without GET arg on write-only ACL. Allow BITFIELD GET on read-only ACL (#10148)
SET is a R+W command, because it can also do `GET` on the data.
SET without GET is a write-only command.
SET with GET is a read+write command.

In #9974, we added ACL to let users define write-only access.
So when the user uses SET with GET option, and the user doesn't
have the READ permission on the key, we need to reject it,
but we rather not reject users with write-only permissions from using
the SET command when they don't use GET.

In this commit, we add a `getkeys_proc` function to control key
flags in SET command. We also add a new key spec flag (VARIABLE_FLAGS)
means that some keys might have different flags depending on arguments.

We also handle BITFIELD command, add a `bitfieldGetKeys` function.
BITFIELD GET is a READ ONLY command.
BITFIELD SET or BITFIELD INCR are READ WRITE commands.

Other changes:
1. SET GET was added in 6.2, add the missing since in set.json
2. Added tests to cover the changes in acl-v2.tcl
3. Fix some typos in server.h and cleanups in acl-v2.tcl

Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Oran Agra <oran@redislabs.com>
2022-01-26 21:03:21 +02:00
..
moduleapi Allow SET without GET arg on write-only ACL. Allow BITFIELD GET on read-only ACL (#10148) 2022-01-26 21:03:21 +02:00
type sub-command support for ACL CAT and COMMAND LIST. redisCommand always stores fullname (#10127) 2022-01-23 10:05:06 +02:00
acl-v2.tcl Allow SET without GET arg on write-only ACL. Allow BITFIELD GET on read-only ACL (#10148) 2022-01-26 21:03:21 +02:00
acl.tcl sub-command support for ACL CAT and COMMAND LIST. redisCommand always stores fullname (#10127) 2022-01-23 10:05:06 +02:00
aofrw.tcl Added AOF rewrite support for functions. (#10141) 2022-01-19 21:21:42 +02:00
auth.tcl Prevent unauthenticated client from easily consuming lots of memory (CVE-2021-32675) (#9588) 2021-10-04 12:10:31 +03:00
bitfield.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
bitops.tcl Change lzf to handle values larger than UINT32_MAX (#9776) 2021-11-16 13:12:25 +02:00
client-eviction.tcl Client eviction ci issues (#9549) 2021-09-26 17:45:02 +03:00
cluster.tcl Function Flags support (no-writes, no-cluster, allow-state, allow-oom) (#10066) 2022-01-14 14:02:02 +02:00
dump.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
expire.tcl sub-command support for ACL CAT and COMMAND LIST. redisCommand always stores fullname (#10127) 2022-01-23 10:05:06 +02:00
functions.tcl Added engine stats to FUNCTION STATS command. (#10179) 2022-01-25 15:50:14 +02:00
geo.tcl GEO* STORE with empty src key delete the dest key and return 0, not empty array (#9271) 2021-08-01 19:32:24 +03:00
hyperloglog.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
info.tcl sub-command support for ACL CAT and COMMAND LIST. redisCommand always stores fullname (#10127) 2022-01-23 10:05:06 +02:00
introspection-2.tcl sub-command support for ACL CAT and COMMAND LIST. redisCommand always stores fullname (#10127) 2022-01-23 10:05:06 +02:00
introspection.tcl sub-command support for ACL CAT and COMMAND LIST. redisCommand always stores fullname (#10127) 2022-01-23 10:05:06 +02:00
keyspace.tcl Add external test that runs without debug command (#9964) 2021-12-19 17:41:51 +02:00
latency-monitor.tcl sub-command support for ACL CAT and COMMAND LIST. redisCommand always stores fullname (#10127) 2022-01-23 10:05:06 +02:00
lazyfree.tcl attempt to fix tracking test issue with external tests due to lazy free (#9722) 2021-11-02 16:42:53 +02:00
limits.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
maxmemory.tcl Added INFO LATENCYSTATS section: latency by percentile distribution/latency by cumulative distribution of latencies (#9462) 2022-01-05 14:01:05 +02:00
memefficiency.tcl Add external test that runs without debug command (#9964) 2021-12-19 17:41:51 +02:00
multi.tcl Fix typo in multi test (#10054) 2022-01-05 10:16:04 +02:00
networking.tcl Protected configs and sensitive commands (#9920) 2021-12-19 10:46:16 +02:00
obuf-limits.tcl Added INFO LATENCYSTATS section: latency by percentile distribution/latency by cumulative distribution of latencies (#9462) 2022-01-05 14:01:05 +02:00
oom-score-adj.tcl Don't write oom score adj to proc unless we're managing it. (#9904) 2021-12-07 16:05:51 +02:00
other.tcl Fix crash when error [sub]command name contains | (#10082) 2022-01-09 13:06:51 +02:00
pause.tcl sub-command support for ACL CAT and COMMAND LIST. redisCommand always stores fullname (#10127) 2022-01-23 10:05:06 +02:00
pendingquerybuf.tcl Introduce memory management on cluster link buffers (#9774) 2021-12-16 21:56:59 -08:00
printver.tcl Print version info before running the test 2011-05-20 11:44:54 +02:00
protocol.tcl Tests: add a few missing needs:debug tags. (#9806) 2021-11-18 23:01:56 +02:00
pubsub.tcl Connection leak in external tests. (#9777) 2021-11-15 11:07:43 +02:00
pubsubshard.tcl Sharded pubsub implementation (#8621) 2022-01-02 16:54:47 -08:00
querybuf.tcl Ignore resize threshold on idle qbuf resizing (#9322) 2021-08-06 20:50:34 +03:00
quit.tcl Add tests for OK on QUIT 2010-10-15 12:54:53 +02:00
scan.tcl Replace all usage of ziplist with listpack for t_zset (#9366) 2021-09-09 18:18:53 +03:00
scripting.tcl Correctly handle minimum arity checks in scripts (#10171) 2022-01-24 22:08:57 -08:00
shutdown.tcl Wait for replicas when shutting down (#9872) 2022-01-02 09:50:15 +02:00
slowlog.tcl Redact ACL SETUSER arguments if the user has spaces (#9935) 2021-12-13 08:39:04 -08:00
sort.tcl Add SORT_RO command (#9299) 2021-08-09 09:40:29 +03:00
tls.tcl Add support for reading encrypted keyfiles. (#8644) 2021-03-22 13:27:46 +02:00
tracking.tcl Solve issues with tracking test in external mode (#9726) 2021-11-02 16:07:51 -07:00
violations.tcl Fix possible int overflow when hashing an sds. (#9916) 2021-12-13 21:16:25 +02:00
wait.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00