federation-api: Remove KeyObject
It is unused and is actually supposed to be the same type as `ruma_common::encryption::SignedKey`.
This commit is contained in:
parent
60b92e8e1d
commit
5627c5109e
@ -1,5 +1,10 @@
|
|||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
Breaking changes:
|
||||||
|
|
||||||
|
- Remove the unused `KeyObject` struct. It is actually supposed to be the same type
|
||||||
|
as `ruma_common::encryption::SignedKey`.
|
||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
|
|
||||||
- `ServerSigningKeys` can be deserialized when `old_verify_keys` is missing, due to a
|
- `ServerSigningKeys` can be deserialized when `old_verify_keys` is missing, due to a
|
||||||
|
@ -13,10 +13,9 @@ pub mod v1 {
|
|||||||
api::{request, response, Metadata},
|
api::{request, response, Metadata},
|
||||||
encryption::OneTimeKey,
|
encryption::OneTimeKey,
|
||||||
metadata,
|
metadata,
|
||||||
serde::{Base64, Raw},
|
serde::Raw,
|
||||||
DeviceKeyAlgorithm, OwnedDeviceId, OwnedDeviceKeyId, OwnedUserId,
|
DeviceKeyAlgorithm, OwnedDeviceId, OwnedDeviceKeyId, OwnedUserId,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
const METADATA: Metadata = metadata! {
|
const METADATA: Metadata = metadata! {
|
||||||
method: POST,
|
method: POST,
|
||||||
@ -61,25 +60,4 @@ pub mod v1 {
|
|||||||
/// One time keys for use in pre-key messages
|
/// One time keys for use in pre-key messages
|
||||||
pub type OneTimeKeys =
|
pub type OneTimeKeys =
|
||||||
BTreeMap<OwnedUserId, BTreeMap<OwnedDeviceId, BTreeMap<OwnedDeviceKeyId, Raw<OneTimeKey>>>>;
|
BTreeMap<OwnedUserId, BTreeMap<OwnedDeviceId, BTreeMap<OwnedDeviceKeyId, Raw<OneTimeKey>>>>;
|
||||||
|
|
||||||
/// A key and its signature
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
||||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
|
||||||
pub struct KeyObject {
|
|
||||||
/// The key, encoded using unpadded base64.
|
|
||||||
pub key: Base64,
|
|
||||||
|
|
||||||
/// Signature of the key object.
|
|
||||||
pub signatures: BTreeMap<OwnedUserId, BTreeMap<OwnedDeviceKeyId, String>>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl KeyObject {
|
|
||||||
/// Creates a new `KeyObject` with the given key and signatures.
|
|
||||||
pub fn new(
|
|
||||||
key: Base64,
|
|
||||||
signatures: BTreeMap<OwnedUserId, BTreeMap<OwnedDeviceKeyId, String>>,
|
|
||||||
) -> Self {
|
|
||||||
Self { key, signatures }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user