synapse-product/synapse/util
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
..
caches Remove various bits of compatibility code for Python <3.6 (#9879) 2021-04-27 13:13:07 +01:00
__init__.py Merge pull request from GHSA-x345-32rc-8h85 2021-05-11 11:47:23 +02:00
async_helpers.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
daemonize.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
distributor.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
file_consumer.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
frozenutils.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
hash.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
httpresourcetree.py Replace instance variations of homeserver with correct case/spacing 2019-11-12 13:08:12 +00:00
iterutils.py Remove synapse.types.Collection (#9856) 2021-04-22 16:43:50 +01:00
jsonobject.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
logcontext.py Improve the backwards compatibility re-exports of synapse.logging.context (#5617) 2019-07-05 02:32:02 +10:00
logformatter.py Improve the backwards compatibility re-exports of synapse.logging.context (#5617) 2019-07-05 02:32:02 +10:00
macaroons.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
manhole.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
metrics.py Merge branch 'master' into develop 2021-04-20 14:55:16 +01:00
module_loader.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
msisdn.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
patch_inline_callbacks.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
ratelimitutils.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
retryutils.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
rlimit.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
stringutils.py Sanity check identity server passed to bind/unbind. (#9802) 2021-04-19 17:21:46 +01:00
templates.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
threepids.py Limit length of accepted email addresses (#9855) 2021-04-22 17:49:11 +01:00
versionstring.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
wheel_timer.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00