diff --git a/native/native_rust_library/src/lib.rs b/native/native_rust_library/src/lib.rs --- a/native/native_rust_library/src/lib.rs +++ b/native/native_rust_library/src/lib.rs @@ -13,10 +13,6 @@ use crypto_tools::generate_device_id; use identity::identity_service_client::IdentityServiceClient; -use identity_client::{ - get_user_id, login_user_pake, login_user_wallet, register_user, - verify_user_token, -}; lazy_static! { pub static ref RUNTIME: Arc = Arc::new( @@ -42,18 +38,18 @@ // Identity Service Client type IdentityClient; fn initialize_identity_client(addr: String) -> Box; - fn get_user_id_blocking( + fn identity_get_user_id_blocking( client: Box, auth_type: i32, user_info: String, ) -> Result; - fn verify_user_token_blocking( + fn identity_verify_user_token_blocking( client: Box, user_id: String, device_id: String, access_token: String, ) -> Result; - fn register_user_blocking( + fn identity_register_user_blocking( client: Box, user_id: String, device_id: String, @@ -61,14 +57,14 @@ password: String, user_public_key: String, ) -> Result; - fn login_user_pake_blocking( + fn identity_login_user_pake_blocking( client: Box, user_id: String, device_id: String, password: String, user_public_key: String, ) -> Result; - fn login_user_wallet_blocking( + fn identity_login_user_wallet_blocking( client: Box, user_id: String, device_id: String, @@ -76,6 +72,7 @@ siwe_signature: Vec, user_public_key: String, ) -> Result; + // Crypto Tools fn generate_device_id(device_type: DeviceType) -> Result; } @@ -95,26 +92,31 @@ } #[instrument] -fn get_user_id_blocking( +fn identity_get_user_id_blocking( client: Box, auth_type: i32, user_info: String, ) -> Result { - RUNTIME.block_on(get_user_id(client, auth_type, user_info)) + RUNTIME.block_on(identity_client::get_user_id(client, auth_type, user_info)) } #[instrument] -fn verify_user_token_blocking( +fn identity_verify_user_token_blocking( client: Box, user_id: String, device_id: String, access_token: String, ) -> Result { - RUNTIME.block_on(verify_user_token(client, user_id, device_id, access_token)) + RUNTIME.block_on(identity_client::verify_user_token( + client, + user_id, + device_id, + access_token, + )) } #[instrument] -fn register_user_blocking( +fn identity_register_user_blocking( client: Box, user_id: String, device_id: String, @@ -122,7 +124,7 @@ password: String, user_public_key: String, ) -> Result { - RUNTIME.block_on(register_user( + RUNTIME.block_on(identity_client::register_user( client, user_id, device_id, @@ -133,14 +135,14 @@ } #[instrument] -fn login_user_pake_blocking( +fn identity_login_user_pake_blocking( client: Box, user_id: String, device_id: String, password: String, user_public_key: String, ) -> Result { - RUNTIME.block_on(login_user_pake( + RUNTIME.block_on(identity_client::login_user_pake( client, user_id, device_id, @@ -150,7 +152,7 @@ } #[instrument] -fn login_user_wallet_blocking( +fn identity_login_user_wallet_blocking( client: Box, user_id: String, device_id: String, @@ -158,7 +160,7 @@ siwe_signature: Vec, user_public_key: String, ) -> Result { - RUNTIME.block_on(login_user_wallet( + RUNTIME.block_on(identity_client::login_user_wallet( client, user_id, device_id,