1
0
Commit Graph

19933 Commits

Author SHA1 Message Date
Andrew Morgan 30469893aa Merge branch 'rei/as_device_masquerading_msc3202' of github.com:matrix-org/synapse into anoa/e2e_as_internal_testing 2021-12-10 20:08:38 +00:00
Andrew Morgan e580ca07b8 store argument is no longer optional in is_interested_in_room 2021-12-10 15:50:51 +00:00
Andrew Morgan e1bc41b5c3 Squash into and use everywhere 2021-12-10 15:39:40 +00:00
Andrew Morgan b541ec58f2 Update reset device list mock before starting tests 2021-12-10 15:39:12 +00:00
Andrew Morgan 137103a18a Squash into "and use everywhere" 2021-12-10 15:04:30 +00:00
Andrew Morgan b570af047b Squash into "and use everywhere" 2021-12-10 12:10:56 +00:00
Andrew Morgan 2a0eabbee3 squash into 'and use everywhere' 2021-12-09 18:41:19 +00:00
Andrew Morgan 34eacf7f2d squash into move DeviceLists commit 2021-12-09 18:39:02 +00:00
Andrew Morgan b4336fc9e0 squash into 'and use everywhere' 2021-12-09 18:37:50 +00:00
Andrew Morgan ba5f501b4b Support sending device lists everywhere; needs cleaning up 2021-12-09 18:36:55 +00:00
Andrew Morgan 8e8ba360c9 Squash into "and use everywhere" 2021-12-09 18:36:31 +00:00
Andrew Morgan 842c2994f5 fix tests for device lists 2021-12-09 18:35:59 +00:00
Andrew Morgan feeecea603 Create ApplicationService.is_interested_in_user, and use everywhere 2021-12-09 18:27:59 +00:00
Andrew Morgan 0f9a425797 Switch DeviceLists to containing Sets, as we'll need a type that we can delete items from 2021-12-09 17:53:39 +00:00
Olivier Wilkinson (reivilibre) 11e2192b32 Update tests to enable experimental features 2021-12-09 13:13:32 +00:00
Olivier Wilkinson (reivilibre) ae968eaa93 Add an experimental flag to control device masquerading 2021-12-09 13:10:18 +00:00
Olivier Wilkinson (reivilibre) 7e398067f1 Add a pair of tests for the ?device_id parameter for AS device masquerading 2021-12-09 12:48:36 +00:00
Olivier Wilkinson (reivilibre) cc2bbcd4dc Switch to the 400 M_EXCLUSIVE error code for non-existent device IDs
This is as a result of a discussion on the MSC
2021-12-09 12:29:08 +00:00
Andrew Morgan f1f88172d8 Move DeviceLists type to synapse.types
Such that we can use it elsewhere.
2021-12-08 18:36:17 +00:00
Andrew Morgan c7ad734b56 Fix up database method to grab device list changes - bit dirty 2021-12-08 18:30:52 +00:00
Andrew Morgan b399104827 Add device_list as one of the supported streams set_type 2021-12-08 18:30:52 +00:00
Andrew Morgan cf7e65968f wip: get device lists working squashme 2021-12-08 18:30:52 +00:00
Andrew Morgan 3ba63398af migration delta to track device_list stream id per appservice 2021-12-08 18:30:52 +00:00
Andrew Morgan 967755d574 Fix calling is_interested_in_event with store. 2021-12-08 18:30:52 +00:00
Andrew Morgan a48f817642 wip: get device lists working
still need a way to put them in the top-level of the transaction json
2021-12-08 18:30:52 +00:00
Andrew Morgan 6daab0f935 is_interested_in_room public 2021-12-08 18:30:52 +00:00
Andrew Morgan b80db21c19 Add some caching to interest methods
This also fixes (I believe) is_interested_in_presence, the cache of which was
never invalidated.

Note that namespaces can only be changed via a server restart. Users
leaving and joining rooms do change on the fly though.
2021-12-08 18:30:52 +00:00
Andrew Morgan a58d3bdd5e Refactor appservice interest-checking methods
This commit refactors the methods of an application service which can
be used to determine whether an appservice is interested in a given
user, event or room. We now have the following list of functions:

is_user_in_namespace
is_room_alias_in_namespace
is_room_id_in_namespace

is_interested_in_event
is_interested_in_room

Which is clearer than before. There is no `is_interested_in_user`, as
it would be equivalent to is_user_in_namespace.
2021-12-08 18:30:52 +00:00
Andrew Morgan 6517bd15ac Clean up reference to homeserver store 2021-12-08 18:30:52 +00:00
Andrew Morgan be13f6d798 rename ApplicationService.is_interested_in_room_id -> is_room_id_in_namespace 2021-12-08 18:30:52 +00:00
Andrew Morgan 05d0ed8151 rename ApplicationService.is_interested_in_alias -> is_room_alias_in_namespace 2021-12-08 18:30:52 +00:00
Andrew Morgan a193804162 rename ApplicationService.is_interested_in_user -> is_user_in_namespace 2021-12-08 18:30:52 +00:00
Andrew Morgan d7dc699f0a rename ApplicationServices.is_interested -> is_interested_in_event 2021-12-08 18:30:52 +00:00
Andrew Morgan bf40bfe37f wip 2021-12-08 18:30:51 +00:00
Andrew Morgan 3edcf4430f Add docstring to add_device_change_to_streams and fix types. 2021-12-08 18:28:59 +00:00
Andrew Morgan 2d514a695e possible perf boost to calculating device list update recipients 2021-12-08 18:28:59 +00:00
Andrew Morgan 3090000857 Add an experimental config option for sending device lists to AS's 2021-12-08 18:28:59 +00:00
Olivier Wilkinson (reivilibre) 8a078ce372 Newsfile
Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
2021-12-08 15:59:53 +00:00
Olivier Wilkinson (reivilibre) d3b0be57f9 Allow masquerading as a device by specifying the device_id URI parameter 2021-12-08 15:12:32 +00:00
Olivier Wilkinson (reivilibre) 86ef692d5a Add get_device_opt which returns None instead of raising if it doesn't exist 2021-12-08 15:11:31 +00:00
Olivier Wilkinson (reivilibre) 9551a3ed67 Remove early return because we need more logic here 2021-12-08 15:01:12 +00:00
Olivier Wilkinson (reivilibre) 7ea5022be8 Remove superfluous lines 2021-12-08 15:00:13 +00:00
Olivier Wilkinson (reivilibre) be8814fcaa Expand get_user_by_req to support handling a device ID 2021-12-08 14:58:14 +00:00
Olivier Wilkinson (reivilibre) a39ccfc769 Expand return type of get_appservice_user_id to allow returning a device ID to masquerade as 2021-12-08 14:57:37 +00:00
Richard van der Hoff ff7cc17b57 Improve log messages for stream ids (#11536)
Somehow I'd managed to get my database in a pickle with stream ids. These
changes were useful to debug.
2021-12-08 14:15:14 +00:00
Hubert Chathi 8541809cb9 Send and handle cross-signing messages using the stable prefix. (#10520) 2021-12-08 10:01:38 +00:00
Andrew Morgan d6fb96e056 Fix case in wait_for_background_updates where self.store does not exist (#11331)
Pull the DataStore from the HomeServer instance, which
always exists.
2021-12-07 11:51:53 -05:00
Sean Quah 26b5d2320f Sort internal changes in changelog v1.49.0rc1 2021-12-07 14:46:37 +00:00
Sean Quah bce4220f38 Update CHANGES.md 2021-12-07 14:41:06 +00:00
Sean Quah 966b5d0fa0 1.49.0rc1 2021-12-07 13:56:09 +00:00