summary refs log tree commit diff
path: root/synapse/appservice/__init__.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Return immutable objects for cachedList decorators (#16350)Patrick Cloke2023-09-191-3/+3
|
* Consolidate logic to check for deactivated users. (#15634)Patrick Cloke2023-05-231-1/+2
| | | | | | | This moves the deactivated user check to the method which all login types call. Additionally updates the application service tests to be more realistic by removing invalid tests and fixing server names.
* Type hints for tests.appservice (#14990)David Robertson2023-02-061-2/+2
| | | | | | | | | | | | | | | | | | | | * Accept a Sequence of events in synapse.appservice This avoids some casts/ignores in the tests I'm about to fixup. It seems that `List[Mock]` is not a subtype of `List[EventBase]`, but `Sequence[Mock]` is a subtype of `Sequence[EventBase]`. So presumably `Mock` is considered a subtype of anything, much like `Any`. * make tests.appservice.test_scheduler pass mypy * Extra hints in tests.appservice.test_scheduler * Extra hints in tests.appservice.test_api * Extra hints in tests.appservice.test_appservice * Disallow untyped defs * Changelog
* Fix missing cache invalidation in application service code (#14670)Sean Quah2022-12-121-2/+6
| | | | | | | | | | | | #11915 introduced the `@cached` `is_interested_in_room` method in Synapse 1.55.0, which depends upon `get_aliases_for_room`. Add a missing cache invalidation callback so that the `is_interested_in_room` cache is invalidated when `get_aliases_for_room` is invalidated. #13787 made `get_rooms_for_user` `@cached`. Add a missing cache invalidation callback so that the `is_interested_in_presence` cache is invalidated when `get_rooms_for_user` is invalidated. Signed-off-by: Sean Quah <seanq@matrix.org>
* Use `device_one_time_keys_count` to match MSC3202 (#14565)Andrew Ferrazzutti2022-11-281-5/+5
| | | | | | | | | | | | | | | | | | | * Use `device_one_time_keys_count` to match MSC3202 Rename the `device_one_time_key_counts` key in responses to `device_one_time_keys_count` to match the name specified by MSC3202. Also change related variable/class names for consistency. Signed-off-by: Andrew Ferrazzutti <andrewf@element.io> * Update changelog.d/14565.misc * Revert name change for `one_time_key_counts` key as this is a different key altogether from `device_one_time_keys_count`, which is used for `/sync` instead of appservice transactions. Signed-off-by: Andrew Ferrazzutti <andrewf@element.io>
* Check appservice user interest against the local users instead of all users ↵Eric Eastwood2022-10-271-2/+14
| | | | (`get_users_in_room` mis-use) (#13958)
* Remove remaining bits of groups code. (#12936)Patrick Cloke2022-06-011-2/+0
| | | | | | * Update worker docs to remove group endpoints. * Removes an unused parameter to `ApplicationService`. * Break dependency between media repo and groups. * Avoid copying `m.room.related_groups` state events during room upgrades.
* Remove backing code for groups/communities (#12558)Patrick Cloke2022-05-261-41/+2
| | | | Including handlers, configuration code, appservice support, and the GroupID construct.
* MSC3202: Fix device_unused_fallback_keys -> device_unused_fallback_key_types ↵Will Hunt2022-04-221-1/+1
| | | | | | | (#12520) * Fix device_unused_fallback_keys -> device_unused_fallback_key_types * changelog
* Send device list updates to application services (MSC3202) - part 1 (#11881)Andrew Morgan2022-03-301-1/+11
| | | Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Rename various ApplicationServices interested methods (#11915)Andrew Morgan2022-03-031-42/+91
|
* Add support for MSC3202: sending one-time key counts and fallback key usage ↵reivilibre2022-02-241-0/+16
| | | | | states to Application Services. (#11617) Co-authored-by: Erik Johnston <erik@matrix.org>
* Remove optional state of `ApplicationService.is_interested`'s `store` ↵Andrew Morgan2022-02-071-18/+5
| | | | parameter (#11911)
* Send to-device messages to application services (#11215)Andrew Morgan2022-02-011-0/+3
| | | Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Add missing type hints to `synapse.appservice` (#11360)Patrick Cloke2021-12-141-40/+61
|
* Add type annotations to `tests.storage.test_appservice`. (#11488)reivilibre2021-12-021-1/+2
|
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-1/+4
| | | | | | | - Update black version to the latest - Run black auto formatting over the codebase - Run autoformatting according to [`docs/code_style.md `](https://github.com/matrix-org/synapse/blob/80d6dc9783aa80886a133756028984dbf8920168/docs/code_style.md) - Update `code_style.md` docs around installing black to use the correct version
* Tie together matches_user_in_member_list and get_users_in_room caches (#8676)Will Hunt2020-10-291-4/+6
| | | | | | | | | | | | | * Tie together matches_user_in_member_list and get_users_in_room * changelog * Remove type to fix mypy * Add `on_invalidate` to the function signature in the hopes that may make things work well * Remove **kwargs * Update 8676.bugfix
* Add ability for access tokens to belong to one user but grant access to ↵Erik Johnston2020-10-291-2/+2
| | | | | | | | | | 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.
* Send some ephemeral events to appservices (#8437)Will Hunt2020-10-151-62/+118
| | | Optionally sends typing, presence, and read receipt information to appservices.
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-3/+3
|
* Convert additional database code to async/await. (#8195)Patrick Cloke2020-08-281-8/+11
|
* Convert appservice to async. (#7973)Patrick Cloke2020-07-301-18/+13
|
* Replace all remaining six usage with native Python 3 equivalents (#7704)Dagfinn Ilmari Mannsåker2020-06-161-3/+1
|
* Fix a couple of small typosAndrew Morgan2020-05-151-1/+1
|
* rstrip slashes from url on appservice (#6306)Will Hunt2019-10-311-1/+3
|
* Replace returnValue with return (#5736)Amber Brown2019-07-231-14/+14
|
* Run Black. (#5482)Amber Brown2019-06-201-18/+21
|
* run isortAmber Brown2018-07-091-6/+6
|
* add ip_range_whitelist parameter to limit where ASes can connect fromMatthew Hodgson2018-06-281-1/+3
|
* also redact __str__ of ApplicationService used for loggingMichael Telatynski2018-06-061-1/+5
|
* Replace some type checks with six type checksAdrian Tschira2018-04-071-1/+3
| | | | Signed-off-by: Adrian Tschira <nota@notafile.com>
* Extract group_id from the dict for multiple useLuke Barnard2017-11-161-4/+5
|
* Remove unused GROUP_ID_REGEXLuke Barnard2017-11-161-2/+0
|
* Document get_groups_for_userLuke Barnard2017-11-161-0/+6
|
* Flake8Luke Barnard2017-11-161-1/+1
|
* Use a generator instead of a listLuke Barnard2017-11-161-2/+2
|
* Check group_id belongs to this domainLuke Barnard2017-11-161-3/+11
|
* Add automagical AS Publicised Group(s)Luke Barnard2017-11-161-0/+22
| | | | | | | | | | | | | | | | via registration file "users" namespace: ```YAML ... namespaces: users: - exclusive: true regex: '.*luke.*' group_id: '+all_the_lukes:hsdomain' ... ``` This is part of giving App Services their own groups for matching users. With this, ghost users will be given the appeareance that they are in a group and that they have publicised the fact, but _only_ from the perspective of the `get_publicised_groups_for_user` API.
* Make get_if_app_services_interested_in_user fasterErik Johnston2017-05-181-0/+10
|
* Add commentErik Johnston2017-03-291-1/+1
|
* Cache whether an AS is interested based on membersErik Johnston2017-03-281-1/+9
|
* Remove param and cast at call siteErik Johnston2017-03-281-8/+6
|
* Compile the regex's used in ASesErik Johnston2017-03-281-9/+5
|
* Add new API appservice specific public room listErik Johnston2016-12-061-0/+3
|
* Allow Configurable Rate Limiting Per ASLuke Barnard2016-10-181-1/+6
| | | | This adds a flag loaded from the registration file of an AS that will determine whether or not its users are rate limited (by ratelimit in _base.py). Needed for IRC bridge reasons - see https://github.com/matrix-org/matrix-appservice-irc/issues/240.
* Initial hack at the 3PN protocols metadata lookup APIPaul "LeoNerd" Evans2016-08-241-0/+2
|
* Filter 3PU lookups by only ASes that declare knowledge of that protocolPaul "LeoNerd" Evans2016-08-181-1/+8
|
* Make notify_interested_services fasterErik Johnston2016-08-171-39/+42
|
* copyrightsMatthew Hodgson2016-01-071-1/+1
|
* Make the appservice use 'users_in_room' rather than get_room_members since ↵Mark Haines2015-05-221-3/+3
| | | | it is cached
* Fix more AS sender ID thinkos.Kegan Dougal2015-04-011-1/+4
| | | | | | Specifically, the ASes own user ID wasn't being treated as 'exclusive' so a human could nab it. Also, the HS would needlessly send user queries to the AS for its own user ID.
* Merge branch 'develop' into application-services-registration-scriptKegan Dougal2015-04-011-1/+4
|\
| * Fix thinko whereby events *for the AS specifically* were not passed on.Kegan Dougal2015-03-311-1/+4
| | | | | | | | | | This was caused by not explicitly checking the service.sender field. This has now been fixed and a regression test has been added.
* | Fix tests and missing returns on deferreds.Kegan Dougal2015-03-311-1/+1
|/
* Assign the AS ID from the database; replace old placeholder txn id.Kegan Dougal2015-03-061-2/+2
|
* Finish synapse.appservice.scheduler implementation.Kegan Dougal2015-03-061-0/+39
| | | | | With tests to assert behaviour. Not hooked up yet. Stub datastore methods not implemented yet.
* Flesh out more stub functions.Kegan Dougal2015-03-061-0/+5
|
* Add functions to return whether an AS has exclusively claimed a matching ↵Kegan Dougal2015-02-271-3/+20
| | | | namespace.
* Convert expected format for AS regex to include exclusivity.Kegan Dougal2015-02-271-7/+19
| | | | | Previously you just specified the regex as a string, now it expects a JSON object with a 'regex' key and an 'exclusive' boolean, as per spec.
* Notify ASes for events sent by other users in a room which an AS user is a ↵Kegan Dougal2015-02-111-4/+13
| | | | part of.
* Register a user account for the AS when the AS registers. Add 'sender' ↵Kegan Dougal2015-02-091-1/+2
| | | | column to AS table.
* Fix user query checks. HS>AS pushing now works.Kegan Dougal2015-02-051-8/+13
|
* Glue AS work to general event notifications. Add more exception handling ↵Kegan Dougal2015-02-051-1/+1
| | | | when poking ASes.
* Add hs_token column and generate a different token f.e application service.Kegan Dougal2015-02-051-2/+4
|
* Begin to add unit tests for appservice glue and regex testing.Kegan Dougal2015-02-041-2/+12
|
* Add stub ApplicationServiceApi and glue it with the handler.Kegan Dougal2015-02-041-1/+2
|
* Add appservice package and move ApplicationService into it.Kegan Dougal2015-02-031-0/+119