42 Commits

Author SHA1 Message Date
Jonas Platte
a842c5ccdc
identifiers: Add DeviceIdBox and ServerNameBox 2020-08-13 20:42:03 +02:00
Jonas Platte
3454a0e750
Implement FromStr for identifier types 2020-08-11 02:15:14 +02:00
q-b
a1426c9308
Clean up room version id tests 2020-08-10 20:44:02 +02:00
Amanda Graven
fdc15123b0
Reorganize encyption related code
Some types used for encryption related tasks need to be used across more
internal crates than expected, so a few have been moved and renamed for
clarity.

* Rename the key_algorithms module in ruma-identifiers-validation to crypto_algorithms
* Move ruma_events::Algorithm to ruma-identifiers-validation and rename it EventEncryptionAlgorithm
* Move DeviceKeys from ruma-client-api to ruma-common
2020-08-10 18:38:53 +02:00
Jonas Platte
a183a6c801
Add from_parts constructors for DeviceKeyId and ServerKeyId 2020-08-08 22:37:37 +02:00
Jonas Platte
1f056b4ba7
Fix docs for DeviceId 2020-08-08 22:24:40 +02:00
Jonas Platte
0f3478bf90
Rename serde dependency in ruma-identifiers
to be able to make the serde feature activate
ruma-identifiers-validation's serde feature
2020-08-08 18:16:31 +02:00
Faelar
5153279eba Fix missing RoomVersionId::Version6 try_from and tests 2020-08-07 18:06:44 +02:00
Jonas Platte
2023616319
Make all identifier macros usable from ruma-identifiers, even indirectly 2020-08-05 00:12:39 +02:00
Jonas Platte
0d0480e523
Replace ruma_identifiers_macros::device_id with ruma_identifiers::device_id
The proc_macro is replaced by a macro_rules macro because it doesn't
actually need and proc_macro features.
2020-08-04 23:41:35 +02:00
Jonas Platte
1881e45eee
Move ruma-identifiers validation logic into a new crate 2020-08-04 23:23:39 +02:00
Jonas Platte
82b7cc1637
identifiers: Add as_bytes to all types with as_str 2020-07-26 14:55:39 +02:00
Jonas Platte
2e5fceb2b5
identifiers: Simplify generated as_str implementations 2020-07-26 14:44:37 +02:00
Jonas Platte
8faeef4fef
identifiers: Remove outdated allow attribute 2020-07-24 21:15:24 +02:00
Jonas Platte
617a40e3e9
identifiers: Change deny attribute to warn 2020-07-24 21:15:04 +02:00
Jonas Platte
85e2ae3d48
Remove ugly commas 2020-07-24 21:13:41 +02:00
Devin Ragotzy
4be63127f7
Add into_full_event and From<> impls to convert between sync and full events 2020-07-24 14:45:38 +02:00
Devin R
3329dc7345 Fix clippy warnings in identifiers and events-macros 2020-07-23 15:01:12 +02:00
Jonas Platte
05a99a00a0
Only use matches crate as a dev-dependency 2020-07-22 23:06:35 +02:00
Jonas Platte
09f711b1c3
Fix unused import 2020-07-22 22:46:27 +02:00
Jonas Platte
885aae39c5
Add From<&T> for Box<T> implementations for ServerName, DeviceId 2020-07-22 20:22:17 +02:00
Jonas Platte
4cbdc079b0
Improve string comparison impls 2020-07-22 19:17:24 +02:00
Jonas Platte
b24df92692
Make DeviceId a newtype rather than an alias 2020-07-22 18:59:33 +02:00
Jonas Platte
8d8e18afbc
Make RoomVersionId a non-exhaustive enum 2020-07-22 18:38:37 +02:00
Jonas Platte
c2ea1493cb
identifiers: Use .as_ref() less 2020-07-20 16:33:29 +02:00
Isaiah Inuwa
ade43c8516 Use ServerName everywhere 2020-07-18 07:50:53 -05:00
Jonas Platte
d6dfed568f
Add documentation to RoomVersionId's PartialOrd, Ord impls 2020-07-17 01:07:16 +02:00
Jonas Platte
7cfec8631a
Use the matches! macro in more places 2020-07-15 15:51:09 +02:00
Jonas Platte
501652a272
Fix unused import warnings 2020-07-15 15:49:04 +02:00
Jonas Platte
60238bbb85
Fix doc_concat macro on older versions of rustc 2020-07-15 02:02:14 +02:00
Jonas Platte
a3e5d679a1
Revert making identifier types generic over the underlying string type
At the same time, this commit makes `ServerName` a newtype around str so
other identifier types can borrow out their server name part as a
`&ServerName`. This technique works for `ServerName` because it keeps no
additional metadata. For the other identifier types to support being
created in borrowed form from a string slice, custom DSTs first have to
be added to Rust.
2020-07-14 23:02:51 +02:00
Jonas Platte
75ea42961f
Use strum(serialize_all) instead of strum(to_string) 2020-06-23 12:52:21 +02:00
Jonas Platte
c5db6d56ad
Remove RoomVersionId::custom constructor
It could be used to create invalid room versions like an empty one or
one with more than 32 code points.
2020-06-23 12:40:01 +02:00
Jonas Platte
46c4f12404
identifiers: Move is_valid_server_name logic to server_name::try_from 2020-06-21 18:47:59 +02:00
Jonas Platte
046668466c
identifiers: Add more conversion functions 2020-06-18 12:11:52 +02:00
iinuwa
f8492db766
Add ServerName identifier 2020-06-18 11:21:00 +02:00
Jonas Platte
c20d52e2af
identifiers: Update DeviceKeyId::device_id to return a reference instead of cloning 2020-06-17 12:15:38 +02:00
stoically
d59a616e2c
federation-api: Add query server key discovery endpoints 2020-06-08 21:18:58 +02:00
Isaiah Inuwa
baa8710456 Re-export key identifiers at crate root 2020-06-07 13:52:27 -05:00
Jonas Platte
b1193a2883
identifiers: Add DeviceId, DeviceIdRef to the crate root 2020-06-07 17:22:44 +02:00
Jonas Platte
abf8eafe0e
Rerun cargo fmt 2020-06-07 17:22:20 +02:00
Jonas Platte
83de77f002 Add 'ruma-identifiers/' from commit 'c0a1d8bd440c7cde0fa4ab5e22898ddb26bb706d'
git-subtree-dir: ruma-identifiers
git-subtree-mainline: 19ce9645b6651e4de42ddf9e81ee50e19c8c0f26
git-subtree-split: c0a1d8bd440c7cde0fa4ab5e22898ddb26bb706d
2020-06-07 17:06:45 +02:00