@@ -18,7 +18,7 @@ use {tsify_next::Tsify, wasm_bindgen::prelude::*};
1818use crate :: {
1919 client:: { encryption_settings:: EncryptionSettingsError , LoginMethod , UserLoginMethod } ,
2020 key_management:: SymmetricKeyId ,
21- Client , NotAuthenticatedError , VaultLockedError , WrongPasswordError ,
21+ Client , NotAuthenticatedError , OrganizationId , UserId , VaultLockedError , WrongPasswordError ,
2222} ;
2323
2424/// Catch all error for mobile crypto operations.
@@ -39,7 +39,7 @@ pub enum MobileCryptoError {
3939#[ cfg_attr( feature = "uniffi" , derive( uniffi:: Record ) ) ]
4040#[ cfg_attr( feature = "wasm" , derive( Tsify ) , tsify( into_wasm_abi, from_wasm_abi) ) ]
4141pub struct InitUserCryptoRequest {
42- pub user_id : Option < uuid :: Uuid > ,
42+ pub user_id : Option < UserId > ,
4343 /// The user's KDF parameters, as received from the prelogin request
4444 pub kdf_params : Kdf ,
4545 /// The user's email address
@@ -232,7 +232,7 @@ pub async fn initialize_user_crypto(
232232#[ cfg_attr( feature = "wasm" , derive( Tsify ) , tsify( into_wasm_abi, from_wasm_abi) ) ]
233233pub struct InitOrgCryptoRequest {
234234 /// The encryption keys for all the organizations the user is a part of
235- pub organization_keys : HashMap < uuid :: Uuid , UnsignedSharedKey > ,
235+ pub organization_keys : HashMap < OrganizationId , UnsignedSharedKey > ,
236236}
237237
238238/// Initialize the user's organizational cryptographic state.
@@ -569,7 +569,7 @@ mod tests {
569569 initialize_user_crypto (
570570 & client,
571571 InitUserCryptoRequest {
572- user_id : Some ( uuid :: Uuid :: new_v4 ( ) ) ,
572+ user_id : Some ( UserId :: new_v4 ( ) ) ,
573573 kdf_params : kdf. clone ( ) ,
574574 email : "[email protected] " . into ( ) , 575575 private_key : priv_key. to_owned ( ) ,
@@ -589,7 +589,7 @@ mod tests {
589589 initialize_user_crypto (
590590 & client2,
591591 InitUserCryptoRequest {
592- user_id : Some ( uuid :: Uuid :: new_v4 ( ) ) ,
592+ user_id : Some ( UserId :: new_v4 ( ) ) ,
593593 kdf_params : kdf. clone ( ) ,
594594 email : "[email protected] " . into ( ) , 595595 private_key : priv_key. to_owned ( ) ,
@@ -645,7 +645,7 @@ mod tests {
645645 initialize_user_crypto (
646646 & client,
647647 InitUserCryptoRequest {
648- user_id : Some ( uuid :: Uuid :: new_v4 ( ) ) ,
648+ user_id : Some ( UserId :: new_v4 ( ) ) ,
649649 kdf_params : Kdf :: PBKDF2 {
650650 iterations : 100_000 . try_into ( ) . unwrap ( ) ,
651651 } ,
@@ -667,7 +667,7 @@ mod tests {
667667 initialize_user_crypto (
668668 & client2,
669669 InitUserCryptoRequest {
670- user_id : Some ( uuid :: Uuid :: new_v4 ( ) ) ,
670+ user_id : Some ( UserId :: new_v4 ( ) ) ,
671671 kdf_params : Kdf :: PBKDF2 {
672672 iterations : 100_000 . try_into ( ) . unwrap ( ) ,
673673 } ,
@@ -710,7 +710,7 @@ mod tests {
710710 initialize_user_crypto (
711711 & client3,
712712 InitUserCryptoRequest {
713- user_id : Some ( uuid :: Uuid :: new_v4 ( ) ) ,
713+ user_id : Some ( UserId :: new_v4 ( ) ) ,
714714 kdf_params : Kdf :: PBKDF2 {
715715 iterations : 100_000 . try_into ( ) . unwrap ( ) ,
716716 } ,
0 commit comments