client-api: Use Signatures in more places

This commit is contained in:
Kévin Commaille 2024-10-26 16:27:13 +02:00 committed by strawberry
parent 0d1d549cf6
commit 5ed3718310
3 changed files with 7 additions and 7 deletions

View File

@ -24,6 +24,8 @@ Breaking changes:
- Use `OwnedCrossSigningOrDeviceSigningKeyId` instead of `OwnedDeviceKeyId` to
identify signing keys in `BackupAlgorithm::MegolmBackupV1Curve25519AesSha2`'s
`signatures`.
- Use `CrossSigningOrDeviceSignatures` for the `signatures` of `BackupAlgorithm`.
- Use `ServerSignatures` for the `signatures` of `ThirdPartySigned`.
Improvements:

View File

@ -20,7 +20,7 @@ use std::collections::BTreeMap;
use js_int::UInt;
use ruma_common::{
serde::{Base64, Raw},
OwnedCrossSigningOrDeviceSigningKeyId, OwnedUserId,
CrossSigningOrDeviceSignatures,
};
use serde::{Deserialize, Serialize};
@ -51,7 +51,7 @@ pub enum BackupAlgorithm {
public_key: Base64,
/// Signatures of the auth_data as Signed JSON.
signatures: BTreeMap<OwnedUserId, BTreeMap<OwnedCrossSigningOrDeviceSigningKeyId, String>>,
signatures: CrossSigningOrDeviceSignatures,
},
}

View File

@ -14,9 +14,7 @@ pub mod leave_room;
pub mod mutual_rooms;
pub mod unban_user;
use std::collections::BTreeMap;
use ruma_common::{thirdparty::Medium, OwnedServerName, OwnedServerSigningKeyId, OwnedUserId};
use ruma_common::{thirdparty::Medium, OwnedUserId, ServerSignatures};
use serde::{Deserialize, Serialize};
/// 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,
/// A signatures object containing a signature of the entire signed object.
pub signatures: BTreeMap<OwnedServerName, BTreeMap<OwnedServerSigningKeyId, String>>,
pub signatures: ServerSignatures,
}
impl ThirdPartySigned {
@ -44,7 +42,7 @@ impl ThirdPartySigned {
sender: OwnedUserId,
mxid: OwnedUserId,
token: String,
signatures: BTreeMap<OwnedServerName, BTreeMap<OwnedServerSigningKeyId, String>>,
signatures: ServerSignatures,
) -> Self {
Self { sender, mxid, token, signatures }
}