diff --git a/services/identity/src/client_service.rs b/services/identity/src/client_service.rs --- a/services/identity/src/client_service.rs +++ b/services/identity/src/client_service.rs @@ -266,7 +266,7 @@ let username = state.username.clone(); let user_id = self .client - .add_password_user_to_users_table( + .add_password_user_to_database( *state, password_file, platform_metadata, @@ -447,14 +447,14 @@ if let Some(device_to_remove) = state.device_to_remove { self .client - .remove_device(state.user_id.clone(), device_to_remove) + .v1_remove_device(state.user_id.clone(), device_to_remove) .await?; } let login_time = chrono::Utc::now(); self .client - .add_user_device( + .v1_add_user_device( state.user_id.clone(), state.flattened_device_key_upload.clone(), platform_metadata, @@ -543,7 +543,7 @@ self .client - .add_user_device( + .v1_add_user_device( user_id.clone(), flattened_device_key_upload.clone(), platform_metadata, @@ -595,7 +595,7 @@ self .client - .add_wallet_user_to_users_table( + .add_wallet_user_to_database( flattened_device_key_upload.clone(), wallet_address.clone(), social_proof, @@ -680,7 +680,7 @@ let user_id = self .client - .add_wallet_user_to_users_table( + .add_wallet_user_to_database( flattened_device_key_upload.clone(), wallet_address.clone(), social_proof, diff --git a/services/identity/src/database.rs b/services/identity/src/database.rs --- a/services/identity/src/database.rs +++ b/services/identity/src/database.rs @@ -154,7 +154,7 @@ } } - pub async fn add_password_user_to_users_table( + pub async fn add_password_user_to_database( &self, registration_state: UserRegistrationInfo, password_file: Vec, @@ -187,7 +187,7 @@ .await?; } else { self - .add_device( + .v1_add_device( &user_id, device_key_upload.clone(), platform_details, @@ -209,7 +209,7 @@ } #[allow(clippy::too_many_arguments)] - pub async fn add_wallet_user_to_users_table( + pub async fn add_wallet_user_to_database( &self, flattened_device_key_upload: FlattenedDeviceKeyUpload, wallet_address: String, @@ -249,7 +249,7 @@ .await?; } else { self - .add_device( + .v1_add_device( &user_id, flattened_device_key_upload.clone(), platform_metadata, @@ -371,7 +371,7 @@ Ok(user_id) } - pub async fn add_user_device( + pub async fn v1_add_user_device( &self, user_id: String, flattened_device_key_upload: FlattenedDeviceKeyUpload, @@ -402,7 +402,7 @@ // add device to the new device list self - .add_device( + .v1_add_device( &user_id, flattened_device_key_upload, platform_metadata, diff --git a/services/identity/src/database/device_list.rs b/services/identity/src/database/device_list.rs --- a/services/identity/src/database/device_list.rs +++ b/services/identity/src/database/device_list.rs @@ -1435,7 +1435,7 @@ /// Adds new device to user's device list. If the device already exists, the /// operation fails. Transactionally generates new device list version. - pub async fn add_device( + pub async fn v1_add_device( &self, user_id: impl Into, device_key_upload: FlattenedDeviceKeyUpload, @@ -1492,7 +1492,7 @@ /// Removes device from user's device list. If the device doesn't exist, the /// operation fails. Transactionally generates new device list version. - pub async fn remove_device( + pub async fn v1_remove_device( &self, user_id: impl Into, device_id: impl AsRef, diff --git a/services/identity/src/grpc_services/authenticated.rs b/services/identity/src/grpc_services/authenticated.rs --- a/services/identity/src/grpc_services/authenticated.rs +++ b/services/identity/src/grpc_services/authenticated.rs @@ -454,7 +454,10 @@ .remove_device_data(&user_id, &device_id) .await?; } else { - self.db_client.remove_device(&user_id, &device_id).await?; + self + .db_client + .v1_remove_device(&user_id, &device_id) + .await?; if is_primary_device_logout { // Since device list is unsigned, and current primary device is being logged out