1
0
Fork 0
forked from mirror/grapevine
Commit graph

2609 commits

Author SHA1 Message Date
Lambda
5dccfafe80 Refactor server resolution 2024-09-01 13:57:44 +00:00
Lambda
8b6f8c194e send_request: factor out inner non-generic part
This leads to a 1.6% reduction in binary size.
2024-09-01 13:57:44 +00:00
Lambda
96b0f9ca34 Remove useless re-serialization
There's no reason to construct a serde_json::Value in the first place, a
CanonicalJsonObject is all we ever need.
2024-09-01 13:57:44 +00:00
Lambda
7a7a839862 send_request: factor out signature creation 2024-09-01 13:57:44 +00:00
Lambda
f37e52c99e Move send_request and associated functions to separate module
api::server_server now only contains request handlers.
2024-09-01 13:57:44 +00:00
Lambda
df884ea2f2 send_request: fix error message 2024-09-01 13:42:24 +00:00
Lambda
b4fecbc517 client/media: work around matrix-media-repo bug
It rejects Authenticated Media requests if X-Matrix values aren't
unnecessarily quoted:
https://github.com/t2bot/matrix-media-repo/issues/609
2024-09-01 09:42:45 +00:00
Lambda
3fe0110649 media: convert allow_remote to enum 2024-09-01 09:42:45 +00:00
Lambda
a4b7df1b3a media: use FileMeta instead of tuples 2024-09-01 09:42:45 +00:00
Lambda
1ccb1e572b media: add MediaFileKey wrapper
One more win in the fight against the Vec<u8>s
2024-09-01 09:42:45 +00:00
Lambda
84850a163d Factor content out of FileMeta
That's not what *meta*data means
2024-09-01 09:42:45 +00:00
Lambda
a06c8db996 Fetch and thumbnail original media if fetching thumbnail fails
E.g. because the remote server's thumbnail endpoint is broken in
hilarious ways: https://github.com/element-hq/synapse/issues/17518
2024-09-01 09:42:45 +00:00
Lambda
82aacdc153 Update changelog for Authenticated Media 2024-09-01 09:42:45 +00:00
Lambda
d3b6718812 server_server: implement authenticated media endpoints 2024-09-01 09:42:45 +00:00
Lambda
79053ad052 client_server: use and provide authenticated media API 2024-09-01 09:42:45 +00:00
Lambda
7f6ab63752 client_server: factor out width/height conversion 2024-09-01 09:42:45 +00:00
Lambda
edfaa83405 server_server: make outbound requests using spec v1.11
This is required for authenticated media requests, which are otherwise
performed using the unstable endpoint.
2024-09-01 09:42:45 +00:00
Lambda
94204415ee Add MxcData helper 2024-09-01 09:42:45 +00:00
Lambda
64b3c357dd media: put old API behind legacy_media import 2024-09-01 09:42:45 +00:00
Lambda
5a5bea3217 cargo update ruma httparse
This adds authenticated media APIs.
2024-09-01 09:42:45 +00:00
Stephen D
556f2157a2 add expired keys fix to changelog 2024-08-31 23:25:54 -03:00
Stephen D
926091223d fetch keys that are expired 2024-08-31 23:25:44 -03:00
Stephen D
06fa49ac27 Update changelog to reflect key retrieval logic changes 2024-08-31 23:03:00 -03:00
Stephen D
1b13d7f7ab Fix bug when retrieving keys for an event.
It's possible for a server to have multiple associated public keys. This can happen when a Matrix server is set up on a particular domain, its key is lost, and the server continues running on the domain. Now there will be two keys associated to the domain. The old logic wouldn't fetch the new key if we already had the old key cached. The new logic will fetch any keys we don't have that we need, rather than just fetching one key per server.
2024-08-31 23:02:53 -03:00
Stephen D
2db3b18ce8 Clean up existing code in get_server_keys_from_cache. It's a little DRYer now 2024-08-31 22:25:43 -03:00
Lambda
006ea0eb94 Fix appservice users getting invited over federation
Invites are magic sauce, we need to manually send it off to the
appservice if it's for an appservice user.
2024-08-31 10:18:29 +00:00
Benjamin Lee
4ad50e2708
only log banned users if they are local
This was the intent of f03b6cde29, but it
was missing the check that the user is actually local, and so was
logging *all* banned users.
2024-08-30 23:08:52 -07:00
avdb13
f03b6cde29 feat: report local users getting banned 2024-08-26 02:17:01 +02:00
Lambda
14afa1357e tracing: allow configuring service name
This is essential when consuming tracing data from multiple servers.
2024-08-24 19:31:39 +00:00
Charles Hall
c355e2ad39
ensure we don't use aliases again accidentally 2024-08-19 10:36:32 -07:00
K900
6685f8cd14
remove uses of aliases 2024-08-17 12:31:48 -07:00
Benjamin Lee
3b99032456
add changelog entry for non-IFD nix build support 2024-08-13 12:12:57 -07:00
Benjamin Lee
e9c0b3ef76
disable IFD in CI
We want to know if future changes break builds without IFD.
2024-08-13 12:12:57 -07:00
Benjamin Lee
992e6b945a
remove usage of IFD in nix packages
Lix builders have IFD disabled, and the changes needed to support this
are minimal.

We do need to do slightly more manual work to keep rust-toolchain.toml
in sync with flake.nix, but it's not significant.
2024-08-13 12:12:57 -07:00
avdb13
b45c0afe37 update changelog 2024-08-12 06:18:28 +02:00
avdb13
00b77144c1 chore: deprecate support for unstable room versions 2024-08-12 06:18:28 +02:00
Benjamin Lee
91739899e7
changelog entry for remote device key query logging 2024-08-11 16:39:08 -07:00
Benjamin Lee
141c60e4a3
log more detailed backoff state for remote device key requests 2024-08-11 16:39:08 -07:00
Benjamin Lee
1551833501
log failed remote device key requests 2024-08-11 16:39:08 -07:00
Benjamin Lee
827f670c54
add changelog entries for the account data validation fixes 2024-08-11 15:53:25 -07:00
Benjamin Lee
a32dc1a3ee
tolerate invalid m.direct events when upgrading rooms
Previous behavior was causing us to error out of the entire
state_cache::update_membership function when it saw an invalid m.direct,
making it impossible for affected users to join upgraded rooms. This bug
is especially bad if an affected user attempts to upgrade a room,
because we will fail to create their join event in the new room, leaving
both rooms permanently bricked.

The new behavior should never prevent users from joining a room based on
the contents of their account data, and should migrate the `m.direct`
event in a reasonable way even if it is partially corrupted by the
element bug.

This also fixes a bug where the previous implementation will
unintentionally remove any keys that aren't part of the expected
m.direct schema. I don't know of any cases where this came up in
practice.

Fixes: #46
2024-08-11 15:53:25 -07:00
Benjamin Lee
18360cd3f9
refactor error handling in copy_upgraded_account_data_tag
The new error handling logic is semantically different from the old, but
I don't know of any cases you could hit in practice where it would
matter.
2024-08-11 15:53:24 -07:00
Benjamin Lee
51dd75c3dc
factor account data upgrade logic into functions
The implementation inside each function is unchanged from the original.
I intend to clean up and fix bugs in later commits, so the diff will be
more clear.
2024-08-11 15:53:24 -07:00
Lambda
dd24a44112 Use TokenSet for roomid_mutex_federation 2024-07-22 18:07:03 +00:00
Lambda
4893c54f4f Use TokenSet for roomid_mutex_insert 2024-07-22 18:07:03 +00:00
Lambda
34ccb2cd06 Use TokenSet for roomid_mutex_state 2024-07-22 18:07:03 +00:00
Lambda
07b5233980 Use OnDemandHashMap for servername_ratelimiter
This way, semaphores are actually cleaned up eventually.
2024-07-22 18:07:03 +00:00
Lambda
2c19abc535 Add OnDemandHashMap and TokenSet 2024-07-22 18:07:00 +00:00
Lambda
aea6019c0a upgrade_room_route: fix state lock
This was using the lock for the replacement room to send events to the
original room, which may or may not cause problems.
2024-07-22 18:06:11 +00:00
Lambda
ef1b6fe111 upgrade_room_route: give more descriptive names to locks
This makes the next commit, which is an actual fix, much easier to read.
2024-07-22 18:06:11 +00:00