synapse-old/synapse/push
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
..
__init__.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
action_generator.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
baserules.py Add type hints to the push module. (#8901) 2020-12-11 11:43:53 -05:00
bulk_push_rule_evaluator.py Only store data in caches, not "smart" objects (#9845) 2021-04-23 11:47:07 +01:00
clientformat.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
emailpusher.py Limit length of accepted email addresses (#9855) 2021-04-22 17:49:11 +01:00
httppusher.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
mailer.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
presentable_names.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
push_rule_evaluator.py Merge pull request from GHSA-x345-32rc-8h85 2021-05-11 11:47:23 +02:00
push_tools.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
pusher.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
pusherpool.py Port "Allow users to click account renewal links multiple times without hitting an 'Invalid Token' page #74" from synapse-dinsic (#9832) 2021-04-19 19:16:34 +01:00
rulekinds.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00