Travis Ralston
5fdfbce195
Merge remote-tracking branch 'origin/rei/as_device_masquerading_msc3202' into anoa/e2e_as_internal_testing
2021-12-14 12:53:16 -07:00
Olivier Wilkinson (reivilibre)
15cb2f0678
Use get_device
2021-12-13 15:56:24 +00:00
Olivier Wilkinson (reivilibre)
075a2b7a5d
Merge branch 'develop' into rei/as_device_masquerading_msc3202
2021-12-13 15:54:21 +00:00
reivilibre
e5cdb9e233
Make get_device return None if the device doesn't exist rather than raising an exception. ( #11565 )
...
Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com >
2021-12-13 15:39:43 +00:00
Olivier Wilkinson (reivilibre)
405f3f9580
Fix comment
2021-12-13 14:57:00 +00:00
Olivier Wilkinson (reivilibre)
2becd5209d
TEMPORARY Revert "Use get_device (fixing in upstream develop)"
...
This reverts commit 63042ac190 .
2021-12-13 14:48:14 +00:00
Olivier Wilkinson (reivilibre)
63042ac190
Use get_device (fixing in upstream develop)
2021-12-13 14:35:34 +00:00
Eric Eastwood
aa8708ebed
Allow events to be created with no prev_events (MSC2716) ( #11243 )
...
The event still needs to have `auth_events` defined to be valid.
Split out from https://github.com/matrix-org/synapse/pull/11114
2021-12-10 23:08:51 -06:00
Eric Eastwood
8391bd6ab5
Test to ensure we share the same state_group across the whole historical batch (MSC2716) ( #11487 )
...
Part of MSC2716: https://github.com/matrix-org/matrix-doc/pull/2716
We did some work on making sure the `state_groups` were shared in
https://github.com/matrix-org/synapse/pull/10975
2021-12-10 20:59:20 -06:00
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
David Robertson
fd2dadb815
Adjust _get_rooms_changed comments ( #11550 )
...
C.f. https://github.com/matrix-org/synapse/pull/11494#pullrequestreview-827780886
2021-12-10 19:19:48 +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
Richard van der Hoff
f0562183e7
skip some dict munging in event persistence ( #11560 )
...
Create a new dict helper method `simple_insert_many_values_txn`, which takes
raw row values, rather than {key=>value} dicts. This saves us a bunch of dict
munging, and makes it easier to use generators rather than creating
intermediate lists and dicts.
2021-12-10 15:02:33 +00:00
Richard van der Hoff
86e7a6d16e
Stop populating state_events.prev_state ( #11558 )
...
this field is never read, so we may as well stop populating it.
2021-12-10 14:13:23 +00:00
Patrick Cloke
9562f0c2f1
Ensure emails are canonicalized before fetching associated user. ( #11547 )
...
This should fix pushers with an email in non-canonical form is used as
the pushkey.
2021-12-10 07:17:28 -05: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
Patrick Cloke
3b8872299a
Do not allow cross-room relations, per MSC2674. ( #11516 )
2021-12-09 13:16:01 -05: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
Patrick Cloke
0cc3bf97b4
Additional type hints for the config module, part 2. ( #11480 )
2021-12-09 16:15:46 +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
Dirk Klimpel
941ebe49ff
Use HTTPStatus constants in place of literals in synapse.http ( #11543 )
2021-12-09 11:58:25 +00:00
Hubert Chathi
b47d10dc46
Support unprefixed versions of fallback key property names. ( #11541 )
2021-12-09 11:41:27 +00:00
Dirk Klimpel
b3bcacf3c1
Add missing errcode to parse_string and parse_boolean ( #11542 )
2021-12-09 11:23:34 +00:00
Robert Long
afa0a5e4fc
Allow guests to send state events ( #11378 )
2021-12-09 11:02:05 +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