89 Commits

Author SHA1 Message Date
Jason Volk
ac37db212a fix lints
Signed-off-by: Jason Volk <jason@zemos.net>
2025-01-01 22:20:39 +00:00
Jason Volk
30a08ff7be various identifiers macro optimizations
Signed-off-by: Jason Volk <jason@zemos.net>
2024-12-28 23:43:56 +00:00
Jason Volk
54da128bbe refactor owned identifiers using SmallVec 2024-12-28 01:06:09 +00:00
Kévin Commaille
13a546056e chore: Remove unnecessary lifetimes 2024-11-29 17:45:04 -05:00
Andy Balaam
67ffedabbf identifiers: Tweak doc tests to use fewer imports 2024-11-08 13:14:51 -05:00
Andy Balaam
8581f30075 identifiers: Fix compile errors in doctests 2024-11-08 13:14:46 -05:00
Andy Balaam
12f4a56ace identifiers: Remove 'rust' from code blocks 2024-11-08 13:14:40 -05:00
Andy Balaam
c471070933 identifiers: Improve doctest layout and use type aliases 2024-11-08 13:14:36 -05:00
Andy Balaam
9ff70228d8 identifiers: Add doc tests for algorithm and key_name 2024-11-08 13:14:33 -05:00
Andy Balaam
a765bcdd1a identifiers: Documentation for the KeyId struct 2024-11-08 13:14:30 -05:00
Andy Balaam
5db68816a9 identifiers: Make KeyId::key_name take the string after the colon, not before 2024-11-08 13:14:20 -05:00
Kévin Commaille
0d1d549cf6 encryption: Use Signatures for the key types 2024-11-08 13:13:29 -05:00
Kévin Commaille
eb57bb2797 identifiers: Fix the bounds for Clone, Serialize and Deserialize on Signatures 2024-11-08 13:13:25 -05:00
Kévin Commaille
35da79a26e identifiers: Make DeviceKeyId a type alias of KeyId 2024-11-08 13:13:19 -05:00
Kévin Commaille
7f8f89eff7 identifiers: Differentiate signing keys from device keys
Use OwnedCrossSigningKeyId, OwnedDeviceSigningKeyId and
OwnedCrossSigningOrDeviceSigningKeyId instead of OwnedDeviceKeyId
to identify signing keys.
2024-11-08 13:13:15 -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
Kévin Commaille
263ddb6545 identifiers: Improve API of Signatures
Implement `Deref` and `DerefMut` to `BTreeMap`.
Implement `From`, `Extend` and `FromIterator` from a list of
`(entity, key_identifier, value)` tuples
Rename `Signatures::insert` to `Signatures::insert_signature`
to let `Signatures::insert` dereference to `BTreeMap::insert`.
2024-11-08 12:49:57 -05:00
Kévin Commaille
ae3897cad8 identifiers: Allow to validate KeyId with any key name type
Use new trait bounds for KeyId to only allow specific types.
Change the KeyId validation to be generic over the key name type.
Remove the KeyName type and replace it with the more specific
ServerSigningKeyVersion.
2024-11-08 12:49:53 -05:00
Jason Volk
c3f21813ca impl Serialize for Mxc using Display/to_string() for now
Signed-off-by: Jason Volk <jason@zemos.net>
2024-10-09 01:16:00 +00:00
Jason Volk
bb93521103 fix tests for structured Mxc
Signed-off-by: Jason Volk <jason@zemos.net>
2024-09-24 19:21:09 +00:00
Jason Volk
25fbd64b96 fix str to mxc conversion; add convenience OwnedMxcUri conversion
Signed-off-by: Jason Volk <jason@zemos.net>
2024-08-16 06:35:50 +00:00
Jason Volk
2d2deb4ca7 structured Mxc type
Signed-off-by: Jason Volk <jason@zemos.net>
2024-08-16 00:37:51 +00:00
Kévin Commaille
a17c0516d6 identifiers: Deprecate constructing Matrix URI for event with room alias
According to MSC4132 / Matrix 1.11
2024-06-22 11:10:44 +02:00
Kévin Commaille
21b644ac6a identifiers: Allow to clone MatrixToUri and MatrixUri 2024-04-21 14:25:10 +02:00
Jonas Platte
e8bc589e52
Transition to type privacy lints 2023-11-09 09:50:04 +01:00
Jonas Platte
c82f600d6a
Fix new lints 2023-11-08 18:16:44 +01:00
Jonas Platte
a5d62dca22
identifiers: Rename room_or_room_alias_id module to match the type 2023-09-28 16:44:16 +02:00
Jonas Platte
cf1c7b0b12
identifiers: Simplify implementation of RoomOrAliasId::variant 2023-09-28 16:43:37 +02:00
Jonas Platte
d78f56e85c
identifiers: Test server_name function in room_id tests 2023-09-28 16:43:16 +02:00
Jonas Platte
984cbda962
identifiers: Don't require room IDs to contain a server name
Room IDs being splittable into localpart and servername does not have
much inherent value and there are proposals like MSC4051¹ that propose
changing the format. Relaxing the rules makes Ruma forwards-compatible
with those proposals. The server_name accessor is kept because it is
used by at least one downstream, but is updated to return an `Option`.

¹ https://github.com/matrix-org/matrix-spec-proposals/pull/4051
2023-09-28 16:43:16 +02:00
Jonas Platte
00ee6030c0
identifiers: Remove unnecessary as_str calls from room_id tests 2023-09-28 16:43:16 +02:00
Jonas Platte
b8fdea9b18
Clean up usage of feature = "rand" in tests 2023-08-24 16:36:56 +02:00
Jonas Platte
9009ec6c3e
identifiers: Fix clippy lint 2023-08-24 15:37:05 +02:00
Kévin Commaille
9a5bc6d8c3 identifiers: Add initial support for room version 11 2023-08-09 19:09:19 +02:00
Jonas Platte
bb20ba0711
Fix new clippy lint 2023-07-31 10:28:39 +02:00
Ivan Enderlin
201f0027d4
feat: Add SlidingSyncRoom::avatar
It's been recently added in the specification, 50ae2c8d65...kegan/sync-v3.
2023-07-26 16:02:28 +02:00
Kévin Commaille
c77f08024a chore: Fix new clippy lints 2023-07-04 11:55:25 +02:00
Jonas Platte
ba5bf8cfce
Replace assert_matches by assert_matches2 2023-06-08 11:37:11 +02:00
Kévin Commaille
07ea09548f events: Stabilize VoIP signalling improvements 2023-06-06 10:44:48 +02:00
Kévin Commaille
5f20a3292c docs: Fix links for v1.7 2023-05-25 19:28:33 +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
Jonas Platte
5aa0f29935
identifiers: Add AsRef<[u8]> impls for ID types 2023-03-07 11:06:34 +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
HKalbasi
270f8196bc
identifiers: Don't allow invalid characters in RoomVersionId 2023-02-12 11:05:33 +01:00
Kévin Commaille
efc60d6a64 docs: Fix invalid link to the spec 2023-02-11 12:14:33 +01:00
Jonas Platte
3013ca0dc1
identifiers: Don't accept colons in user-id localparts, even in compat 2023-02-07 20:56:22 +01:00
Kévin Commaille
06820cdc92 common: Use the same percent encoding set consistently 2023-01-24 20:15:09 +01:00
Jonas Platte
b859d9c8b0
common: Derive Debug via StringEnum derive 2023-01-13 13:49:59 +01:00
Jonas Platte
c7e84c5249
Fix clippy lints
Automated using `cargo clippy --fix`.
2022-10-26 13:38:29 +02:00
Kévin Commaille
045861441a doc: Update Matrix spec links to v1.4 2022-10-21 10:41:20 +02:00