Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3363390
D4938.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4938.diff
View Options
diff --git a/native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs b/native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs
--- a/native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs
+++ b/native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs
@@ -58,7 +58,51 @@
}
#[cxx::bridge(namespace = "identity")]
-mod ffi {}
+mod ffi {
+ extern "Rust" {
+ type Client;
+ fn initialize_client() -> Box<Client>;
+ fn get_user_id_blocking(
+ client: Box<Client>,
+ auth_type: i32,
+ user_info: String,
+ ) -> Result<String>;
+ fn verify_user_token_blocking(
+ client: Box<Client>,
+ user_id: String,
+ device_id: String,
+ access_token: String,
+ ) -> Result<bool>;
+ fn register_user_blocking(
+ client: Box<Client>,
+ user_id: String,
+ device_id: String,
+ username: String,
+ password: String,
+ user_public_key: String,
+ ) -> Result<String>;
+ fn login_user_pake_blocking(
+ client: Box<Client>,
+ user_id: String,
+ device_id: String,
+ password: String,
+ ) -> Result<String>;
+ fn login_user_wallet_blocking(
+ client: Box<Client>,
+ user_id: String,
+ device_id: String,
+ siwe_message: String,
+ siwe_signature: Vec<u8>,
+ user_public_key: String,
+ ) -> Result<String>;
+ }
+}
+
+#[derive(Debug)]
+enum AuthType {
+ Password = 0,
+ Wallet = 1,
+}
#[derive(Debug)]
struct Client {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 2:03 AM (15 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2581966
Default Alt Text
D4938.diff (1 KB)
Attached To
Mode
D4938: [native] expose client functions across FFI boundary
Attached
Detach File
Event Timeline
Log In to Comment