diff --git a/crates/ruma-client-api/src/r0/account/register.rs b/crates/ruma-client-api/src/r0/account/register.rs index 1daa5ec6..2488aa8a 100644 --- a/crates/ruma-client-api/src/r0/account/register.rs +++ b/crates/ruma-client-api/src/r0/account/register.rs @@ -1,7 +1,7 @@ //! [POST /_matrix/client/r0/register](https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-register) use ruma_api::ruma_api; -use ruma_identifiers::{DeviceId, DeviceIdBox, UserId}; +use ruma_identifiers::{DeviceId, UserId}; use serde::{Deserialize, Serialize}; use crate::r0::uiaa::{AuthData, IncomingAuthData, UiaaResponse}; @@ -88,7 +88,7 @@ ruma_api! { /// ID of the registered device. /// /// Will be the same as the corresponding parameter in the request, if one was specified. - pub device_id: Option, + pub device_id: Option>, } error: UiaaResponse diff --git a/crates/ruma-client-api/src/r0/account/request_3pid_management_token_via_email.rs b/crates/ruma-client-api/src/r0/account/request_3pid_management_token_via_email.rs index af8f7ae1..aa3c96da 100644 --- a/crates/ruma-client-api/src/r0/account/request_3pid_management_token_via_email.rs +++ b/crates/ruma-client-api/src/r0/account/request_3pid_management_token_via_email.rs @@ -2,7 +2,7 @@ use js_int::UInt; use ruma_api::ruma_api; -use ruma_identifiers::{ClientSecret, SessionIdBox}; +use ruma_identifiers::{ClientSecret, SessionId}; use super::{IdentityServerInfo, IncomingIdentityServerInfo}; @@ -39,7 +39,7 @@ ruma_api! { response: { /// The session identifier given by the identity server. - pub sid: SessionIdBox, + pub sid: Box, /// URL to submit validation token to. /// @@ -67,7 +67,7 @@ impl<'a> Request<'a> { impl Response { /// Creates a new `Response` with the given session identifier. - pub fn new(sid: SessionIdBox) -> Self { + pub fn new(sid: Box) -> Self { Self { sid, submit_url: None } } } diff --git a/crates/ruma-client-api/src/r0/account/request_3pid_management_token_via_msisdn.rs b/crates/ruma-client-api/src/r0/account/request_3pid_management_token_via_msisdn.rs index 75c9bdb3..e2f8f3a7 100644 --- a/crates/ruma-client-api/src/r0/account/request_3pid_management_token_via_msisdn.rs +++ b/crates/ruma-client-api/src/r0/account/request_3pid_management_token_via_msisdn.rs @@ -2,7 +2,7 @@ use js_int::UInt; use ruma_api::ruma_api; -use ruma_identifiers::{ClientSecret, SessionIdBox}; +use ruma_identifiers::{ClientSecret, SessionId}; use super::{IdentityServerInfo, IncomingIdentityServerInfo}; @@ -42,7 +42,7 @@ ruma_api! { response: { /// The session identifier given by the identity server. - pub sid: SessionIdBox, + pub sid: Box, /// URL to submit validation token to. /// @@ -83,7 +83,7 @@ impl<'a> Request<'a> { impl Response { /// Creates a new `Response` with the given session identifier. - pub fn new(sid: SessionIdBox) -> Self { + pub fn new(sid: Box) -> Self { Self { sid, submit_url: None } } } diff --git a/crates/ruma-client-api/src/r0/account/request_openid_token.rs b/crates/ruma-client-api/src/r0/account/request_openid_token.rs index dbd01469..db06472b 100644 --- a/crates/ruma-client-api/src/r0/account/request_openid_token.rs +++ b/crates/ruma-client-api/src/r0/account/request_openid_token.rs @@ -4,7 +4,7 @@ use std::time::Duration; use ruma_api::ruma_api; use ruma_common::authentication::TokenType; -use ruma_identifiers::{ServerNameBox, UserId}; +use ruma_identifiers::{ServerName, UserId}; ruma_api! { metadata: { @@ -30,7 +30,7 @@ ruma_api! { pub token_type: TokenType, /// Homeserver domain for verification of user's identity. - pub matrix_server_name: ServerNameBox, + pub matrix_server_name: Box, /// Seconds until token expiration. #[serde(with = "ruma_serde::duration::secs")] @@ -53,7 +53,7 @@ impl Response { pub fn new( access_token: String, token_type: TokenType, - matrix_server_name: ServerNameBox, + matrix_server_name: Box, expires_in: Duration, ) -> Self { Self { access_token, token_type, matrix_server_name, expires_in } diff --git a/crates/ruma-client-api/src/r0/account/request_password_change_token_via_email.rs b/crates/ruma-client-api/src/r0/account/request_password_change_token_via_email.rs index 294765ce..15183605 100644 --- a/crates/ruma-client-api/src/r0/account/request_password_change_token_via_email.rs +++ b/crates/ruma-client-api/src/r0/account/request_password_change_token_via_email.rs @@ -2,7 +2,7 @@ use js_int::UInt; use ruma_api::ruma_api; -use ruma_identifiers::{ClientSecret, SessionIdBox}; +use ruma_identifiers::{ClientSecret, SessionId}; use super::{IdentityServerInfo, IncomingIdentityServerInfo}; @@ -39,7 +39,7 @@ ruma_api! { response: { /// The session identifier given by the identity server. - pub sid: SessionIdBox, + pub sid: Box, /// URL to submit validation token to. /// @@ -68,7 +68,7 @@ impl<'a> Request<'a> { impl Response { /// Creates a new `Response` with the given session identifier. - pub fn new(sid: SessionIdBox) -> Self { + pub fn new(sid: Box) -> Self { Self { sid, submit_url: None } } } diff --git a/crates/ruma-client-api/src/r0/account/request_password_change_token_via_msisdn.rs b/crates/ruma-client-api/src/r0/account/request_password_change_token_via_msisdn.rs index e9333967..f0fb60e3 100644 --- a/crates/ruma-client-api/src/r0/account/request_password_change_token_via_msisdn.rs +++ b/crates/ruma-client-api/src/r0/account/request_password_change_token_via_msisdn.rs @@ -2,7 +2,7 @@ use js_int::UInt; use ruma_api::ruma_api; -use ruma_identifiers::{ClientSecret, SessionIdBox}; +use ruma_identifiers::{ClientSecret, SessionId}; ruma_api! { metadata: { @@ -34,7 +34,7 @@ ruma_api! { response: { /// The session identifier given by the identity server. - pub sid: SessionIdBox, + pub sid: Box, /// URL to submit validation token to. /// @@ -68,7 +68,7 @@ impl<'a> Request<'a> { impl Response { /// Creates a new `Response` with the given session identifier. - pub fn new(sid: SessionIdBox) -> Self { + pub fn new(sid: Box) -> Self { Self { sid, submit_url: None } } } diff --git a/crates/ruma-client-api/src/r0/account/request_registration_token_via_email.rs b/crates/ruma-client-api/src/r0/account/request_registration_token_via_email.rs index 4bb66f4b..565772c8 100644 --- a/crates/ruma-client-api/src/r0/account/request_registration_token_via_email.rs +++ b/crates/ruma-client-api/src/r0/account/request_registration_token_via_email.rs @@ -2,7 +2,7 @@ use js_int::UInt; use ruma_api::ruma_api; -use ruma_identifiers::{ClientSecret, SessionIdBox}; +use ruma_identifiers::{ClientSecret, SessionId}; use super::{IdentityServerInfo, IncomingIdentityServerInfo}; @@ -39,7 +39,7 @@ ruma_api! { response: { /// The session identifier given by the identity server. - pub sid: SessionIdBox, + pub sid: Box, /// URL to submit validation token to. /// @@ -68,7 +68,7 @@ impl<'a> Request<'a> { impl Response { /// Creates a new `Response` with the given session identifier. - pub fn new(sid: SessionIdBox) -> Self { + pub fn new(sid: Box) -> Self { Self { sid, submit_url: None } } } diff --git a/crates/ruma-client-api/src/r0/account/request_registration_token_via_msisdn.rs b/crates/ruma-client-api/src/r0/account/request_registration_token_via_msisdn.rs index bff91847..d3b88770 100644 --- a/crates/ruma-client-api/src/r0/account/request_registration_token_via_msisdn.rs +++ b/crates/ruma-client-api/src/r0/account/request_registration_token_via_msisdn.rs @@ -2,7 +2,7 @@ use js_int::UInt; use ruma_api::ruma_api; -use ruma_identifiers::{ClientSecret, SessionIdBox}; +use ruma_identifiers::{ClientSecret, SessionId}; use super::{IdentityServerInfo, IncomingIdentityServerInfo}; @@ -42,7 +42,7 @@ ruma_api! { response: { /// The session identifier given by the identity server. - pub sid: SessionIdBox, + pub sid: Box, /// URL to submit validation token to. /// @@ -83,7 +83,7 @@ impl<'a> Request<'a> { impl Response { /// Creates a new `Response` with the given session identifier. - pub fn new(sid: SessionIdBox) -> Self { + pub fn new(sid: Box) -> Self { Self { sid, submit_url: None } } } diff --git a/crates/ruma-client-api/src/r0/alias/get_alias.rs b/crates/ruma-client-api/src/r0/alias/get_alias.rs index b36b12f2..9b8beaf1 100644 --- a/crates/ruma-client-api/src/r0/alias/get_alias.rs +++ b/crates/ruma-client-api/src/r0/alias/get_alias.rs @@ -1,7 +1,7 @@ //! [GET /_matrix/client/r0/directory/room/{roomAlias}](https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-directory-room-roomalias) use ruma_api::ruma_api; -use ruma_identifiers::{RoomAliasId, RoomId, ServerNameBox}; +use ruma_identifiers::{RoomAliasId, RoomId, ServerName}; ruma_api! { metadata: { @@ -24,7 +24,7 @@ ruma_api! { pub room_id: RoomId, /// A list of servers that are aware of this room ID. - pub servers: Vec, + pub servers: Vec>, } error: crate::Error @@ -39,7 +39,7 @@ impl<'a> Request<'a> { impl Response { /// Creates a new `Response` with the given room id and servers - pub fn new(room_id: RoomId, servers: Vec) -> Self { + pub fn new(room_id: RoomId, servers: Vec>) -> Self { Self { room_id, servers } } } diff --git a/crates/ruma-client-api/src/r0/device.rs b/crates/ruma-client-api/src/r0/device.rs index 19ba1b00..fbb16c5c 100644 --- a/crates/ruma-client-api/src/r0/device.rs +++ b/crates/ruma-client-api/src/r0/device.rs @@ -1,7 +1,7 @@ //! Endpoints for managing devices. use ruma_common::MilliSecondsSinceUnixEpoch; -use ruma_identifiers::DeviceIdBox; +use ruma_identifiers::DeviceId; use serde::{Deserialize, Serialize}; pub mod delete_device; @@ -15,7 +15,7 @@ pub mod update_device; #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] pub struct Device { /// Device ID - pub device_id: DeviceIdBox, + pub device_id: Box, /// Public display name of the device. pub display_name: Option, @@ -30,7 +30,7 @@ pub struct Device { impl Device { /// Creates a new `Device` with the given device ID. - pub fn new(device_id: DeviceIdBox) -> Self { + pub fn new(device_id: Box) -> Self { Self { device_id, display_name: None, last_seen_ip: None, last_seen_ts: None } } } diff --git a/crates/ruma-client-api/src/r0/device/delete_devices.rs b/crates/ruma-client-api/src/r0/device/delete_devices.rs index 3a3679d8..09d245d2 100644 --- a/crates/ruma-client-api/src/r0/device/delete_devices.rs +++ b/crates/ruma-client-api/src/r0/device/delete_devices.rs @@ -1,7 +1,7 @@ //! [POST /_matrix/client/r0/delete_devices](https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-delete-devices) use ruma_api::ruma_api; -use ruma_identifiers::DeviceIdBox; +use ruma_identifiers::DeviceId; use crate::r0::uiaa::{AuthData, IncomingAuthData, UiaaResponse}; @@ -17,7 +17,7 @@ ruma_api! { request: { /// List of devices to delete. - pub devices: &'a [DeviceIdBox], + pub devices: &'a [Box], /// Additional authentication information for the user-interactive authentication API. #[serde(skip_serializing_if = "Option::is_none")] @@ -32,7 +32,7 @@ ruma_api! { impl<'a> Request<'a> { /// Creates a new `Request` with the given device list. - pub fn new(devices: &'a [DeviceIdBox]) -> Self { + pub fn new(devices: &'a [Box]) -> Self { Self { devices, auth: None } } } diff --git a/crates/ruma-client-api/src/r0/directory.rs b/crates/ruma-client-api/src/r0/directory.rs index 8bccef7f..fb78e004 100644 --- a/crates/ruma-client-api/src/r0/directory.rs +++ b/crates/ruma-client-api/src/r0/directory.rs @@ -8,7 +8,7 @@ pub mod set_room_visibility; use js_int::{uint, UInt}; #[cfg(feature = "unstable-pre-spec")] use ruma_events::room::join_rules::JoinRule; -use ruma_identifiers::{MxcUri, RoomAliasId, RoomId, RoomNameBox}; +use ruma_identifiers::{MxcUri, RoomAliasId, RoomId, RoomName}; use serde::{Deserialize, Serialize}; /// A chunk of a room list response, describing one room @@ -25,7 +25,7 @@ pub struct PublicRoomsChunk { /// The name of the room, if any. #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, /// The number of members joined to the room. pub num_joined_members: UInt, diff --git a/crates/ruma-client-api/src/r0/keys/claim_keys.rs b/crates/ruma-client-api/src/r0/keys/claim_keys.rs index 14a88032..aa28d55d 100644 --- a/crates/ruma-client-api/src/r0/keys/claim_keys.rs +++ b/crates/ruma-client-api/src/r0/keys/claim_keys.rs @@ -4,7 +4,7 @@ use std::{collections::BTreeMap, time::Duration}; use ruma_api::ruma_api; use ruma_common::encryption::OneTimeKey; -use ruma_identifiers::{DeviceIdBox, DeviceKeyAlgorithm, DeviceKeyId, UserId}; +use ruma_identifiers::{DeviceId, DeviceKeyAlgorithm, DeviceKeyId, UserId}; use serde_json::Value as JsonValue; ruma_api! { @@ -28,7 +28,7 @@ ruma_api! { pub timeout: Option, /// The keys to be claimed. - pub one_time_keys: BTreeMap>, + pub one_time_keys: BTreeMap, DeviceKeyAlgorithm>>, } response: { @@ -45,7 +45,9 @@ ruma_api! { impl Request { /// Creates a new `Request` with the given key claims and the recommended 10 second timeout. - pub fn new(one_time_keys: BTreeMap>) -> Self { + pub fn new( + one_time_keys: BTreeMap, DeviceKeyAlgorithm>>, + ) -> Self { Self { timeout: Some(Duration::from_secs(10)), one_time_keys } } } @@ -58,4 +60,4 @@ impl Response { } /// The one-time keys for a given device. -pub type OneTimeKeys = BTreeMap>; +pub type OneTimeKeys = BTreeMap, BTreeMap>; diff --git a/crates/ruma-client-api/src/r0/keys/get_keys.rs b/crates/ruma-client-api/src/r0/keys/get_keys.rs index 78a464c1..b43cbccc 100644 --- a/crates/ruma-client-api/src/r0/keys/get_keys.rs +++ b/crates/ruma-client-api/src/r0/keys/get_keys.rs @@ -4,7 +4,7 @@ use std::{collections::BTreeMap, time::Duration}; use ruma_api::ruma_api; use ruma_common::encryption::DeviceKeys; -use ruma_identifiers::{DeviceIdBox, UserId}; +use ruma_identifiers::{DeviceId, UserId}; use serde_json::Value as JsonValue; #[cfg(feature = "unstable-pre-spec")] @@ -35,7 +35,7 @@ ruma_api! { /// The keys to be downloaded. /// /// An empty list indicates all devices for the corresponding user. - pub device_keys: BTreeMap>, + pub device_keys: BTreeMap>>, /// If the client is fetching keys as a result of a device update received in a sync /// request, this should be the 'since' token of that sync request, or any later sync token. @@ -56,7 +56,7 @@ ruma_api! { /// Information on the queried devices. #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] - pub device_keys: BTreeMap>, + pub device_keys: BTreeMap, DeviceKeys>>, /// Information on the master cross-signing keys of the queried users. #[cfg(feature = "unstable-pre-spec")] diff --git a/crates/ruma-client-api/src/r0/knock/knock_room.rs b/crates/ruma-client-api/src/r0/knock/knock_room.rs index 999c3bcd..481326b0 100644 --- a/crates/ruma-client-api/src/r0/knock/knock_room.rs +++ b/crates/ruma-client-api/src/r0/knock/knock_room.rs @@ -1,7 +1,7 @@ //! [POST /_matrix/client/r0/knock/{roomIdOrAlias}](https://spec.matrix.org/unstable/client-server-api/#post_matrixclientr0knockroomidoralias) use ruma_api::ruma_api; -use ruma_identifiers::{RoomId, RoomIdOrAliasId, ServerNameBox}; +use ruma_identifiers::{RoomId, RoomIdOrAliasId, ServerName}; ruma_api! { metadata: { @@ -27,7 +27,7 @@ ruma_api! { /// One of the servers must be participating in the room. #[ruma_api(query)] #[serde(default, skip_serializing_if = "<[_]>::is_empty")] - pub server_name: &'a [ServerNameBox], + pub server_name: &'a [Box], } response: { diff --git a/crates/ruma-client-api/src/r0/membership.rs b/crates/ruma-client-api/src/r0/membership.rs index 2f7f3a8f..8e2ddd66 100644 --- a/crates/ruma-client-api/src/r0/membership.rs +++ b/crates/ruma-client-api/src/r0/membership.rs @@ -15,7 +15,7 @@ pub mod unban_user; use std::collections::BTreeMap; use ruma_common::thirdparty::Medium; -use ruma_identifiers::{ServerNameBox, ServerSigningKeyId, UserId}; +use ruma_identifiers::{ServerName, ServerSigningKeyId, UserId}; use ruma_serde::Outgoing; use serde::Serialize; @@ -34,7 +34,7 @@ pub struct ThirdPartySigned<'a> { pub token: &'a str, /// A signatures object containing a signature of the entire signed object. - pub signatures: BTreeMap>, + pub signatures: BTreeMap, BTreeMap>, } impl<'a> ThirdPartySigned<'a> { @@ -44,7 +44,7 @@ impl<'a> ThirdPartySigned<'a> { sender: &'a UserId, mxid: &'a UserId, token: &'a str, - signatures: BTreeMap>, + signatures: BTreeMap, BTreeMap>, ) -> Self { Self { sender, mxid, token, signatures } } diff --git a/crates/ruma-client-api/src/r0/membership/join_room_by_id_or_alias.rs b/crates/ruma-client-api/src/r0/membership/join_room_by_id_or_alias.rs index 09431a10..39c74382 100644 --- a/crates/ruma-client-api/src/r0/membership/join_room_by_id_or_alias.rs +++ b/crates/ruma-client-api/src/r0/membership/join_room_by_id_or_alias.rs @@ -1,7 +1,7 @@ //! [POST /_matrix/client/r0/join/{roomIdOrAlias}](https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-join-roomidoralias) use ruma_api::ruma_api; -use ruma_identifiers::{RoomId, RoomIdOrAliasId, ServerNameBox}; +use ruma_identifiers::{RoomId, RoomIdOrAliasId, ServerName}; use super::{IncomingThirdPartySigned, ThirdPartySigned}; @@ -25,7 +25,7 @@ ruma_api! { /// One of the servers must be participating in the room. #[ruma_api(query)] #[serde(default, skip_serializing_if = "<[_]>::is_empty")] - pub server_name: &'a [ServerNameBox], + pub server_name: &'a [Box], /// The signature of a `m.third_party_invite` token to prove that this user owns a third /// party identity which has been invited to the room. diff --git a/crates/ruma-client-api/src/r0/session/login.rs b/crates/ruma-client-api/src/r0/session/login.rs index 9d203957..aa97e19c 100644 --- a/crates/ruma-client-api/src/r0/session/login.rs +++ b/crates/ruma-client-api/src/r0/session/login.rs @@ -1,7 +1,7 @@ //! [POST /_matrix/client/r0/login](https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-login) use ruma_api::ruma_api; -use ruma_identifiers::{DeviceId, DeviceIdBox, ServerNameBox, UserId}; +use ruma_identifiers::{DeviceId, ServerName, UserId}; use ruma_serde::{JsonObject, Outgoing}; use serde::{ de::{self, DeserializeOwned}, @@ -49,13 +49,13 @@ ruma_api! { /// Deprecated: Clients should instead use the `user_id.server_name()` /// method if they require it. #[serde(skip_serializing_if = "Option::is_none")] - pub home_server: Option, + pub home_server: Option>, /// ID of the logged-in device. /// /// Will be the same as the corresponding parameter in the request, if one was /// specified. - pub device_id: DeviceIdBox, + pub device_id: Box, /// Client configuration provided by the server. /// @@ -76,7 +76,7 @@ impl<'a> Request<'a> { impl Response { /// Creates a new `Response` with the given user ID, access token and device ID. - pub fn new(user_id: UserId, access_token: String, device_id: DeviceIdBox) -> Self { + pub fn new(user_id: UserId, access_token: String, device_id: Box) -> Self { Self { user_id, access_token, home_server: None, device_id, well_known: None } } } diff --git a/crates/ruma-common/src/directory.rs b/crates/ruma-common/src/directory.rs index 8348ed1b..3ec2934c 100644 --- a/crates/ruma-common/src/directory.rs +++ b/crates/ruma-common/src/directory.rs @@ -3,7 +3,7 @@ use std::fmt; use js_int::UInt; -use ruma_identifiers::{MxcUri, RoomAliasId, RoomId, RoomNameBox}; +use ruma_identifiers::{MxcUri, RoomAliasId, RoomId, RoomName}; use ruma_serde::Outgoing; use serde::{ de::{Error, MapAccess, Visitor}, @@ -29,7 +29,7 @@ pub struct PublicRoomsChunk { /// The name of the room, if any. #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, + pub name: Option>, /// The number of members joined to the room. pub num_joined_members: UInt, diff --git a/crates/ruma-common/src/encryption.rs b/crates/ruma-common/src/encryption.rs index f2c81518..d813764e 100644 --- a/crates/ruma-common/src/encryption.rs +++ b/crates/ruma-common/src/encryption.rs @@ -4,7 +4,7 @@ use std::collections::BTreeMap; -use ruma_identifiers::{DeviceIdBox, DeviceKeyId, EventEncryptionAlgorithm, UserId}; +use ruma_identifiers::{DeviceId, DeviceKeyId, EventEncryptionAlgorithm, UserId}; use serde::{Deserialize, Serialize}; /// Identity keys for a device. @@ -19,7 +19,7 @@ pub struct DeviceKeys { /// The ID of the device these keys belong to. /// /// Must match the device ID used when logging in. - pub device_id: DeviceIdBox, + pub device_id: Box, /// The encryption algorithms supported by this device. pub algorithms: Vec, @@ -41,7 +41,7 @@ impl DeviceKeys { /// signatures. pub fn new( user_id: UserId, - device_id: DeviceIdBox, + device_id: Box, algorithms: Vec, keys: BTreeMap, signatures: BTreeMap>, diff --git a/crates/ruma-common/src/to_device.rs b/crates/ruma-common/src/to_device.rs index 48862dac..27761407 100644 --- a/crates/ruma-common/src/to_device.rs +++ b/crates/ruma-common/src/to_device.rs @@ -7,7 +7,7 @@ use std::{ fmt::{Display, Formatter, Result as FmtResult}, }; -use ruma_identifiers::DeviceIdBox; +use ruma_identifiers::DeviceId; use serde::{ de::{self, Unexpected}, Deserialize, Deserializer, Serialize, Serializer, @@ -18,7 +18,7 @@ use serde::{ #[allow(clippy::exhaustive_enums)] pub enum DeviceIdOrAllDevices { /// Represents a device Id for one of a user's devices. - DeviceId(DeviceIdBox), + DeviceId(Box), /// Represents all devices for a user. AllDevices, @@ -33,8 +33,8 @@ impl Display for DeviceIdOrAllDevices { } } -impl From for DeviceIdOrAllDevices { - fn from(d: DeviceIdBox) -> Self { +impl From> for DeviceIdOrAllDevices { + fn from(d: Box) -> Self { DeviceIdOrAllDevices::DeviceId(d) } } diff --git a/crates/ruma-events/src/key/verification/ready.rs b/crates/ruma-events/src/key/verification/ready.rs index 3ffba06a..f4a2c01b 100644 --- a/crates/ruma-events/src/key/verification/ready.rs +++ b/crates/ruma-events/src/key/verification/ready.rs @@ -1,7 +1,7 @@ //! Types for the `m.key.verification.ready` event. use ruma_events_macros::EventContent; -use ruma_identifiers::DeviceIdBox; +use ruma_identifiers::DeviceId; use serde::{Deserialize, Serialize}; use super::{Relation, VerificationMethod}; @@ -14,7 +14,7 @@ use super::{Relation, VerificationMethod}; #[ruma_event(type = "m.key.verification.ready", kind = ToDevice)] pub struct ToDeviceKeyVerificationReadyEventContent { /// The device ID which is initiating the request. - pub from_device: DeviceIdBox, + pub from_device: Box, /// The verification methods supported by the sender. pub methods: Vec, @@ -31,7 +31,7 @@ impl ToDeviceKeyVerificationReadyEventContent { /// Creates a new `ToDeviceKeyVerificationReadyEventContent` with the given device ID, /// verification methods and transaction ID. pub fn new( - from_device: DeviceIdBox, + from_device: Box, methods: Vec, transaction_id: String, ) -> Self { @@ -47,7 +47,7 @@ impl ToDeviceKeyVerificationReadyEventContent { #[ruma_event(type = "m.key.verification.ready", kind = Message)] pub struct KeyVerificationReadyEventContent { /// The device ID which is initiating the request. - pub from_device: DeviceIdBox, + pub from_device: Box, /// The verification methods supported by the sender. pub methods: Vec, @@ -62,7 +62,7 @@ impl KeyVerificationReadyEventContent { /// Creates a new `KeyVerificationReadyEventContent` with the given device ID, methods and /// relation. pub fn new( - from_device: DeviceIdBox, + from_device: Box, methods: Vec, relates_to: Relation, ) -> Self { @@ -73,7 +73,7 @@ impl KeyVerificationReadyEventContent { #[cfg(test)] mod tests { use matches::assert_matches; - use ruma_identifiers::{event_id, DeviceIdBox}; + use ruma_identifiers::{event_id, DeviceId}; use serde_json::{from_value as from_json_value, json, to_value as to_json_value}; use super::{KeyVerificationReadyEventContent, ToDeviceKeyVerificationReadyEventContent}; @@ -82,7 +82,7 @@ mod tests { #[test] fn serialization() { let event_id = event_id!("$1598361704261elfgc:localhost"); - let device: DeviceIdBox = "123".into(); + let device: Box = "123".into(); let json_data = json!({ "from_device": device, @@ -119,7 +119,7 @@ mod tests { #[test] fn deserialization() { let id = event_id!("$1598361704261elfgc:localhost"); - let device: DeviceIdBox = "123".into(); + let device: Box = "123".into(); let json_data = json!({ "from_device": device, diff --git a/crates/ruma-events/src/key/verification/request.rs b/crates/ruma-events/src/key/verification/request.rs index 06f7da91..8dbbdb7b 100644 --- a/crates/ruma-events/src/key/verification/request.rs +++ b/crates/ruma-events/src/key/verification/request.rs @@ -2,7 +2,7 @@ use ruma_common::MilliSecondsSinceUnixEpoch; use ruma_events_macros::EventContent; -use ruma_identifiers::DeviceIdBox; +use ruma_identifiers::DeviceId; use serde::{Deserialize, Serialize}; use super::VerificationMethod; @@ -13,7 +13,7 @@ use super::VerificationMethod; #[ruma_event(type = "m.key.verification.request", kind = ToDevice)] pub struct ToDeviceKeyVerificationRequestEventContent { /// The device ID which is initiating the request. - pub from_device: DeviceIdBox, + pub from_device: Box, /// An opaque identifier for the verification request. /// @@ -34,7 +34,7 @@ impl ToDeviceKeyVerificationRequestEventContent { /// Creates a new `ToDeviceKeyVerificationRequestEventContent` with the given device ID, /// transaction ID, methods and timestamp. pub fn new( - from_device: DeviceIdBox, + from_device: Box, transaction_id: String, methods: Vec, timestamp: MilliSecondsSinceUnixEpoch, diff --git a/crates/ruma-events/src/key/verification/start.rs b/crates/ruma-events/src/key/verification/start.rs index 66036c3e..2bf181d2 100644 --- a/crates/ruma-events/src/key/verification/start.rs +++ b/crates/ruma-events/src/key/verification/start.rs @@ -3,7 +3,7 @@ use std::collections::BTreeMap; use ruma_events_macros::EventContent; -use ruma_identifiers::DeviceIdBox; +use ruma_identifiers::DeviceId; use serde::{Deserialize, Serialize}; use serde_json::Value as JsonValue; @@ -21,7 +21,7 @@ use super::{ #[ruma_event(type = "m.key.verification.start", kind = ToDevice)] pub struct ToDeviceKeyVerificationStartEventContent { /// The device ID which is initiating the process. - pub from_device: DeviceIdBox, + pub from_device: Box, /// An opaque identifier for the verification process. /// @@ -38,7 +38,7 @@ pub struct ToDeviceKeyVerificationStartEventContent { impl ToDeviceKeyVerificationStartEventContent { /// Creates a new `ToDeviceKeyVerificationStartEventContent` with the given device ID, /// transaction ID and method specific content. - pub fn new(from_device: DeviceIdBox, transaction_id: String, method: StartMethod) -> Self { + pub fn new(from_device: Box, transaction_id: String, method: StartMethod) -> Self { Self { from_device, transaction_id, method } } } @@ -52,7 +52,7 @@ impl ToDeviceKeyVerificationStartEventContent { #[ruma_event(type = "m.key.verification.start", kind = Message)] pub struct KeyVerificationStartEventContent { /// The device ID which is initiating the process. - pub from_device: DeviceIdBox, + pub from_device: Box, /// Method specific content. #[serde(flatten)] @@ -67,7 +67,7 @@ pub struct KeyVerificationStartEventContent { impl KeyVerificationStartEventContent { /// Creates a new `KeyVerificationStartEventContent` with the given device ID, method and /// relation. - pub fn new(from_device: DeviceIdBox, method: StartMethod, relates_to: Relation) -> Self { + pub fn new(from_device: Box, method: StartMethod, relates_to: Relation) -> Self { Self { from_device, method, relates_to } } } diff --git a/crates/ruma-events/src/pdu.rs b/crates/ruma-events/src/pdu.rs index 1c11f871..4976565c 100644 --- a/crates/ruma-events/src/pdu.rs +++ b/crates/ruma-events/src/pdu.rs @@ -9,7 +9,7 @@ use std::collections::BTreeMap; use js_int::UInt; use ruma_common::MilliSecondsSinceUnixEpoch; -use ruma_identifiers::{EventId, RoomId, ServerNameBox, ServerSigningKeyId, UserId}; +use ruma_identifiers::{EventId, RoomId, ServerName, ServerSigningKeyId, UserId}; use serde::{ de::{Error as _, IgnoredAny}, Deserialize, Deserializer, Serialize, @@ -89,7 +89,7 @@ pub struct RoomV1Pdu { pub hashes: EventHash, /// Signatures for the PDU. - pub signatures: BTreeMap>, + pub signatures: BTreeMap, BTreeMap>, } /// A 'persistent data unit' (event) for room versions 3 and beyond. @@ -146,7 +146,7 @@ pub struct RoomV3Pdu { pub hashes: EventHash, /// Signatures for the PDU. - pub signatures: BTreeMap>, + pub signatures: BTreeMap, BTreeMap>, } /// Content hashes of a PDU. diff --git a/crates/ruma-events/src/room/encrypted.rs b/crates/ruma-events/src/room/encrypted.rs index 8253eba3..b762b9d6 100644 --- a/crates/ruma-events/src/room/encrypted.rs +++ b/crates/ruma-events/src/room/encrypted.rs @@ -4,7 +4,7 @@ use std::collections::BTreeMap; use js_int::UInt; use ruma_events_macros::EventContent; -use ruma_identifiers::DeviceIdBox; +use ruma_identifiers::DeviceId; #[cfg(feature = "unstable-pre-spec")] use ruma_identifiers::EventId; use serde::{Deserialize, Serialize}; @@ -212,7 +212,7 @@ pub struct MegolmV1AesSha2Content { pub sender_key: String, /// The ID of the sending device. - pub device_id: DeviceIdBox, + pub device_id: Box, /// The ID of the session used to encrypt the message. pub session_id: String, @@ -232,7 +232,7 @@ pub struct MegolmV1AesSha2ContentInit { pub sender_key: String, /// The ID of the sending device. - pub device_id: DeviceIdBox, + pub device_id: Box, /// The ID of the session used to encrypt the message. pub session_id: String, diff --git a/crates/ruma-events/src/room/member.rs b/crates/ruma-events/src/room/member.rs index 822b8e92..99da7625 100644 --- a/crates/ruma-events/src/room/member.rs +++ b/crates/ruma-events/src/room/member.rs @@ -3,7 +3,7 @@ use std::collections::BTreeMap; use ruma_events_macros::EventContent; -use ruma_identifiers::{MxcUri, ServerNameBox, ServerSigningKeyId, UserId}; +use ruma_identifiers::{MxcUri, ServerName, ServerSigningKeyId, UserId}; use ruma_serde::StringEnum; use serde::{Deserialize, Serialize}; @@ -178,7 +178,7 @@ pub struct SignedContent { /// A single signature from the verifying server, in the format specified by the Signing Events /// section of the server-server API. - pub signatures: BTreeMap>, + pub signatures: BTreeMap, BTreeMap>, /// The token property of the containing `third_party_invite` object. pub token: String, @@ -188,7 +188,7 @@ impl SignedContent { /// Creates a new `SignedContent` with the given mxid, signature and token. pub fn new( mxid: UserId, - signatures: BTreeMap>, + signatures: BTreeMap, BTreeMap>, token: String, ) -> Self { Self { mxid, signatures, token } diff --git a/crates/ruma-events/src/room/message.rs b/crates/ruma-events/src/room/message.rs index 30a077d4..df449b88 100644 --- a/crates/ruma-events/src/room/message.rs +++ b/crates/ruma-events/src/room/message.rs @@ -5,7 +5,7 @@ use std::{borrow::Cow, fmt}; use js_int::UInt; use ruma_events_macros::EventContent; #[cfg(feature = "unstable-pre-spec")] -use ruma_identifiers::{DeviceIdBox, UserId}; +use ruma_identifiers::{DeviceId, UserId}; use ruma_identifiers::{EventId, MxcUri}; use ruma_serde::{JsonObject, StringEnum}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; @@ -968,7 +968,7 @@ pub struct KeyVerificationRequestEventContent { pub methods: Vec, /// The device ID which is initiating the request. - pub from_device: DeviceIdBox, + pub from_device: Box, /// The user ID which should receive the request. /// @@ -985,7 +985,7 @@ impl KeyVerificationRequestEventContent { pub fn new( body: String, methods: Vec, - from_device: DeviceIdBox, + from_device: Box, to: UserId, ) -> Self { Self { body, methods, from_device, to } diff --git a/crates/ruma-events/src/room/name.rs b/crates/ruma-events/src/room/name.rs index a556001d..e32bf845 100644 --- a/crates/ruma-events/src/room/name.rs +++ b/crates/ruma-events/src/room/name.rs @@ -1,7 +1,7 @@ //! Types for the `m.room.name` event. use ruma_events_macros::EventContent; -use ruma_identifiers::RoomNameBox; +use ruma_identifiers::RoomName; use serde::{Deserialize, Serialize}; /// The content of an `m.room.name` event. @@ -13,24 +13,24 @@ use serde::{Deserialize, Serialize}; pub struct RoomNameEventContent { /// The name of the room. #[serde(default, deserialize_with = "ruma_serde::empty_string_as_none")] - pub name: Option, + pub name: Option>, } impl RoomNameEventContent { /// Create a new `RoomNameEventContent` with the given name. - pub fn new(name: Option) -> Self { + pub fn new(name: Option>) -> Self { Self { name } } } #[cfg(test)] mod tests { - use std::convert::TryFrom; + use std::convert::TryInto; use js_int::{int, uint}; use matches::assert_matches; use ruma_common::MilliSecondsSinceUnixEpoch; - use ruma_identifiers::{event_id, room_id, user_id, RoomNameBox}; + use ruma_identifiers::{event_id, room_id, user_id}; use ruma_serde::Raw; use serde_json::{from_value as from_json_value, json, to_value as to_json_value}; @@ -40,7 +40,7 @@ mod tests { #[test] fn serialization_with_optional_fields_as_none() { let name_event = StateEvent { - content: RoomNameEventContent { name: RoomNameBox::try_from("The room name").ok() }, + content: RoomNameEventContent { name: "The room name".try_into().ok() }, event_id: event_id!("$h29iv0s8:example.com"), origin_server_ts: MilliSecondsSinceUnixEpoch(uint!(1)), prev_content: None, @@ -69,12 +69,10 @@ mod tests { #[test] fn serialization_with_all_fields() { let name_event = StateEvent { - content: RoomNameEventContent { name: RoomNameBox::try_from("The room name").ok() }, + content: RoomNameEventContent { name: "The room name".try_into().ok() }, event_id: event_id!("$h29iv0s8:example.com"), origin_server_ts: MilliSecondsSinceUnixEpoch(uint!(1)), - prev_content: Some(RoomNameEventContent { - name: RoomNameBox::try_from("The old name").ok(), - }), + prev_content: Some(RoomNameEventContent { name: "The old name".try_into().ok() }), room_id: room_id!("!n8f893n9:example.com"), sender: user_id!("@carl:example.com"), state_key: "".into(), @@ -141,7 +139,7 @@ mod tests { #[test] fn new_with_empty_name_creates_content_as_none() { assert_matches!( - RoomNameEventContent::new(RoomNameBox::try_from(String::new()).ok()), + RoomNameEventContent::new("".try_into().ok()), RoomNameEventContent { name: None } ); } @@ -186,7 +184,7 @@ mod tests { #[test] fn nonempty_field_as_some() { - let name = RoomNameBox::try_from("The room name").ok(); + let name = "The room name".try_into().ok(); let json_data = json!({ "content": { "name": "The room name" diff --git a/crates/ruma-events/src/room_key_request.rs b/crates/ruma-events/src/room_key_request.rs index ed3c1f8c..42ae5d9f 100644 --- a/crates/ruma-events/src/room_key_request.rs +++ b/crates/ruma-events/src/room_key_request.rs @@ -1,7 +1,7 @@ //! Types for the `m.room_key_request` event. use ruma_events_macros::EventContent; -use ruma_identifiers::{DeviceIdBox, EventEncryptionAlgorithm, RoomId}; +use ruma_identifiers::{DeviceId, EventEncryptionAlgorithm, RoomId}; use ruma_serde::StringEnum; use serde::{Deserialize, Serialize}; @@ -19,7 +19,7 @@ pub struct ToDeviceRoomKeyRequestEventContent { pub body: Option, /// ID of the device requesting the key. - pub requesting_device_id: DeviceIdBox, + pub requesting_device_id: Box, /// A random string uniquely identifying the request for a key. /// @@ -34,7 +34,7 @@ impl ToDeviceRoomKeyRequestEventContent { pub fn new( action: Action, body: Option, - requesting_device_id: DeviceIdBox, + requesting_device_id: Box, request_id: String, ) -> Self { Self { action, body, requesting_device_id, request_id } diff --git a/crates/ruma-events/src/secret/request.rs b/crates/ruma-events/src/secret/request.rs index 26511a51..17ea7611 100644 --- a/crates/ruma-events/src/secret/request.rs +++ b/crates/ruma-events/src/secret/request.rs @@ -3,7 +3,7 @@ use std::convert::TryFrom; use ruma_events_macros::EventContent; -use ruma_identifiers::DeviceIdBox; +use ruma_identifiers::DeviceId; use ruma_serde::StringEnum; use serde::{ser::SerializeStruct, Deserialize, Serialize}; @@ -21,7 +21,7 @@ pub struct ToDeviceSecretRequestEventContent { pub action: RequestAction, /// The ID of the device requesting the event. - pub requesting_device_id: DeviceIdBox, + pub requesting_device_id: Box, /// A random string uniquely identifying (with respect to the requester and the target) the /// target for a secret. @@ -36,7 +36,7 @@ impl ToDeviceSecretRequestEventContent { /// request ID. pub fn new( action: RequestAction, - requesting_device_id: DeviceIdBox, + requesting_device_id: Box, request_id: String, ) -> Self { Self { action, requesting_device_id, request_id } diff --git a/crates/ruma-events/src/space/child.rs b/crates/ruma-events/src/space/child.rs index 4154a1a5..ad72bad3 100644 --- a/crates/ruma-events/src/space/child.rs +++ b/crates/ruma-events/src/space/child.rs @@ -1,7 +1,7 @@ //! Types for the `m.space.child` event. use ruma_events_macros::EventContent; -use ruma_identifiers::ServerNameBox; +use ruma_identifiers::ServerName; use serde::{Deserialize, Serialize}; /// The content of an `m.space.child` event. @@ -17,7 +17,7 @@ use serde::{Deserialize, Serialize}; pub struct SpaceChildEventContent { /// List of candidate servers that can be used to join the room. #[serde(skip_serializing_if = "Option::is_none")] - pub via: Option>, + pub via: Option>>, /// Provide a default ordering of siblings in the room list. /// diff --git a/crates/ruma-events/src/space/parent.rs b/crates/ruma-events/src/space/parent.rs index 78388d75..37abe5b5 100644 --- a/crates/ruma-events/src/space/parent.rs +++ b/crates/ruma-events/src/space/parent.rs @@ -1,7 +1,7 @@ //! Types for the `m.space.child` event. use ruma_events_macros::EventContent; -use ruma_identifiers::ServerNameBox; +use ruma_identifiers::ServerName; use serde::{Deserialize, Serialize}; /// The content of an `m.space.parent` event. @@ -17,7 +17,7 @@ use serde::{Deserialize, Serialize}; pub struct SpaceParentEventContent { /// List of candidate servers that can be used to join the room. #[serde(skip_serializing_if = "Option::is_none")] - pub via: Option>, + pub via: Option>>, /// Determines whether this is the main parent for the space. /// diff --git a/crates/ruma-events/tests/initial_state.rs b/crates/ruma-events/tests/initial_state.rs index fba822fe..e248bb0d 100644 --- a/crates/ruma-events/tests/initial_state.rs +++ b/crates/ruma-events/tests/initial_state.rs @@ -2,7 +2,7 @@ use std::convert::TryFrom; use matches::assert_matches; use ruma_events::{AnyInitialStateEvent, InitialStateEvent}; -use ruma_identifiers::RoomNameBox; +use ruma_identifiers::RoomName; use serde_json::json; #[test] @@ -14,7 +14,7 @@ fn deserialize_initial_state_event() { })) .unwrap(), AnyInitialStateEvent::RoomName(InitialStateEvent { content, state_key}) - if content.name == Some(RoomNameBox::try_from("foo").unwrap()) + if content.name == Some(Box::::try_from("foo").unwrap()) && state_key.is_empty() ); } diff --git a/crates/ruma-events/tests/room_message.rs b/crates/ruma-events/tests/room_message.rs index f362bbc1..8a07c092 100644 --- a/crates/ruma-events/tests/room_message.rs +++ b/crates/ruma-events/tests/room_message.rs @@ -16,7 +16,7 @@ use ruma_events::{ Unsigned, }; #[cfg(feature = "unstable-pre-spec")] -use ruma_identifiers::DeviceIdBox; +use ruma_identifiers::DeviceId; use ruma_identifiers::{event_id, mxc_uri, room_id, user_id}; use serde_json::{from_value as from_json_value, json, to_value as to_json_value}; @@ -298,7 +298,7 @@ fn edit_deserialization_future() { #[cfg(feature = "unstable-pre-spec")] fn verification_request_deserialization() { let user_id = user_id!("@example2:localhost"); - let device_id: DeviceIdBox = "XOWLHHFSWM".into(); + let device_id: Box = "XOWLHHFSWM".into(); let json_data = json!({ "body": "@example:localhost is requesting to verify your key, ...", @@ -334,7 +334,7 @@ fn verification_request_deserialization() { #[cfg(feature = "unstable-pre-spec")] fn verification_request_serialization() { let user_id = user_id!("@example2:localhost"); - let device_id: DeviceIdBox = "XOWLHHFSWM".into(); + let device_id: Box = "XOWLHHFSWM".into(); let body = "@example:localhost is requesting to verify your key, ...".to_owned(); let methods = vec![ diff --git a/crates/ruma-events/tests/stripped.rs b/crates/ruma-events/tests/stripped.rs index b8874a2b..e19f560f 100644 --- a/crates/ruma-events/tests/stripped.rs +++ b/crates/ruma-events/tests/stripped.rs @@ -5,7 +5,7 @@ use ruma_events::{ room::{join_rules::JoinRule, topic::RoomTopicEventContent}, AnyStrippedStateEvent, StrippedStateEvent, }; -use ruma_identifiers::{mxc_uri, user_id, RoomNameBox}; +use ruma_identifiers::{mxc_uri, user_id, RoomName}; use serde_json::{from_value as from_json_value, json, to_value as to_json_value}; #[test] @@ -96,7 +96,7 @@ fn deserialize_stripped_state_events() { let event = from_json_value::(name_event).unwrap(); match event { AnyStrippedStateEvent::RoomName(event) => { - assert_eq!(event.content.name, Some(RoomNameBox::try_from("Ruma").unwrap())); + assert_eq!(event.content.name, Some(Box::::try_from("Ruma").unwrap())); assert_eq!(event.state_key, ""); assert_eq!(event.sender.to_string(), "@example:localhost"); } diff --git a/crates/ruma-federation-api/src/backfill/get_backfill/v1.rs b/crates/ruma-federation-api/src/backfill/get_backfill/v1.rs index 261a8290..bde8972e 100644 --- a/crates/ruma-federation-api/src/backfill/get_backfill/v1.rs +++ b/crates/ruma-federation-api/src/backfill/get_backfill/v1.rs @@ -3,7 +3,7 @@ use js_int::UInt; use ruma_api::ruma_api; use ruma_common::MilliSecondsSinceUnixEpoch; -use ruma_identifiers::{EventId, RoomId, ServerNameBox}; +use ruma_identifiers::{EventId, RoomId, ServerName}; use serde_json::value::RawValue as RawJsonValue; @@ -33,7 +33,7 @@ ruma_api! { response: { /// The `server_name` of the homeserver sending this transaction. - pub origin: ServerNameBox, + pub origin: Box, /// POSIX timestamp in milliseconds on originating homeserver when this transaction started. pub origin_server_ts: MilliSecondsSinceUnixEpoch, @@ -59,7 +59,7 @@ impl Response { /// * the timestamp in milliseconds of when this transaction started. /// * the list of persistent updates to rooms. pub fn new( - origin: ServerNameBox, + origin: Box, origin_server_ts: MilliSecondsSinceUnixEpoch, pdus: Vec>, ) -> Self { diff --git a/crates/ruma-federation-api/src/device/get_devices/v1.rs b/crates/ruma-federation-api/src/device/get_devices/v1.rs index a7fef362..66ef021a 100644 --- a/crates/ruma-federation-api/src/device/get_devices/v1.rs +++ b/crates/ruma-federation-api/src/device/get_devices/v1.rs @@ -3,7 +3,7 @@ use js_int::UInt; use ruma_api::ruma_api; use ruma_common::encryption::DeviceKeys; -use ruma_identifiers::{DeviceIdBox, UserId}; +use ruma_identifiers::{DeviceId, UserId}; use serde::{Deserialize, Serialize}; ruma_api! { @@ -60,7 +60,7 @@ impl Response { #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] pub struct UserDevice { /// The device ID. - pub device_id: DeviceIdBox, + pub device_id: Box, /// Identity keys for the device. pub keys: DeviceKeys, @@ -72,7 +72,7 @@ pub struct UserDevice { impl UserDevice { /// Creates a new `UserDevice` with the given device id and keys. - pub fn new(device_id: DeviceIdBox, keys: DeviceKeys) -> Self { + pub fn new(device_id: Box, keys: DeviceKeys) -> Self { Self { device_id, keys, device_display_name: None } } } diff --git a/crates/ruma-federation-api/src/discovery.rs b/crates/ruma-federation-api/src/discovery.rs index 2c0f2a89..b4558ac6 100644 --- a/crates/ruma-federation-api/src/discovery.rs +++ b/crates/ruma-federation-api/src/discovery.rs @@ -3,7 +3,7 @@ use std::collections::BTreeMap; use ruma_common::MilliSecondsSinceUnixEpoch; -use ruma_identifiers::{ServerNameBox, ServerSigningKeyId}; +use ruma_identifiers::{ServerName, ServerSigningKeyId}; use serde::{Deserialize, Serialize}; pub mod discover_homeserver; @@ -51,7 +51,7 @@ impl OldVerifyKey { #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] pub struct ServerSigningKeys { /// DNS name of the homeserver. - pub server_name: ServerNameBox, + pub server_name: Box, /// Public keys of the homeserver for verifying digital signatures. pub verify_keys: BTreeMap, @@ -61,8 +61,8 @@ pub struct ServerSigningKeys { /// Digital signatures of this object signed using the verify_keys. /// - /// Map of server name to keys by key ID - pub signatures: BTreeMap>, + /// Map of server name to keys by key ID. + pub signatures: BTreeMap, BTreeMap>, /// Timestamp when the keys should be refreshed. /// @@ -74,7 +74,7 @@ impl ServerSigningKeys { /// Creates a new `ServerSigningKeys` with the given server name and validity timestamp. /// /// All other fields will be empty. - pub fn new(server_name: ServerNameBox, valid_until_ts: MilliSecondsSinceUnixEpoch) -> Self { + pub fn new(server_name: Box, valid_until_ts: MilliSecondsSinceUnixEpoch) -> Self { Self { server_name, verify_keys: BTreeMap::new(), diff --git a/crates/ruma-federation-api/src/discovery/discover_homeserver.rs b/crates/ruma-federation-api/src/discovery/discover_homeserver.rs index 48047337..6b50b527 100644 --- a/crates/ruma-federation-api/src/discovery/discover_homeserver.rs +++ b/crates/ruma-federation-api/src/discovery/discover_homeserver.rs @@ -1,7 +1,7 @@ //! [GET /.well-known/matrix/server](https://matrix.org/docs/spec/server_server/r0.1.4#get-well-known-matrix-server) use ruma_api::ruma_api; -use ruma_identifiers::ServerNameBox; +use ruma_identifiers::ServerName; ruma_api! { metadata: { @@ -19,7 +19,7 @@ ruma_api! { response: { /// The server name to delegate server-server communications to, with optional port. #[serde(rename = "m.server")] - pub server: ServerNameBox, + pub server: Box, } } @@ -32,7 +32,7 @@ impl Request { impl Response { /// Creates a new `Response` with the given homeserver. - pub fn new(server: ServerNameBox) -> Self { + pub fn new(server: Box) -> Self { Self { server } } } diff --git a/crates/ruma-federation-api/src/discovery/get_remote_server_keys_batch/v2.rs b/crates/ruma-federation-api/src/discovery/get_remote_server_keys_batch/v2.rs index 04cbc67e..d64f221d 100644 --- a/crates/ruma-federation-api/src/discovery/get_remote_server_keys_batch/v2.rs +++ b/crates/ruma-federation-api/src/discovery/get_remote_server_keys_batch/v2.rs @@ -4,7 +4,7 @@ use std::collections::BTreeMap; use ruma_api::ruma_api; use ruma_common::MilliSecondsSinceUnixEpoch; -use ruma_identifiers::{ServerNameBox, ServerSigningKeyId}; +use ruma_identifiers::{ServerName, ServerSigningKeyId}; use serde::{Deserialize, Serialize}; use crate::discovery::ServerSigningKeys; @@ -28,7 +28,7 @@ ruma_api! { /// notary server must return an empty server_keys array in the response. /// /// The notary server may return multiple keys regardless of the Key IDs given. - pub server_keys: BTreeMap>, + pub server_keys: BTreeMap, BTreeMap>, } @@ -41,7 +41,7 @@ ruma_api! { impl Request { /// Creates a new `Request` with the given query criteria. pub fn new( - server_keys: BTreeMap>, + server_keys: BTreeMap, BTreeMap>, ) -> Self { Self { server_keys } } diff --git a/crates/ruma-federation-api/src/event/get_event/v1.rs b/crates/ruma-federation-api/src/event/get_event/v1.rs index 2ea3d72b..4f4a2c91 100644 --- a/crates/ruma-federation-api/src/event/get_event/v1.rs +++ b/crates/ruma-federation-api/src/event/get_event/v1.rs @@ -2,7 +2,7 @@ use ruma_api::ruma_api; use ruma_common::MilliSecondsSinceUnixEpoch; -use ruma_identifiers::{EventId, ServerNameBox}; +use ruma_identifiers::{EventId, ServerName}; use serde_json::value::RawValue as RawJsonValue; @@ -24,7 +24,7 @@ ruma_api! { response: { /// The `server_name` of the homeserver sending this transaction. - pub origin: ServerNameBox, + pub origin: Box, /// Time on originating homeserver when this transaction started. pub origin_server_ts: MilliSecondsSinceUnixEpoch, @@ -45,7 +45,7 @@ impl<'a> Request<'a> { impl Response { /// Creates a new `Response` with the given server name, timestamp, and event. pub fn new( - origin: ServerNameBox, + origin: Box, origin_server_ts: MilliSecondsSinceUnixEpoch, pdu: Box, ) -> Self { diff --git a/crates/ruma-federation-api/src/keys/claim_keys/v1.rs b/crates/ruma-federation-api/src/keys/claim_keys/v1.rs index 9c6600b5..b8cdaaea 100644 --- a/crates/ruma-federation-api/src/keys/claim_keys/v1.rs +++ b/crates/ruma-federation-api/src/keys/claim_keys/v1.rs @@ -5,7 +5,7 @@ use std::collections::BTreeMap; use ruma_api::ruma_api; use ruma_common::encryption::OneTimeKey; -use ruma_identifiers::{DeviceIdBox, DeviceKeyAlgorithm, DeviceKeyId, UserId}; +use ruma_identifiers::{DeviceId, DeviceKeyAlgorithm, DeviceKeyId, UserId}; use serde::{Deserialize, Serialize}; ruma_api! { @@ -44,10 +44,10 @@ impl Response { } /// A claim for one time keys -pub type OneTimeKeyClaims = BTreeMap>; +pub type OneTimeKeyClaims = BTreeMap, DeviceKeyAlgorithm>>; /// One time keys for use in pre-key messages -pub type OneTimeKeys = BTreeMap>>; +pub type OneTimeKeys = BTreeMap, BTreeMap>>; /// A key and its signature #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/crates/ruma-federation-api/src/keys/get_keys/v1.rs b/crates/ruma-federation-api/src/keys/get_keys/v1.rs index 1879cec3..f2cf5222 100644 --- a/crates/ruma-federation-api/src/keys/get_keys/v1.rs +++ b/crates/ruma-federation-api/src/keys/get_keys/v1.rs @@ -6,7 +6,7 @@ use ruma_api::ruma_api; #[cfg(feature = "unstable-pre-spec")] use ruma_common::encryption::CrossSigningKey; use ruma_common::encryption::DeviceKeys; -use ruma_identifiers::{DeviceIdBox, UserId}; +use ruma_identifiers::{DeviceId, UserId}; ruma_api! { metadata: { @@ -22,13 +22,13 @@ ruma_api! { /// The keys to be downloaded. /// /// Gives all keys for a given user if the list of device ids is empty. - pub device_keys: BTreeMap>, + pub device_keys: BTreeMap>>, } #[derive(Default)] response: { /// Keys from the queried devices. - pub device_keys: BTreeMap>, + pub device_keys: BTreeMap, DeviceKeys>>, /// Information on the master cross-signing keys of the queried users. #[cfg(feature = "unstable-pre-spec")] @@ -44,14 +44,14 @@ ruma_api! { impl Request { /// Creates a new `Request` asking for the given device keys. - pub fn new(device_keys: BTreeMap>) -> Self { + pub fn new(device_keys: BTreeMap>>) -> Self { Self { device_keys } } } impl Response { /// Creates a new `Response` with the given device keys. - pub fn new(device_keys: BTreeMap>) -> Self { + pub fn new(device_keys: BTreeMap, DeviceKeys>>) -> Self { Self { device_keys, ..Default::default() } } } diff --git a/crates/ruma-federation-api/src/query/get_room_information/v1.rs b/crates/ruma-federation-api/src/query/get_room_information/v1.rs index 3c112b41..8983babc 100644 --- a/crates/ruma-federation-api/src/query/get_room_information/v1.rs +++ b/crates/ruma-federation-api/src/query/get_room_information/v1.rs @@ -1,7 +1,7 @@ //! [GET /_matrix/federation/v1/query/directory](https://matrix.org/docs/spec/server_server/r0.1.4#get-matrix-federation-v1-query-directory) use ruma_api::ruma_api; -use ruma_identifiers::{RoomAliasId, RoomId, ServerNameBox}; +use ruma_identifiers::{RoomAliasId, RoomId, ServerName}; ruma_api! { metadata: { @@ -24,7 +24,7 @@ ruma_api! { pub room_id: RoomId, /// An array of server names that are likely to hold the given room. - pub servers: Vec, + pub servers: Vec>, } } @@ -37,7 +37,7 @@ impl<'a> Request<'a> { impl Response { /// Creates a new `Response` with the given room IDs and servers. - pub fn new(room_id: RoomId, servers: Vec) -> Self { + pub fn new(room_id: RoomId, servers: Vec>) -> Self { Self { room_id, servers } } } diff --git a/crates/ruma-federation-api/src/thirdparty/bind_callback/v1.rs b/crates/ruma-federation-api/src/thirdparty/bind_callback/v1.rs index ee68a7a1..34406e07 100644 --- a/crates/ruma-federation-api/src/thirdparty/bind_callback/v1.rs +++ b/crates/ruma-federation-api/src/thirdparty/bind_callback/v1.rs @@ -4,7 +4,7 @@ use std::collections::BTreeMap; use ruma_api::ruma_api; use ruma_common::thirdparty::Medium; -use ruma_identifiers::{RoomId, ServerNameBox, ServerSigningKeyId, UserId}; +use ruma_identifiers::{RoomId, ServerName, ServerSigningKeyId, UserId}; use serde::{Deserialize, Serialize}; ruma_api! { @@ -77,7 +77,7 @@ pub struct ThirdPartyInvite { pub sender: UserId, /// Signature from the identity server using a long-term private key. - pub signed: BTreeMap>, + pub signed: BTreeMap, BTreeMap>, } impl ThirdPartyInvite { @@ -87,7 +87,7 @@ impl ThirdPartyInvite { mxid: UserId, room_id: RoomId, sender: UserId, - signed: BTreeMap>, + signed: BTreeMap, BTreeMap>, ) -> Self { Self { medium: Medium::Email, address, mxid, room_id, sender, signed } } diff --git a/crates/ruma-federation-api/src/transactions/edu.rs b/crates/ruma-federation-api/src/transactions/edu.rs index e07b5892..28f92752 100644 --- a/crates/ruma-federation-api/src/transactions/edu.rs +++ b/crates/ruma-federation-api/src/transactions/edu.rs @@ -7,7 +7,7 @@ use ruma_common::{ encryption::DeviceKeys, presence::PresenceState, to_device::DeviceIdOrAllDevices, }; use ruma_events::{from_raw_json_value, receipt::Receipt, AnyToDeviceEventContent, EventType}; -use ruma_identifiers::{DeviceIdBox, EventId, RoomId, UserId}; +use ruma_identifiers::{DeviceId, EventId, RoomId, UserId}; use ruma_serde::Raw; use serde::{de, Deserialize, Serialize}; use serde_json::{value::RawValue as RawJsonValue, Value as JsonValue}; @@ -206,7 +206,7 @@ pub struct DeviceListUpdateContent { pub user_id: UserId, /// The ID of the device whose details are changing. - pub device_id: DeviceIdBox, + pub device_id: Box, /// The public human-readable name of this device. /// @@ -234,7 +234,7 @@ pub struct DeviceListUpdateContent { impl DeviceListUpdateContent { /// Create a new `DeviceListUpdateContent` with the given `user_id`, `device_id` and /// `stream_id`. - pub fn new(user_id: UserId, device_id: DeviceIdBox, stream_id: UInt) -> Self { + pub fn new(user_id: UserId, device_id: Box, stream_id: UInt) -> Self { Self { user_id, device_id, diff --git a/crates/ruma-identifiers/CHANGELOG.md b/crates/ruma-identifiers/CHANGELOG.md index 4b90e769..a33aa496 100644 --- a/crates/ruma-identifiers/CHANGELOG.md +++ b/crates/ruma-identifiers/CHANGELOG.md @@ -72,7 +72,7 @@ Breaking changes: Improvements: * Add `DeviceKeyId::from_parts` and `SigningKeyId::from_parts` -* Add `DeviceIdBox` and `ServerNameBox` type aliases +* Add `DeviceId` and `ServerNameBox` type aliases * Clean up debug logs for identifiers * Allow crypto algorithm enums to contain any string, for forwards compatibility and to allow experimentation with non-specified ones diff --git a/crates/ruma-identifiers/Cargo.toml b/crates/ruma-identifiers/Cargo.toml index 7a6cbd55..50fd5877 100644 --- a/crates/ruma-identifiers/Cargo.toml +++ b/crates/ruma-identifiers/Cargo.toml @@ -26,7 +26,6 @@ unstable-pre-spec = [] [dependencies] either = { version = "1.6.1", optional = true } -paste = "1.0.5" percent-encoding = "2.1.0" rand = { version = "0.8.3", optional = true } ruma-identifiers-macros = { version = "=0.20.0", path = "../ruma-identifiers-macros" } diff --git a/crates/ruma-identifiers/src/lib.rs b/crates/ruma-identifiers/src/lib.rs index c225125a..48f2f5ee 100644 --- a/crates/ruma-identifiers/src/lib.rs +++ b/crates/ruma-identifiers/src/lib.rs @@ -21,22 +21,22 @@ use serde::de::{self, Deserializer, Unexpected}; #[doc(inline)] pub use crate::{ - client_secret::{ClientSecret, ClientSecretBox}, + client_secret::ClientSecret, crypto_algorithms::{DeviceKeyAlgorithm, EventEncryptionAlgorithm, SigningKeyAlgorithm}, - device_id::{DeviceId, DeviceIdBox}, + device_id::DeviceId, device_key_id::DeviceKeyId, event_id::EventId, key_id::{DeviceSigningKeyId, KeyId, ServerSigningKeyId, SigningKeyId}, - key_name::{KeyName, KeyNameBox}, + key_name::KeyName, matrix_to::MatrixToRef, mxc_uri::MxcUri, room_alias_id::RoomAliasId, room_id::RoomId, room_id_or_room_alias_id::RoomIdOrAliasId, - room_name::{RoomName, RoomNameBox}, + room_name::RoomName, room_version_id::RoomVersionId, - server_name::{ServerName, ServerNameBox}, - session_id::{SessionId, SessionIdBox}, + server_name::ServerName, + session_id::SessionId, signatures::{DeviceSignatures, EntitySignatures, ServerSignatures, Signatures}, user_id::UserId, }; diff --git a/crates/ruma-identifiers/src/macros.rs b/crates/ruma-identifiers/src/macros.rs index 7c0430ae..a5dcb2d4 100644 --- a/crates/ruma-identifiers/src/macros.rs +++ b/crates/ruma-identifiers/src/macros.rs @@ -168,13 +168,6 @@ macro_rules! opaque_identifier { #[repr(transparent)] pub struct $id(str); - paste::paste! { - doc_concat! { - #[doc = concat!("An owned [", stringify!($id), "].")] - pub type [<$id Box>] = Box<$id>; - } - } - impl $id { fn from_borrowed(s: &str) -> &Self { unsafe { std::mem::transmute(s) } @@ -300,13 +293,6 @@ macro_rules! opaque_identifier_validated { #[cfg_attr(feature = "serde", derive(serde::Serialize), serde(transparent, crate = "serde"))] pub struct $id(str); - paste::paste! { - doc_concat! { - #[doc = concat!("An owned [", stringify!($id), "].")] - pub type [<$id Box>] = Box<$id>; - } - } - impl $id { #[allow(clippy::transmute_ptr_to_ptr)] fn from_borrowed(s: &str) -> &Self { diff --git a/crates/ruma-identifiers/src/signatures.rs b/crates/ruma-identifiers/src/signatures.rs index ec8cb5bf..85e31f37 100644 --- a/crates/ruma-identifiers/src/signatures.rs +++ b/crates/ruma-identifiers/src/signatures.rs @@ -1,6 +1,6 @@ use std::{borrow::Borrow, collections::BTreeMap}; -use crate::{DeviceIdBox, KeyNameBox, ServerNameBox, SigningKeyId, UserId}; +use crate::{DeviceId, KeyName, ServerName, SigningKeyId, UserId}; /// Map of key identifier to signature values. pub type EntitySignatures = BTreeMap, String>; @@ -52,7 +52,7 @@ impl Signatures { } /// Map of server signatures for an event, grouped by server. -pub type ServerSignatures = Signatures; +pub type ServerSignatures = Signatures, Box>; /// Map of device signatures for an event, grouped by user. -pub type DeviceSignatures = Signatures; +pub type DeviceSignatures = Signatures>; diff --git a/crates/ruma-identity-service-api/src/association/email/create_email_validation_session/v2.rs b/crates/ruma-identity-service-api/src/association/email/create_email_validation_session/v2.rs index fb9eaeaf..c8471b6b 100644 --- a/crates/ruma-identity-service-api/src/association/email/create_email_validation_session/v2.rs +++ b/crates/ruma-identity-service-api/src/association/email/create_email_validation_session/v2.rs @@ -2,7 +2,7 @@ use js_int::UInt; use ruma_api::ruma_api; -use ruma_identifiers::{ClientSecret, SessionIdBox}; +use ruma_identifiers::{ClientSecret, SessionId}; ruma_api! { metadata: { @@ -35,7 +35,7 @@ ruma_api! { /// The session ID. /// /// Session IDs are opaque strings generated by the identity server. - pub sid: SessionIdBox, + pub sid: Box, } } @@ -54,7 +54,7 @@ impl<'a> Request<'a> { impl Response { /// Create a new `Response` with the given session ID. - pub fn new(sid: SessionIdBox) -> Self { + pub fn new(sid: Box) -> Self { Self { sid } } } diff --git a/crates/ruma-identity-service-api/src/association/msisdn/create_msisdn_validation_session/v2.rs b/crates/ruma-identity-service-api/src/association/msisdn/create_msisdn_validation_session/v2.rs index ace3aa0c..f9bc9be2 100644 --- a/crates/ruma-identity-service-api/src/association/msisdn/create_msisdn_validation_session/v2.rs +++ b/crates/ruma-identity-service-api/src/association/msisdn/create_msisdn_validation_session/v2.rs @@ -2,7 +2,7 @@ use js_int::UInt; use ruma_api::ruma_api; -use ruma_identifiers::{ClientSecret, SessionIdBox}; +use ruma_identifiers::{ClientSecret, SessionId}; ruma_api! { metadata: { @@ -40,7 +40,7 @@ ruma_api! { /// The session ID. /// /// Session IDs are opaque strings generated by the identity server. - pub sid: SessionIdBox, + pub sid: Box, } } @@ -60,7 +60,7 @@ impl<'a> Request<'a> { impl Response { /// Create a new `Response` with the given session ID. - pub fn new(sid: SessionIdBox) -> Self { + pub fn new(sid: Box) -> Self { Self { sid } } } diff --git a/crates/ruma-identity-service-api/src/association/unbind_3pid/v2.rs b/crates/ruma-identity-service-api/src/association/unbind_3pid/v2.rs index e9701832..9153baf1 100644 --- a/crates/ruma-identity-service-api/src/association/unbind_3pid/v2.rs +++ b/crates/ruma-identity-service-api/src/association/unbind_3pid/v2.rs @@ -2,7 +2,7 @@ use ruma_api::ruma_api; use ruma_common::thirdparty::Medium; -use ruma_identifiers::{user_id::UserId, ClientSecretBox, SessionIdBox}; +use ruma_identifiers::{user_id::UserId, ClientSecret, SessionId}; use serde::{Deserialize, Serialize}; ruma_api! { @@ -81,15 +81,15 @@ impl ThirdPartyId { #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] pub struct ThreePidOwnershipProof { /// The Session ID generated by the `requestToken` call. - pub sid: SessionIdBox, + pub sid: Box, /// The client secret passed to the `requestToken` call. - pub client_secret: ClientSecretBox, + pub client_secret: Box, } impl ThreePidOwnershipProof { /// Creates a new `ThreePidOwnershipProof` with the given session ID and client secret. - pub fn new(sid: SessionIdBox, client_secret: ClientSecretBox) -> Self { + pub fn new(sid: Box, client_secret: Box) -> Self { Self { sid, client_secret } } } diff --git a/crates/ruma-signatures/src/error.rs b/crates/ruma-signatures/src/error.rs index 47f4820f..9d196429 100644 --- a/crates/ruma-signatures/src/error.rs +++ b/crates/ruma-signatures/src/error.rs @@ -1,4 +1,4 @@ -use ruma_identifiers::{EventId, RoomVersionId, ServerNameBox}; +use ruma_identifiers::{EventId, RoomVersionId, ServerName}; use thiserror::Error; /// `ruma-signature`'s error type, wraps a number of other error types. @@ -136,11 +136,11 @@ pub enum JsonType { pub enum VerificationError { /// For when a signature cannot be found for a `target`. #[error("Could not find signatures for {0:?}")] - SignatureNotFound(ServerNameBox), + SignatureNotFound(Box), /// For when a public key cannot be found for a `target`. #[error("Could not find public key for {0:?}")] - PublicKeyNotFound(ServerNameBox), + PublicKeyNotFound(Box), /// For when no public key matches the signature given. #[error("Not signed with any of the given public keys")] @@ -152,11 +152,11 @@ pub enum VerificationError { } impl VerificationError { - pub(crate) fn signature_not_found>(target: T) -> Error { + pub(crate) fn signature_not_found>>(target: T) -> Error { Self::SignatureNotFound(target.into()).into() } - pub(crate) fn public_key_not_found>(target: T) -> Error { + pub(crate) fn public_key_not_found>>(target: T) -> Error { Self::PublicKeyNotFound(target.into()).into() } } diff --git a/crates/ruma-signatures/src/functions.rs b/crates/ruma-signatures/src/functions.rs index 9ee7d2c6..a3debcc2 100644 --- a/crates/ruma-signatures/src/functions.rs +++ b/crates/ruma-signatures/src/functions.rs @@ -9,7 +9,7 @@ use std::{ use base64::{decode_config, encode_config, Config, STANDARD_NO_PAD, URL_SAFE_NO_PAD}; use ed25519_dalek::Digest; -use ruma_identifiers::{EventId, RoomVersionId, ServerNameBox, UserId}; +use ruma_identifiers::{EventId, RoomVersionId, ServerName, UserId}; use ruma_serde::{CanonicalJsonObject, CanonicalJsonValue}; use serde_json::{from_str as from_json_str, to_string as to_json_string}; use sha2::Sha256; @@ -774,7 +774,7 @@ pub fn redact( fn servers_to_check_signatures( object: &CanonicalJsonObject, version: &RoomVersionId, -) -> Result, Error> { +) -> Result>, Error> { let mut servers_to_check = BTreeSet::new(); if !is_third_party_invite(object)? { diff --git a/crates/ruma/src/lib.rs b/crates/ruma/src/lib.rs index 89dfd6c8..3e7a83dc 100644 --- a/crates/ruma/src/lib.rs +++ b/crates/ruma/src/lib.rs @@ -83,11 +83,10 @@ pub use ruma_serde::Outgoing; pub use ruma_identifiers::{ device_id, device_key_id, event_id, mxc_uri, room_alias_id, room_id, room_version_id, - server_name, server_signing_key_id, user_id, ClientSecret, ClientSecretBox, DeviceId, - DeviceIdBox, DeviceKeyAlgorithm, DeviceKeyId, DeviceSignatures, DeviceSigningKeyId, - EntitySignatures, EventEncryptionAlgorithm, EventId, KeyId, KeyName, KeyNameBox, MxcUri, - RoomAliasId, RoomId, RoomIdOrAliasId, RoomVersionId, ServerName, ServerNameBox, - ServerSignatures, ServerSigningKeyId, SessionId, SessionIdBox, Signatures, SigningKeyAlgorithm, + server_name, server_signing_key_id, user_id, ClientSecret, DeviceId, DeviceKeyAlgorithm, + DeviceKeyId, DeviceSignatures, DeviceSigningKeyId, EntitySignatures, EventEncryptionAlgorithm, + EventId, KeyId, KeyName, MxcUri, RoomAliasId, RoomId, RoomIdOrAliasId, RoomVersionId, + ServerName, ServerSignatures, ServerSigningKeyId, SessionId, Signatures, SigningKeyAlgorithm, UserId, };