Fix last commit not building with the unstable-pre-spec feature
This commit is contained in:
parent
a74dddd93b
commit
9384d24d04
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
use std::{collections::BTreeMap, fmt::Debug};
|
use std::{collections::BTreeMap, fmt::Debug};
|
||||||
|
|
||||||
use ruma_api::Outgoing;
|
|
||||||
use ruma_events::Algorithm;
|
use ruma_events::Algorithm;
|
||||||
use ruma_identifiers::{DeviceId, DeviceKeyId, UserId};
|
use ruma_identifiers::{DeviceId, DeviceKeyId, UserId};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@ -70,13 +69,13 @@ pub enum OneTimeKey {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A cross signing key.
|
/// A cross signing key.
|
||||||
#[derive(Clone, Debug, Outgoing, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct CrossSigningKey<'a> {
|
pub struct CrossSigningKey {
|
||||||
/// The ID of the user the key belongs to.
|
/// The ID of the user the key belongs to.
|
||||||
pub user_id: &'a UserId,
|
pub user_id: UserId,
|
||||||
|
|
||||||
/// What the key is used for.
|
/// What the key is used for.
|
||||||
pub usage: &'a [KeyUsage],
|
pub usage: Vec<KeyUsage>,
|
||||||
|
|
||||||
/// The public key. The object must have exactly one property.
|
/// The public key. The object must have exactly one property.
|
||||||
pub keys: BTreeMap<String, String>,
|
pub keys: BTreeMap<String, String>,
|
||||||
|
@ -6,6 +6,8 @@ use ruma_api::ruma_api;
|
|||||||
use ruma_identifiers::{DeviceId, UserId};
|
use ruma_identifiers::{DeviceId, UserId};
|
||||||
use serde_json::Value as JsonValue;
|
use serde_json::Value as JsonValue;
|
||||||
|
|
||||||
|
#[cfg(feature = "unstable-pre-spec")]
|
||||||
|
use super::CrossSigningKey;
|
||||||
use super::DeviceKeys;
|
use super::DeviceKeys;
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
@ -55,17 +57,17 @@ ruma_api! {
|
|||||||
/// Information on the master cross-signing keys of the queried users.
|
/// Information on the master cross-signing keys of the queried users.
|
||||||
#[cfg(feature = "unstable-pre-spec")]
|
#[cfg(feature = "unstable-pre-spec")]
|
||||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||||
pub master_keys: BTreeMap<UserId, super::CrossSigningKey>,
|
pub master_keys: BTreeMap<UserId, CrossSigningKey>,
|
||||||
|
|
||||||
/// Information on the self-signing keys of the queried users.
|
/// Information on the self-signing keys of the queried users.
|
||||||
#[cfg(feature = "unstable-pre-spec")]
|
#[cfg(feature = "unstable-pre-spec")]
|
||||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||||
pub self_signing_keys: BTreeMap<UserId, super::CrossSigningKey>,
|
pub self_signing_keys: BTreeMap<UserId, CrossSigningKey>,
|
||||||
|
|
||||||
/// Information on the user-signing keys of the queried users.
|
/// Information on the user-signing keys of the queried users.
|
||||||
#[cfg(feature = "unstable-pre-spec")]
|
#[cfg(feature = "unstable-pre-spec")]
|
||||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||||
pub user_signing_keys: BTreeMap<UserId, super::CrossSigningKey>,
|
pub user_signing_keys: BTreeMap<UserId, CrossSigningKey>,
|
||||||
}
|
}
|
||||||
|
|
||||||
error: crate::Error
|
error: crate::Error
|
||||||
|
@ -22,17 +22,17 @@ ruma_api! {
|
|||||||
|
|
||||||
/// The user's master key.
|
/// The user's master key.
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub master_key: Option<CrossSigningKey<'a>>,
|
pub master_key: Option<CrossSigningKey>,
|
||||||
|
|
||||||
/// The user's self-signing key. Must be signed with the accompanied master, or by the
|
/// The user's self-signing key. Must be signed with the accompanied master, or by the
|
||||||
/// user's most recently uploaded master key if no master key is included in the request.
|
/// user's most recently uploaded master key if no master key is included in the request.
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub self_signing_key: Option<CrossSigningKey<'a>>,
|
pub self_signing_key: Option<CrossSigningKey>,
|
||||||
|
|
||||||
/// The user's user-signing key. Must be signed with the accompanied master, or by the
|
/// The user's user-signing key. Must be signed with the accompanied master, or by the
|
||||||
/// user's most recently uploaded master key if no master key is included in the request.
|
/// user's most recently uploaded master key if no master key is included in the request.
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub user_signing_key: Option<CrossSigningKey<'a>>,
|
pub user_signing_key: Option<CrossSigningKey>,
|
||||||
}
|
}
|
||||||
|
|
||||||
response: {}
|
response: {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user