232 Commits

Author SHA1 Message Date
Kévin Commaille
807b278dab federation-api: Use Signatures in more places 2024-11-08 13:13:40 -05:00
Kévin Commaille
09ff0b2819 identifiers: Differentiate one-time and fallback keys from device keys
Move the `DeviceKeyAlgorithm::SignedCurve25519` into the new
`OneTimeKeyAlgorithm` type.
Add `(Owned)OneTimeKeyId` and `(Owned)OneTimeKeyName` instead of using
`(Owned)DeviceKeyId`.
2024-11-08 13:02:19 -05:00
strawberry
9f6c48eea2
add MSC2815 support, query param and error codes
https://github.com/matrix-org/matrix-spec-proposals/pull/2815

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-10-19 18:30:44 -04:00
Kévin Commaille
5627c5109e federation-api: Remove KeyObject
It is unused and is actually supposed to be the same type
as `ruma_common::encryption::SignedKey`.
2024-10-19 14:59:22 -04:00
strawberry
ade2f1daf0 Merge remote-tracking branch 'upstream/main' into conduwuit-changes 2024-09-28 17:09:18 -04:00
Kévin Commaille
b7059ddd18 federation-api: Allow old_verify_keys to be missing when deserializing ServerSigningKeys 2024-09-28 21:21:42 +02:00
Jason Volk
1d0b06b581 fix tests for ContentDisposition macro support
Signed-off-by: Jason Volk <jason@zemos.net>
2024-09-24 19:21:09 +00:00
strawberry
9900d06765 Merge remote-tracking branch 'upstream/main' into conduwuit-changes 2024-09-17 17:55:49 -04:00
Benjamin Lee
61f5150358
federation-api: allow multipart body without preceding CRLF on first boundary
RFC 2046[1] is somewhat ambiguous on whether or not it's valid to omit the
preceding CRLF for the first boundary. The prose on page 19 suggests
that it is not:

> The boundary delimiter MUST occur at the beginning of a line, i.e.,
> following a CRLF, and the initial CRLF is considered to be attached
> to the boundary delimiter line rather than part of the preceding
> part. The boundary may be followed by zero or more characters of
> linear whitespace. It is then terminated by either another CRLF and
> the header fields for the next part, or by two CRLFs, in which case
> there are no header fields for the next part. If no Content-Type
> field is present it is assumed to be "message/rfc822" in a
> "multipart/digest" and "text/plain" otherwise.
>
> NOTE: The CRLF preceding the boundary delimiter line is conceptually
> attached to the boundary so that it is possible to have a part that
> does not end with a CRLF (line break). Body parts that must be
> considered to end with line breaks, therefore, must have two CRLFs
> preceding the boundary delimiter line, the first of which is part of
> the preceding body part, and the second of which is part of the
> encapsulation boundary.

But the BNF on page 22 suggests that it is, as long as there is no
preamble:

> dash-boundary := "--" boundary
>                  ; boundary taken from the value of
>                  ; boundary parameter of the
>                  ; Content-Type field.
>
> multipart-body := [preamble CRLF]
>                   dash-boundary transport-padding CRLF
>                   body-part *encapsulation
>                   close-delimiter transport-padding
>                   [CRLF epilogue]

Dendrite currently generates multipart responses without a preceding CRLF
for the first boundary[2], which were rejected by the previous ruma
parsing logic.

[1]: https://datatracker.ietf.org/doc/html/rfc2046
[2]: https://github.com/matrix-org/dendrite/issues/3414
2024-09-17 10:45:04 +02:00
strawberry
b6f82a72b6 Merge remote-tracking branch 'upstream/main' into conduwuit-changes 2024-09-13 16:35:24 -04:00
Jonas Platte
1a138ed6c9 Use workspace lint configuration instead of rustflags hack 2024-09-11 07:13:32 +00:00
Jonas Platte
7051892077 Move integration tests one directory level deeper
… and rename from tests to it (integration tests).
This allows enabling the mod_module_files lint everywhere again.
2024-09-11 07:13:32 +00:00
strawberry
f621b318c5 support generic KV pairs of MSC4133
still GET/PUT/DELETE for now

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-09-09 22:40:32 -04:00
strawberry
11155e576a Merge remote-tracking branch 'upstream/main' into conduwuit-changes 2024-09-07 12:20:19 -04:00
Jonas Platte
4547da0b7b Fix CI by changing where deprecations are added and allowed 2024-09-07 14:31:24 +00:00
strawberry
0aa4cc4f9c add MSC4175 tz field to federation profile
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-09-06 23:19:16 -04:00
Jason Volk
89cee2d2d9 add missing Cow header in federation authenticated media
Signed-off-by: Jason Volk <jason@zemos.net>
2024-08-27 02:38:30 +00:00
Kévin Commaille
e815eb7603 federation-api: Add support for authenticated media endpoints
According to MSC3916 / Matrix 1.11.
2024-07-16 15:02:45 +02:00
Kévin Commaille
968c52b117 api: Rename request macro attribute query_map to query_all
Remove its IntoIterator bound to allow to represent
the query fields as a single struct or enum.
2024-06-21 19:15:59 +02:00
Jonas Platte
d91e6d7e63
Simplify docsrs feature usage
- Don't instruct docs.rs to set it, it does so by default now:
  https://github.com/rust-lang/docs.rs/pull/2390
- Because of that, check-cfg also recognizes it and does not need
  extra configuration either.
2024-05-30 10:35:07 +02:00
Kévin Commaille
699053d629
Release ruma-federation-api 0.9.0 2024-05-09 12:55:58 +02:00
Matthias Ahouansou
becc4ac0b3 federation-api: add unstable support for MSC3843 2024-04-17 14:51:23 +02:00
Matthias Ahouansou
f01f00a90a federation-api: add unstable support for MSC4125 2024-04-10 16:30:06 +02:00
Matthias Ahouansou
3501c2bc34
federation-api: Make /v1/send_join use RawValue for body rather than using query parameters 2024-04-07 15:45:52 +02:00
Jonas Platte
4a02b97aa3
Update website URL 2024-04-04 13:20:58 +02:00
Matthias Ahouansou
f1a8497ecb federation-api: Implement From<SpaceHierarchyParentSummary> for SpaceHierarchyChildSummary 2024-02-16 11:21:29 +01:00
Jonas Platte
db06702a0f
ci: Upgrade nightly toolchain 2023-11-08 18:03:26 +01:00
Jonas Platte
e658b8b128
Remove 'www.' from ruma.io URLs 2023-10-12 15:44:00 +02:00
Jonas Platte
25d865ca27
Release ruma-federation-api 0.8.0 2023-10-05 17:14:58 +02:00
Jonas Platte
ed03c0d2fa federation-api: Simplify pdu_process_response::serialize 2023-08-28 19:31:39 +02:00
Jonas Platte
31331f3165
Bring back ruma-events
Co-authored-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-08-28 10:23:54 +02:00
Jonas Platte
73b6113819
Rename test modules to tests
… for consistency.
2023-08-24 10:36:30 +02:00
Jonas Platte
88cc7600b4
Remove wildcard import in test module 2023-08-24 10:03:00 +02:00
Jonas Platte
3dac70ead9
Remove most unreachable visibility modifiers 2023-07-19 14:32:14 +02:00
Kévin Commaille
77d94caf11 chore: Use workspace-defined MSRV 2023-07-04 15:40:37 +02:00
Kévin Commaille
52aa539cf0 federation-api: Use SpaceRoomJoinRule for SpaceHierarchy(Parent/Child)Summary(Init) 2023-07-04 12:38:45 +02:00
Jonas Platte
c5782ab8aa
Use new owned ID macros throught the codebase 2023-06-20 11:47:50 +02:00
Jonas Platte
ba5bf8cfce
Replace assert_matches by assert_matches2 2023-06-08 11:37:11 +02:00
Kévin Commaille
631c4e6733 federation-api: Move create_join_event::v1 test as integration test
Otherwise cargo check always complains that we are using
a deprecated const.
See https://github.com/rust-lang/rust/issues/47238
2023-05-25 16:53:56 +02:00
Kévin Commaille
9dd55ae3bc federation-api: Deprecate v1/send_join and v1/send_leave
According to a spec clarification
2023-05-25 16:53:56 +02:00
Jonas Platte
4c85fe9c78
Replace compat feature with more fine-grained compat-* features
… and document them.
2023-04-20 14:00:27 +02:00
Kévin Commaille
2874d12bc7
Release ruma-federation-api 0.7.1 2023-02-15 13:01:09 +01:00
Kévin Commaille
fa06f2f839 federation-api: Move support for partial state in send_join out of unstable-msc3706
According to Matrix v1.6
2023-02-14 22:18:05 +01:00
Kévin Commaille
1f83b19653 federation-api: Move get_event_by_timestamp out of unstable-msc3030
According to Matrix 1.6
2023-02-14 22:05:37 +01:00
Kévin Commaille
ea0ad0cbbf federation-api: Fix changed spec links 2023-02-14 18:44:04 +01:00
Kévin Commaille
f159776f52 chore: Make all applicable spec links use the latest spec instead of a specific version 2023-02-12 12:39:24 +01:00
Kévin Commaille
5344521105 federation-api: Note that create_join_event v2 should include heroes for nameless rooms
According to MSC3943
2023-02-10 11:54:21 +01:00
Kévin Commaille
e58b9fcd92 tests: Remove unnecessary borrows 2023-02-06 19:11:06 +01:00
Jonas Platte
19006cd047
Clean up code blocks in doc strings 2023-02-01 16:58:47 +01:00
Jonas Platte
cbb7d8ca1c
Release ruma-federation-api 0.7.0 2023-02-01 14:04:33 +01:00