client-api: Use Signatures in more places
This commit is contained in:
parent
0d1d549cf6
commit
5ed3718310
@ -24,6 +24,8 @@ Breaking changes:
|
|||||||
- Use `OwnedCrossSigningOrDeviceSigningKeyId` instead of `OwnedDeviceKeyId` to
|
- Use `OwnedCrossSigningOrDeviceSigningKeyId` instead of `OwnedDeviceKeyId` to
|
||||||
identify signing keys in `BackupAlgorithm::MegolmBackupV1Curve25519AesSha2`'s
|
identify signing keys in `BackupAlgorithm::MegolmBackupV1Curve25519AesSha2`'s
|
||||||
`signatures`.
|
`signatures`.
|
||||||
|
- Use `CrossSigningOrDeviceSignatures` for the `signatures` of `BackupAlgorithm`.
|
||||||
|
- Use `ServerSignatures` for the `signatures` of `ThirdPartySigned`.
|
||||||
|
|
||||||
Improvements:
|
Improvements:
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ use std::collections::BTreeMap;
|
|||||||
use js_int::UInt;
|
use js_int::UInt;
|
||||||
use ruma_common::{
|
use ruma_common::{
|
||||||
serde::{Base64, Raw},
|
serde::{Base64, Raw},
|
||||||
OwnedCrossSigningOrDeviceSigningKeyId, OwnedUserId,
|
CrossSigningOrDeviceSignatures,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ pub enum BackupAlgorithm {
|
|||||||
public_key: Base64,
|
public_key: Base64,
|
||||||
|
|
||||||
/// Signatures of the auth_data as Signed JSON.
|
/// Signatures of the auth_data as Signed JSON.
|
||||||
signatures: BTreeMap<OwnedUserId, BTreeMap<OwnedCrossSigningOrDeviceSigningKeyId, String>>,
|
signatures: CrossSigningOrDeviceSignatures,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,9 +14,7 @@ pub mod leave_room;
|
|||||||
pub mod mutual_rooms;
|
pub mod mutual_rooms;
|
||||||
pub mod unban_user;
|
pub mod unban_user;
|
||||||
|
|
||||||
use std::collections::BTreeMap;
|
use ruma_common::{thirdparty::Medium, OwnedUserId, ServerSignatures};
|
||||||
|
|
||||||
use ruma_common::{thirdparty::Medium, OwnedServerName, OwnedServerSigningKeyId, OwnedUserId};
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
/// A signature of an `m.third_party_invite` token to prove that this user owns a third party
|
/// A signature of an `m.third_party_invite` token to prove that this user owns a third party
|
||||||
@ -34,7 +32,7 @@ pub struct ThirdPartySigned {
|
|||||||
pub token: String,
|
pub token: String,
|
||||||
|
|
||||||
/// A signatures object containing a signature of the entire signed object.
|
/// A signatures object containing a signature of the entire signed object.
|
||||||
pub signatures: BTreeMap<OwnedServerName, BTreeMap<OwnedServerSigningKeyId, String>>,
|
pub signatures: ServerSignatures,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ThirdPartySigned {
|
impl ThirdPartySigned {
|
||||||
@ -44,7 +42,7 @@ impl ThirdPartySigned {
|
|||||||
sender: OwnedUserId,
|
sender: OwnedUserId,
|
||||||
mxid: OwnedUserId,
|
mxid: OwnedUserId,
|
||||||
token: String,
|
token: String,
|
||||||
signatures: BTreeMap<OwnedServerName, BTreeMap<OwnedServerSigningKeyId, String>>,
|
signatures: ServerSignatures,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self { sender, mxid, token, signatures }
|
Self { sender, mxid, token, signatures }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user