summary refs log tree commit diff
path: root/tests/push (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Handle empty rooms when generating email notifications. (#9257)Patrick Cloke2021-02-041-2/+49
| | | | | | Fixes some exceptions if the room state isn't quite as expected. If the expected state events aren't found, try to find them in the historical room state. If they still aren't found, fallback to a reasonable, although ugly, value.
* Refactor email summary generation. (#9260)Patrick Cloke2021-02-011-0/+30
| | | | | | * Fixes a case where no summary text was returned. * The use of messages_from_person vs. messages_from_person_and_others was tweaked to depend on whether there was 1 sender or multiple senders, not based on if there was 1 room or multiple rooms.
* Handle missing content keys when calculating presentable names. (#9165)Patrick Cloke2021-01-252-1/+230
| | | | Treat the content as untrusted and do not assume it is of the proper form.
* Convert internal pusher dicts to attrs classes. (#8940)Patrick Cloke2020-12-162-8/+8
| | | This improves type hinting and should use less memory.
* Remove spurious "SynapseRequest" result from `make_request"Richard van der Hoff2020-12-151-1/+1
| | | | This was never used, so let's get rid of it.
* Add additional validation to pusher URLs. (#8865)Patrick Cloke2020-12-041-22/+84
| | | | Pusher URLs now must end in `/_matrix/push/v1/notify` per the specification.
* Apply an IP range blacklist to push and key revocation requests. (#8821)Patrick Cloke2020-12-021-1/+3
| | | | | | | | | | | | Replaces the `federation_ip_range_blacklist` configuration setting with an `ip_range_blacklist` setting with wider scope. It now applies to: * Federation * Identity servers * Push notifications * Checking key validitity for third-party invite events The old `federation_ip_range_blacklist` setting is still honored if present, but with reduced scope (it only applies to federation and identity servers).
* Add a config option to change whether unread push notification counts are ↵Andrew Morgan2020-11-301-2/+161
| | | | | | | | per-message or per-room (#8820) This PR adds a new config option to the `push` section of the homeserver config, `group_unread_count_by_room`. By default Synapse will group push notifications by room (so if you have 1000 unread messages, if they lie in 55 rooms, you'll see an unread count on your phone of 55). However, it is also useful to be able to send out the true count of unread messages if desired. If `group_unread_count_by_room` is set to `false`, then with the above example, one would see an unread count of 1000 (email anyone?).
* Add ability for access tokens to belong to one user but grant access to ↵Erik Johnston2020-10-292-6/+6
| | | | | | | | | | another user. (#8616) We do it this way round so that only the "owner" can delete the access token (i.e. `/logout/all` by the "owner" also deletes that token, but `/logout/all` by the "target user" doesn't). A future PR will add an API for creating such a token. When the target user and authenticated entity are different the `Processed request` log line will be logged with a: `{@admin:server as @bob:server} ...`. I'm not convinced by that format (especially since it adds spaces in there, making it harder to use `cut -d ' '` to chop off the start of log lines). Suggestions welcome.
* Fix email notifications for invites without local state. (#8627)Erik Johnston2020-10-231-0/+29
| | | | This can happen if e.g. the room invited into is no longer on the server (or if all users left the room).
* Include a simple message in email notifications that include encrypted ↵Patrick Cloke2020-10-191-1/+14
| | | | content (#8545)
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-1/+1
|
* Reduce run-times of tests by advancing the reactor less (#7757)Andrew Morgan2020-08-271-1/+1
|
* Don't ignore `set_tweak` actions with no explicit `value`. (#7766)reivilibre2020-07-061-0/+17
| | | | | | | | | | | | | | * Fix spec compliance; tweaks without values are valid (default to True, which is only concretely specified for `highlight`, but it seems only reasonable to generalise) * Changelog for 7766. * Add documentation to `tweaks_for_actions` May as well tidy up when I'm here. * Add a test for `tweaks_for_actions`
* Hack to add push priority to push notifications (#7765)reivilibre2020-07-011-5/+347
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove obsolete comment about ancient temporary code Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net> * Implement hack to set push priority based on whether the tweaks indicate the event might cause effects. * Changelog for 7765 Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net> * Antilint * Add tests for push priority Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net> * Update synapse/push/httppusher.py Co-authored-by: Brendan Abolivier <babolivier@matrix.org> * Antilint * Remove needless invites from tests. Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Ensure the body is a string before comparing push rules. (#7701)Patrick Cloke2020-06-151-9/+30
|
* Do not treat display names as globs for push rules. (#7271)Patrick Cloke2020-04-161-0/+65
|
* Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)Patrick Cloke2020-02-212-7/+7
| | | | Ensure good comprehension hygiene using flake8-comprehensions.
* Clean up startup for the pusher (#6558)Richard van der Hoff2019-12-182-0/+7
| | | | | | | | | | | | | | | | | | | | | | | * Remove redundant python2 support code `str.decode()` doesn't exist on python3, so presumably this code was doing nothing * Filter out pushers with corrupt data When we get a row with unparsable json, drop the row, rather than returning a row with null `data`, which will then cause an explosion later on. * Improve logging when we can't start a pusher Log the ID to help us understand the problem * Make email pusher setup more robust We know we'll have a `data` member, since that comes from the database. What we *don't* know is if that is a dict, and if that has a `brand` member, and if that member is a string.
* Support for routing outbound HTTP requests via a proxy (#6239)Richard van der Hoff2019-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | The `http_proxy` and `HTTPS_PROXY` env vars can be set to a `host[:port]` value which should point to a proxy. The address of the proxy should be excluded from IP blacklists such as the `url_preview_ip_range_blacklist`. The proxy will then be used for * push * url previews * phone-home stats * recaptcha validation * CAS auth validation It will *not* be used for: * Application Services * Identity servers * Outbound federation * In worker configurations, connections from workers to masters Fixes #4198.
* Move logging utilities out of the side drawer of util/ and into logging/ (#5606)Amber Brown2019-07-041-1/+1
|
* Run Black. (#5482)Amber Brown2019-06-201-3/+3
|
* Merge pull request #5388 from matrix-org/erikj/fix_email_pushErik Johnston2019-06-171-23/+70
|\ | | | | Fix email notifications for unnamed rooms with multiple people
| * Add testErik Johnston2019-06-071-1/+28
| |
| * Refactor email testsErik Johnston2019-06-071-22/+42
| |
* | Bump bleach version so that tests can run on old deps.Erik Johnston2019-06-112-12/+0
|/
* Migrate all tests to use the dict-based config format instead of hanging ↵Amber Brown2019-05-132-17/+21
| | | | items off HomeserverConfig (#5171)
* Add admin api for sending server_notices (#5121)Richard van der Hoff2019-05-022-2/+2
|
* Move admin api impl to its own packageRichard van der Hoff2019-05-012-4/+6
| | | | It doesn't really belong under rest/client/v1 any more.
* Fix email testRichard van der Hoff2019-03-191-0/+2
| | | | | | | The Mailer expects the config object to have `email_smtp_pass` and `email_riot_base_url` attributes (and it won't by default, because the default config impl doesn't set any of the attributes unless email_enable_notifs is set).
* Fix logcontext leak in http pusher testRichard van der Hoff2018-11-191-1/+2
|
* Add some tests for the HTTP pusher (#4149)Amber Brown2018-11-061-0/+159
|
* Write some tests for the email pusher (#4095)Amber Brown2018-10-302-0/+148