diff --git a/native/native_rust_library/src/backup.rs b/native/native_rust_library/src/backup.rs --- a/native/native_rust_library/src/backup.rs +++ b/native/native_rust_library/src/backup.rs @@ -241,7 +241,7 @@ .download_backup_data(&latest_backup_descriptor, RequestedData::BackupID) .await?; - let LatestBackupIDResponse { backup_id } = + let LatestBackupIDResponse { backup_id, .. } = serde_json::from_slice(&backup_id_response)?; let mut backup_key = compute_backup_key_str(&backup_secret, &backup_id)?; diff --git a/services/backup/src/database/backup_item.rs b/services/backup/src/database/backup_item.rs --- a/services/backup/src/database/backup_item.rs +++ b/services/backup/src/database/backup_item.rs @@ -182,6 +182,7 @@ pub created: DateTime, pub backup_id: String, pub user_keys: BlobInfo, + pub siwe_backup_msg: Option, } impl TryFrom> for OrderedBackupItem { @@ -208,11 +209,15 @@ value.remove(backup_table::attr::USER_KEYS), )?; + let siwe_backup_msg: Option = + value.take_attr(backup_table::attr::SIWE_BACKUP_MSG)?; + Ok(OrderedBackupItem { user_id, created, backup_id, user_keys, + siwe_backup_msg, }) } } diff --git a/services/backup/src/http/handlers/backup.rs b/services/backup/src/http/handlers/backup.rs --- a/services/backup/src/http/handlers/backup.rs +++ b/services/backup/src/http/handlers/backup.rs @@ -291,6 +291,7 @@ let response = LatestBackupIDResponse { backup_id: backup_item.backup_id, + siwe_backup_msg: backup_item.siwe_backup_msg, }; Ok(web::Json(response)) diff --git a/shared/comm-lib/src/backup/mod.rs b/shared/comm-lib/src/backup/mod.rs --- a/shared/comm-lib/src/backup/mod.rs +++ b/shared/comm-lib/src/backup/mod.rs @@ -2,9 +2,12 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct LatestBackupIDResponse { #[serde(rename = "backupID")] pub backup_id: String, + + pub siwe_backup_msg: Option, } #[derive(Debug, Clone, Serialize, Deserialize)]