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
Jonas Platte
4547da0b7b
Fix CI by changing where deprecations are added and allowed
2024-09-07 14:31:24 +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
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
e658b8b128
Remove 'www.' from ruma.io URLs
2023-10-12 15:44:00 +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
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
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
b859d9c8b0
common: Derive Debug via StringEnum derive
2023-01-13 13:49:59 +01:00
Kévin Commaille
9b239663fb
federation-api: Add support for partial state in send_join
...
According to MSC3706
2023-01-10 11:11:45 +01:00
Kévin Commaille
4d40623ae4
federation-api: Remove mentions of keyId in the keys query endpoints
...
According to MSC3938
2023-01-03 12:41:33 +01:00
Kévin Commaille
b5b74f948e
federation-api: Add support to get an event by timestamp
...
According to MSC3030
2023-01-03 11:24:47 +01:00
Jonas Platte
3211fccab0
Remove borrowing in requests
2022-11-28 14:02:35 +01:00
Jonas Platte
ae3394a6df
api: Turn metadata name and description fields into docstrings
2022-11-12 10:17:24 +01:00
Jonas Platte
80c060cb69
Remove usage of ruma_api!
2022-11-12 10:17:24 +01:00
Kévin Commaille
045861441a
doc: Update Matrix spec links to v1.4
2022-10-21 10:41:20 +02:00
Kévin Commaille
7ab6e3ed02
federation-api: Add the event field to RoomState
...
According to MSC3083
2022-10-19 12:17:41 +02:00
Timo Kösters
fba6f70c2d
federation-api: Remove serde aliases for blurhashes
2022-10-12 16:52:26 +02:00
Jonas Platte
1291929131
Rename unstable-pre-spec to unstable-unspecified
2022-09-20 10:39:20 +02:00
Jonas Platte
2b4ac40981
Skip serializing None value for room_type fields
2022-08-17 20:45:05 +02:00
Kévin Commaille
e0bbf16c3c
federation-api: Remove obsolete comment
2022-07-28 18:27:14 +02:00
Kévin Commaille
2e4e8d82ce
federation-api: Make some test assertions more helpful
2022-06-14 10:01:49 +02:00
Kévin Commaille
f1079c94ee
federation-api: Split some test assertions
2022-06-07 15:30:49 +02:00
Jonas Platte
a8e7c47bbe
Remove RoomName type
2022-06-03 11:40:33 +02:00
Jonas Platte
d24cbb981a
Add another missing semicolon
2022-06-03 08:48:28 +02:00
Kévin Commaille
0c67c6b3db
docs: Reword docs for StringEnum
2022-05-30 17:17:06 +02:00
Kévin Commaille
240c8bc4b8
macros: Derive as_str()
for types that derive StringEnum
2022-05-30 17:17:06 +02:00
Kévin Commaille
7f164b3173
doc: Add doc link to as_str
implementations
2022-05-30 17:17:06 +02:00
Kévin Commaille
c11dfb6b10
federation-api: Fix link to old matrix-doc repo
2022-05-29 10:06:15 +02:00
Jonas Platte
b34bfaf1f6
Replace matches crate with assert_matches
2022-05-24 18:07:29 +02:00