Use ServerNameBox in ruma-events, ruma-*-api
This commit is contained in:
parent
b4b96e44fd
commit
148d876acb
@ -3,7 +3,7 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use ruma_api::ruma_api;
|
||||
use ruma_identifiers::{ServerName, UserId};
|
||||
use ruma_identifiers::{ServerNameBox, UserId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
@ -30,7 +30,7 @@ ruma_api! {
|
||||
pub token_type: TokenType,
|
||||
|
||||
/// Homeserver domain for verification of user's identity.
|
||||
pub matrix_server_name: Box<ServerName>,
|
||||
pub matrix_server_name: ServerNameBox,
|
||||
|
||||
/// Seconds until token expiration.
|
||||
#[serde(with = "ruma_serde::duration::secs")]
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! [POST /_matrix/client/r0/join/{roomIdOrAlias}](https://matrix.org/docs/spec/client_server/r0.6.0#post-matrix-client-r0-join-roomidoralias)
|
||||
|
||||
use ruma_api::ruma_api;
|
||||
use ruma_identifiers::{RoomId, RoomIdOrAliasId, ServerName};
|
||||
use ruma_identifiers::{RoomId, RoomIdOrAliasId, ServerNameBox};
|
||||
|
||||
use super::{IncomingThirdPartySigned, ThirdPartySigned};
|
||||
|
||||
@ -24,7 +24,7 @@ ruma_api! {
|
||||
/// must be participating in the room.
|
||||
#[ruma_api(query)]
|
||||
#[serde(default)]
|
||||
pub server_name: &'a [Box<ServerName>],
|
||||
pub server_name: &'a [ServerNameBox],
|
||||
|
||||
/// 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.
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use ruma_api::{ruma_api, Outgoing};
|
||||
use ruma_common::thirdparty::Medium;
|
||||
use ruma_identifiers::{DeviceId, DeviceIdBox, ServerName, UserId};
|
||||
use ruma_identifiers::{DeviceId, DeviceIdBox, ServerNameBox, UserId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
@ -46,7 +46,7 @@ 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<Box<ServerName>>,
|
||||
pub home_server: Option<ServerNameBox>,
|
||||
|
||||
/// ID of the logged-in device.
|
||||
///
|
||||
|
@ -12,7 +12,7 @@ use std::{collections::BTreeMap, time::SystemTime};
|
||||
|
||||
use js_int::UInt;
|
||||
use ruma_events::EventType;
|
||||
use ruma_identifiers::{EventId, RoomId, ServerKeyId, ServerName, UserId};
|
||||
use ruma_identifiers::{EventId, RoomId, ServerKeyId, ServerNameBox, UserId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Value as JsonValue;
|
||||
|
||||
@ -84,7 +84,7 @@ pub struct RoomV1Pdu {
|
||||
pub hashes: EventHash,
|
||||
|
||||
/// Signatures for the PDU.
|
||||
pub signatures: BTreeMap<Box<ServerName>, BTreeMap<ServerKeyId, String>>,
|
||||
pub signatures: BTreeMap<ServerNameBox, BTreeMap<ServerKeyId, String>>,
|
||||
}
|
||||
|
||||
/// A 'persistent data unit' (event) for room versions 3 and beyond.
|
||||
@ -140,7 +140,7 @@ pub struct RoomV3Pdu {
|
||||
pub hashes: EventHash,
|
||||
|
||||
/// Signatures for the PDU.
|
||||
pub signatures: BTreeMap<Box<ServerName>, BTreeMap<ServerKeyId, String>>,
|
||||
pub signatures: BTreeMap<ServerNameBox, BTreeMap<ServerKeyId, String>>,
|
||||
}
|
||||
|
||||
/// PDU type without event and room IDs.
|
||||
@ -216,7 +216,7 @@ pub struct RoomV1PduStub {
|
||||
pub hashes: EventHash,
|
||||
|
||||
/// Signatures for the PDU.
|
||||
pub signatures: BTreeMap<Box<ServerName>, BTreeMap<ServerKeyId, String>>,
|
||||
pub signatures: BTreeMap<ServerNameBox, BTreeMap<ServerKeyId, String>>,
|
||||
}
|
||||
|
||||
impl RoomV1PduStub {
|
||||
@ -292,7 +292,7 @@ pub struct RoomV3PduStub {
|
||||
pub hashes: EventHash,
|
||||
|
||||
/// Signatures for the PDU.
|
||||
pub signatures: BTreeMap<Box<ServerName>, BTreeMap<ServerKeyId, String>>,
|
||||
pub signatures: BTreeMap<ServerNameBox, BTreeMap<ServerKeyId, String>>,
|
||||
}
|
||||
|
||||
impl RoomV3PduStub {
|
||||
|
@ -3,7 +3,7 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use ruma_events_macros::StateEventContent;
|
||||
use ruma_identifiers::{ServerKeyId, ServerName, UserId};
|
||||
use ruma_identifiers::{ServerKeyId, ServerNameBox, UserId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use strum::{Display, EnumString};
|
||||
|
||||
@ -108,7 +108,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<Box<ServerName>, BTreeMap<ServerKeyId, String>>,
|
||||
pub signatures: BTreeMap<ServerNameBox, BTreeMap<ServerKeyId, String>>,
|
||||
|
||||
/// The token property of the containing third_party_invite object.
|
||||
pub token: String,
|
||||
|
@ -5,7 +5,7 @@ use std::time::SystemTime;
|
||||
use js_int::UInt;
|
||||
use ruma_api::ruma_api;
|
||||
use ruma_events::pdu::Pdu;
|
||||
use ruma_identifiers::{EventId, RoomId, ServerName};
|
||||
use ruma_identifiers::{EventId, RoomId, ServerNameBox};
|
||||
|
||||
ruma_api! {
|
||||
metadata: {
|
||||
@ -33,7 +33,7 @@ ruma_api! {
|
||||
|
||||
response: {
|
||||
/// The `server_name` of the homeserver sending this transaction.
|
||||
pub origin: Box<ServerName>,
|
||||
pub origin: ServerNameBox,
|
||||
|
||||
/// POSIX timestamp in milliseconds on originating homeserver when this transaction started.
|
||||
#[serde(with = "ruma_serde::time::ms_since_unix_epoch")]
|
||||
@ -59,7 +59,7 @@ impl Response {
|
||||
/// * the `server_name` of the homeserver.
|
||||
/// * the timestamp in milliseconds of when this transaction started.
|
||||
/// * the list of persistent updates to rooms.
|
||||
pub fn new(origin: Box<ServerName>, origin_server_ts: SystemTime, pdus: Vec<Pdu>) -> Self {
|
||||
pub fn new(origin: ServerNameBox, origin_server_ts: SystemTime, pdus: Vec<Pdu>) -> Self {
|
||||
Self { origin, origin_server_ts, pdus }
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use std::{collections::BTreeMap, time::SystemTime};
|
||||
|
||||
use ruma_identifiers::{ServerKeyId, ServerName};
|
||||
use ruma_identifiers::{ServerKeyId, ServerNameBox};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
pub mod discover_homeserver;
|
||||
@ -34,14 +34,14 @@ pub struct OldVerifyKey {
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct ServerKey {
|
||||
/// DNS name of the homeserver.
|
||||
pub server_name: Box<ServerName>,
|
||||
pub server_name: ServerNameBox,
|
||||
/// Public keys of the homeserver for verifying digital signatures.
|
||||
pub verify_keys: BTreeMap<String, VerifyKey>,
|
||||
/// Public keys that the homeserver used to use and when it stopped using them.
|
||||
pub old_verify_keys: BTreeMap<String, OldVerifyKey>,
|
||||
/// Digital signatures of this object signed using the verify_keys. Map of
|
||||
/// server name to keys by key ID
|
||||
pub signatures: BTreeMap<Box<ServerName>, BTreeMap<ServerKeyId, String>>,
|
||||
pub signatures: BTreeMap<ServerNameBox, BTreeMap<ServerKeyId, String>>,
|
||||
/// Timestamp when the keys should be refreshed. This field MUST be ignored in room
|
||||
/// versions 1, 2, 3, and 4.
|
||||
#[serde(with = "ruma_serde::time::ms_since_unix_epoch")]
|
||||
|
@ -4,7 +4,7 @@ use std::{collections::BTreeMap, time::SystemTime};
|
||||
|
||||
use crate::discovery::ServerKey;
|
||||
use ruma_api::ruma_api;
|
||||
use ruma_identifiers::{ServerKeyId, ServerName};
|
||||
use ruma_identifiers::{ServerKeyId, ServerNameBox};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
@ -28,7 +28,7 @@ ruma_api! {
|
||||
/// The notary server may return multiple keys regardless of the Key IDs
|
||||
/// given.
|
||||
#[ruma_api(body)]
|
||||
pub server_keys: BTreeMap<Box<ServerName>, BTreeMap<ServerKeyId, QueryCriteria>>,
|
||||
pub server_keys: BTreeMap<ServerNameBox, BTreeMap<ServerKeyId, QueryCriteria>>,
|
||||
|
||||
/// A millisecond POSIX timestamp in milliseconds indicating when the
|
||||
/// returned certificates will need to be valid until to be useful to
|
||||
|
Loading…
x
Reference in New Issue
Block a user