From 5ed371831094cb9c17457c6fecabd3bb4cd8bb2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sat, 26 Oct 2024 16:27:13 +0200 Subject: [PATCH] client-api: Use Signatures in more places --- crates/ruma-client-api/CHANGELOG.md | 2 ++ crates/ruma-client-api/src/backup.rs | 4 ++-- crates/ruma-client-api/src/membership.rs | 8 +++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/ruma-client-api/CHANGELOG.md b/crates/ruma-client-api/CHANGELOG.md index b98d3b4b..6abc45bb 100644 --- a/crates/ruma-client-api/CHANGELOG.md +++ b/crates/ruma-client-api/CHANGELOG.md @@ -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: diff --git a/crates/ruma-client-api/src/backup.rs b/crates/ruma-client-api/src/backup.rs index caaad95b..3e4d3f02 100644 --- a/crates/ruma-client-api/src/backup.rs +++ b/crates/ruma-client-api/src/backup.rs @@ -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>, + signatures: CrossSigningOrDeviceSignatures, }, } diff --git a/crates/ruma-client-api/src/membership.rs b/crates/ruma-client-api/src/membership.rs index 3e0ec168..008b9499 100644 --- a/crates/ruma-client-api/src/membership.rs +++ b/crates/ruma-client-api/src/membership.rs @@ -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>, + pub signatures: ServerSignatures, } impl ThirdPartySigned { @@ -44,7 +42,7 @@ impl ThirdPartySigned { sender: OwnedUserId, mxid: OwnedUserId, token: String, - signatures: BTreeMap>, + signatures: ServerSignatures, ) -> Self { Self { sender, mxid, token, signatures } }