redict/tests
Itamar Haber c1b1e8c329
Adds pub/sub channel patterns to ACL (#7993)
Fixes #7923.

This PR appropriates the special `&` symbol (because `@` and `*` are taken),
followed by a literal value or pattern for describing the Pub/Sub patterns that
an ACL user can interact with. It is similar to the existing key patterns
mechanism in function (additive) and implementation (copy-pasta). It also adds
the allchannels and resetchannels ACL keywords, naturally.

The default user is given allchannels permissions, whereas new users get
whatever is defined by the acl-pubsub-default configuration directive. For
backward compatibility in 6.2, the default of this directive is allchannels but
this is likely to be changed to resetchannels in the next major version for
stronger default security settings.

Unless allchannels is set for the user, channel access permissions are checked
as follows :
* Calls to both PUBLISH and SUBSCRIBE will fail unless a pattern matching the
  argumentative channel name(s) exists for the user.
* Calls to PSUBSCRIBE will fail unless the pattern(s) provided as an argument
  literally exist(s) in the user's list.

Such failures are logged to the ACL log.

Runtime changes to channel permissions for a user with existing subscribing
clients cause said clients to disconnect unless the new permissions permit the
connections to continue. Note, however, that PSUBSCRIBErs' patterns are matched
literally, so given the change bar:* -> b*, pattern subscribers to bar:* will be
disconnected.

Notes/questions:
* UNSUBSCRIBE, PUNSUBSCRIBE and PUBSUB remain unprotected due to lack of reasons
  for touching them.
2020-12-01 14:21:39 +02:00
..
assets Tests: Add aclfile load and save tests (#7765) 2020-09-09 17:13:35 +03:00
cluster fix invalid 'failover' identifier in cluster slave selection test (#7942) 2020-10-25 10:05:38 +02:00
helpers revert an accidental test code change done as part of the tls project 2019-12-01 16:10:09 +02:00
integration Enable specifying TLS ciphers(suites) in redis-cli/redis-benchmark (#8005) 2020-11-04 14:49:15 +02:00
modules Unified MULTI, LUA, and RM_Call with respect to blocking commands (#8025) 2020-11-17 18:58:55 +02:00
sentinel Recalculate hardcoded variables from $::instances_count in sentinel tests (#7561) 2020-09-13 18:39:59 +03:00
support Extend client tracking tests (#7998) 2020-11-09 22:54:47 +02:00
tmp minor fixes to the new test suite, html doc updated 2010-05-14 18:48:33 +02:00
unit Adds pub/sub channel patterns to ACL (#7993) 2020-12-01 14:21:39 +02:00
instances.tcl Allow blocked XREAD on a cluster replica (#7881) 2020-10-06 21:43:30 +03:00
test_helper.tcl Tests: fix filename reported in run_solo tests. 2020-11-04 21:43:55 +02:00