Page MenuHomePhabricator

D13808.id45430.diff
No OneTemporary

D13808.id45430.diff

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
@@ -331,7 +331,7 @@
let user_identity = get_user_identity_from_secure_store()?;
let latest_backup_descriptor = BackupDescriptor::Latest {
- username: user_identity.user_id.clone(),
+ user_identifier: user_identity.user_id.clone(),
};
let backup_id_response = backup_client
@@ -357,7 +357,7 @@
let user_identity = get_user_identity_from_secure_store()?;
let latest_backup_descriptor = BackupDescriptor::Latest {
- username: user_identity.user_id.clone(),
+ user_identifier: user_identity.user_id.clone(),
};
let mut encrypted_user_keys = backup_client
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
@@ -282,8 +282,8 @@
path: web::Path<String>,
db_client: web::Data<DatabaseClient>,
) -> actix_web::Result<impl Responder> {
- let username = path.into_inner();
- let user_id = find_user_id(&username).await?;
+ let user_identifier = path.into_inner();
+ let user_id = find_user_id(&user_identifier).await?;
let Some(backup_item) = db_client
.find_last_backup_item(&user_id)
@@ -307,8 +307,8 @@
db_client: web::Data<DatabaseClient>,
blob_client: Authenticated<BlobServiceClient>,
) -> actix_web::Result<HttpResponse> {
- let username = path.into_inner();
- let user_id = find_user_id(&username).await?;
+ let user_identifier = path.into_inner();
+ let user_id = find_user_id(&user_identifier).await?;
let Some(backup_item) = db_client
.find_last_backup_item(&user_id)
diff --git a/services/backup/src/http/mod.rs b/services/backup/src/http/mod.rs
--- a/services/backup/src/http/mod.rs
+++ b/services/backup/src/http/mod.rs
@@ -41,10 +41,10 @@
// Backup services that don't require authetication
web::scope("/backups/latest")
.service(
- web::resource("{username}/backup_id")
+ web::resource("{user_identifier}/backup_id")
.route(web::get().to(handlers::backup::get_latest_backup_id)),
)
- .service(web::resource("{username}/user_keys").route(
+ .service(web::resource("{user_identifier}/user_keys").route(
web::get().to(handlers::backup::download_latest_backup_keys),
)),
)
diff --git a/services/commtest/tests/backup_integration_test.rs b/services/commtest/tests/backup_integration_test.rs
--- a/services/commtest/tests/backup_integration_test.rs
+++ b/services/commtest/tests/backup_integration_test.rs
@@ -77,7 +77,7 @@
// Test latest backup lookup for not-existing user
let latest_backup_descriptor = BackupDescriptor::Latest {
- username: "non_existing_user".to_string(),
+ user_identifier: "non_existing_user".to_string(),
};
let non_existing_user_response = backup_client
@@ -98,7 +98,7 @@
// Test latest backup lookup
let latest_backup_descriptor = BackupDescriptor::Latest {
- username: device_info.username,
+ user_identifier: device_info.username,
};
let backup_id_response = backup_client
diff --git a/services/commtest/tests/backup_performance_test.rs b/services/commtest/tests/backup_performance_test.rs
--- a/services/commtest/tests/backup_performance_test.rs
+++ b/services/commtest/tests/backup_performance_test.rs
@@ -82,13 +82,13 @@
for user in &user_identities {
let backup_client = backup_client.clone();
- let username = if user.user_id == device_info_1.user_id {
+ let user_identifier = if user.user_id == device_info_1.user_id {
device_info_1.username.clone()
} else {
device_info_2.username.clone()
};
- let descriptor = BackupDescriptor::Latest { username };
+ let descriptor = BackupDescriptor::Latest { user_identifier };
handlers.push(tokio::spawn(async move {
let response = backup_client
@@ -113,13 +113,14 @@
let mut handlers = vec![];
for user in &user_identities {
let backup_client = backup_client.clone();
- let username = if user.user_id == device_info_1.user_id {
+
+ let user_identifier = if user.user_id == device_info_1.user_id {
device_info_1.username.clone()
} else {
device_info_2.username.clone()
};
- let descriptor = BackupDescriptor::Latest { username };
+ let descriptor = BackupDescriptor::Latest { user_identifier };
handlers.push(tokio::spawn(async move {
backup_client
diff --git a/shared/backup_client/src/lib.rs b/shared/backup_client/src/lib.rs
--- a/shared/backup_client/src/lib.rs
+++ b/shared/backup_client/src/lib.rs
@@ -98,8 +98,8 @@
BackupDescriptor::BackupID { backup_id, .. } => {
url.join(&format!("{backup_id}/"))?
}
- BackupDescriptor::Latest { username } => {
- url.join(&format!("latest/{username}/"))?
+ BackupDescriptor::Latest { user_identifier } => {
+ url.join(&format!("latest/{user_identifier}/"))?
}
};
let url = match &requested_data {
@@ -335,7 +335,7 @@
user_identity: UserIdentity,
},
Latest {
- username: String,
+ user_identifier: String,
},
}

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 11:34 PM (1 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2692891
Default Alt Text
D13808.id45430.diff (5 KB)

Event Timeline