Andrew Morgan
27c1abc7b8
Use _check_sigs_and_hash_and_fetch to validate backfill requests ( #8350 )
...
This is a bit of a hack, as `_check_sigs_and_hash_and_fetch` is intended
for attempting to pull an event from the database/(re)pull it from the
server that originally sent the event if checking the signature of the
event fails.
During backfill we *know* that we won't have the event in our database,
however it is still useful to be able to query the original sending
server as the server we're backfilling from may be acting maliciously.
The main benefit and reason for this change however is that
`_check_sigs_and_hash_and_fetch` will drop an event during backfill if
it cannot be successfully validated, whereas the current code will
simply fail the backfill request - resulting in the client's /messages
request silently being dropped.
This is a quick patch to fix backfilling rooms that contain malformed
events. A better implementation in planned in future.
2020-09-18 14:51:11 +01:00
Erik Johnston
c570f24acc
Don't assume that an event has an origin field
...
This fixes #8319 .
2020-09-16 11:56:23 +01:00
Patrick Cloke
c978f6c451
Convert federation client to async/await. ( #7975 )
2020-07-30 08:01:33 -04:00
Patrick Cloke
00e57b755c
Convert synapse.app to async/await. ( #7868 )
2020-07-17 07:08:56 -04:00
Patrick Cloke
38e1fac886
Fix some spelling mistakes / typos. ( #7811 )
2020-07-09 09:52:58 -04:00
Richard van der Hoff
67593b1728
Add HomeServer.signing_key
property ( #7805 )
...
... instead of duplicating `config.signing_key[0]` everywhere
2020-07-08 17:51:56 +01:00
Andrew Morgan
6b22921b19
async/await is_server_admin ( #7363 )
2020-05-01 15:15:36 +01:00
Andrew Morgan
2e8955f4a6
Further improvements to requesting the public rooms list on a homeserver which has it set to private ( #7368 )
2020-05-01 15:15:08 +01:00
Patrick Cloke
c2db6599c8
Fix a bug in the federation API which could cause occasional "Failed to get PDU" errors ( #7089 ).
2020-03-19 08:22:56 -04:00
Patrick Cloke
7581d30e9f
Remove unused federation endpoint (query_auth
) ( #7026 )
2020-03-17 08:04:49 -04:00
Patrick Cloke
12d4259000
Add some type annotations to the federation base & client classes ( #6995 )
2020-02-28 07:31:07 -05:00
Richard van der Hoff
928edef979
Pass room_version into event_from_pdu_json
...
It's called from all over the shop, so this one's a bit messy.
2020-02-06 16:08:27 +00:00
Richard van der Hoff
b0c8bdd49d
pass room version into FederationClient.send_join ( #6854 )
...
... which allows us to sanity-check the create event.
2020-02-06 15:50:39 +00:00
Richard van der Hoff
ee0525b2b2
Simplify room_version
handling in FederationClient.send_invite
2020-02-05 17:43:57 +00:00
Richard van der Hoff
f84700fba8
Pass room version object into FederationClient.get_pdu
2020-02-05 17:25:46 +00:00
Richard van der Hoff
6bbd890f05
make FederationClient._do_send_invite async
2020-02-05 15:50:31 +00:00
Richard van der Hoff
146fec0820
Apply suggestions from code review
...
Co-Authored-By: Erik Johnston <erik@matrix.org>
2020-02-05 15:47:00 +00:00
Richard van der Hoff
ea23210b2d
make FederationClient.send_invite async
2020-02-03 22:29:49 +00:00
Richard van der Hoff
6deeefb68c
make FederationClient.get_missing_events async
2020-02-03 22:28:45 +00:00
Richard van der Hoff
abadf44eb2
make FederationClient._do_send_leave async
2020-02-03 22:28:45 +00:00
Richard van der Hoff
e88b90aaeb
make FederationClient.send_leave.send_request async
2020-02-03 22:28:45 +00:00
Richard van der Hoff
638001116d
make FederationClient._do_send_join async
2020-02-03 22:28:45 +00:00
Richard van der Hoff
3960527c2e
make FederationClient.send_join.send_request async
2020-02-03 22:28:45 +00:00
Richard van der Hoff
ad09ee9262
make FederationClient.make_membership_event.send_request async
2020-02-03 22:28:45 +00:00
Richard van der Hoff
1330c311b7
make FederationClient._try_destination_list async
2020-02-03 22:28:45 +00:00
Richard van der Hoff
a46fabf17b
make FederationClient.send_leave async
2020-02-03 22:28:45 +00:00
Richard van der Hoff
8af9f11bea
make FederationClient.send_join async
2020-02-03 22:28:45 +00:00
Richard van der Hoff
3f11cbb404
make FederationClient.make_membership_event async
2020-02-03 22:28:45 +00:00
Richard van der Hoff
24d814ca23
make FederationClient.get_event_auth async
2020-02-03 22:28:45 +00:00
Richard van der Hoff
d73683c363
make FederationClient.get_room_state_ids async
2020-02-03 22:28:45 +00:00
Richard van der Hoff
0cb0c7bcd5
make FederationClient.get_pdu async
2020-02-03 22:28:45 +00:00
Richard van der Hoff
0536d0c9be
make FederationClient.backfill async
2020-02-03 22:28:45 +00:00
Richard van der Hoff
a5afdd15e5
Merge pull request #6806 from matrix-org/rav/redact_changes/3
...
Pass room_version into add_hashes_and_signatures
2020-01-31 10:57:03 +00:00
Richard van der Hoff
d7bf793cc1
s/get_room_version/get_room_version_id/
...
... to make way for a forthcoming get_room_version which returns a RoomVersion
object.
2020-01-31 10:06:21 +00:00
Richard van der Hoff
54f3f369bd
Pass room_version into create_local_event_from_event_dict
2020-01-30 22:15:50 +00:00
Erik Johnston
8df862e45d
Add rooms.room_version
column ( #6729 )
...
This is so that we don't have to rely on pulling it out from `current_state_events` table.
2020-01-27 14:30:57 +00:00
Brendan Abolivier
54ae52ba96
Merge pull request #6349 from matrix-org/babolivier/msc1802
...
Implement v2 APIs for send_join and send_leave
2019-12-11 11:41:47 +00:00
Richard van der Hoff
f8bc2ae883
Move get_state methods into FederationHandler ( #6503 )
...
This is a non-functional refactor as a precursor to some other work.
2019-12-10 17:42:46 +00:00
Richard van der Hoff
c3dda2874d
Refactor get_events_from_store_or_dest to return a dict ( #6501 )
...
There was a bunch of unnecessary conversion back and forth between dict and
list going on here. We can simplify a bunch of the code.
2019-12-10 16:22:00 +00:00
Richard van der Hoff
e519489fc4
Remove fallback for missing /federation/v1/state_ids API ( #6488 )
...
This API was added way back in 0.17.0; the code here is annoying to maintain
and entirely redundant.
2019-12-09 11:37:26 +00:00
Brendan Abolivier
e126d83f74
Merge branch 'develop' into babolivier/msc1802
2019-12-05 21:00:43 +00:00
Andrew Morgan
bc29a19731
Replace instance variations of homeserver with correct case/spacing
2019-11-12 13:08:12 +00:00
Brendan Abolivier
94cdd6fffe
Lint
2019-11-11 16:56:55 +00:00
Brendan Abolivier
1e202a90f1
Implement v2 API for send_leave
2019-11-11 16:26:53 +00:00
Brendan Abolivier
92527d7b21
Add missing yield
2019-11-11 16:20:53 +00:00
Brendan Abolivier
4c131b2c78
Implement v2 API for send_join
2019-11-11 15:47:47 +00:00
Andrew Morgan
ace947e8da
Depublish a room from the public rooms list when it is upgraded ( #6232 )
2019-11-01 10:28:09 +00:00
Andrew Morgan
54fef094b3
Remove usage of deprecated logger.warn method from codebase ( #6271 )
...
Replace every instance of `logger.warn` with `logger.warning` as the former is deprecated.
2019-10-31 10:23:24 +00:00
Michael Kaye
9eebc1e73b
use %r to __repr__ objects
...
This avoids calculating __repr__ unless we are going to log.
2019-10-24 18:18:56 +01:00
Richard van der Hoff
1ba359a11f
rip out some unreachable code
...
The only possible rejection reason is AUTH_ERROR, so all of this is unreachable.
2019-10-17 21:45:59 +01:00