synapse/tests
Richard van der Hoff 03318a766c
Merge pull request from GHSA-x345-32rc-8h85
* tests for push rule pattern matching

* tests for acl pattern matching

* factor out common `re.escape`

* Factor out common re.compile

* Factor out common anchoring code

* add word_boundary support to `glob_to_regex`

* Use `glob_to_regex` in push rule evaluator

NB that this drops support for character classes. I don't think anyone ever
used them.

* Improve efficiency of globs with multiple wildcards

The idea here is that we compress multiple `*` globs into a single `.*`. We
also need to consider `?`, since `*?*` is as hard to implement efficiently as
`**`.

* add assertion on regex pattern

* Fix mypy

* Simplify glob_to_regex

* Inline the glob_to_regex helper function

Signed-off-by: Dan Callahan <danc@element.io>

* Moar comments

Signed-off-by: Dan Callahan <danc@element.io>

Co-authored-by: Dan Callahan <danc@element.io>
2021-05-11 11:47:23 +02:00
..
api Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
app Split presence out of master (#9820) 2021-04-23 12:21:55 +01:00
appservice Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
config Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
crypto Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
events Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
federation Merge pull request from GHSA-x345-32rc-8h85 2021-05-11 11:47:23 +02:00
handlers Fix tight loop handling presence replication. (#9900) 2021-04-28 14:42:50 +01:00
http Improved validation for received requests (#9817) 2021-04-23 19:20:44 +01:00
logging Merge branch 'master' into develop 2021-04-20 14:55:16 +01:00
module_api Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
push Merge pull request from GHSA-x345-32rc-8h85 2021-05-11 11:47:23 +02:00
replication Improved validation for received requests (#9817) 2021-04-23 19:20:44 +01:00
rest Remove various bits of compatibility code for Python <3.6 (#9879) 2021-04-27 13:13:07 +01:00
scripts Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
server_notices Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
state Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
storage Remove various bits of compatibility code for Python <3.6 (#9879) 2021-04-27 13:13:07 +01:00
test_utils Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
util Merge pull request from GHSA-x345-32rc-8h85 2021-05-11 11:47:23 +02:00
__init__.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
server.py Kill off _PushHTTPChannel. (#9878) 2021-04-23 18:40:57 +01:00
test_distributor.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_event_auth.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_federation.py Merge branch 'master' into develop 2021-04-20 14:55:16 +01:00
test_mau.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_metrics.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_phone_home.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_preview.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_server.py Improved validation for received requests (#9817) 2021-04-23 19:20:44 +01:00
test_state.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_terms_auth.py Use mock from the stdlib. (#9772) 2021-04-09 13:44:38 -04:00
test_test_utils.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_types.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_visibility.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
unittest.py Remove various bits of compatibility code for Python <3.6 (#9879) 2021-04-27 13:13:07 +01:00
utils.py Remove room and user invite ratelimits in default unit test config (#9871) 2021-04-23 13:37:48 +01:00