Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3284281
D12066.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
19 KB
Referenced Files
None
Subscribers
None
D12066.diff
View Options
diff --git a/native/cpp/CommonCpp/NativeModules/CommRustModule.h b/native/cpp/CommonCpp/NativeModules/CommRustModule.h
--- a/native/cpp/CommonCpp/NativeModules/CommRustModule.h
+++ b/native/cpp/CommonCpp/NativeModules/CommRustModule.h
@@ -24,7 +24,8 @@
jsi::String notifPrekeySignature,
jsi::Array contentOneTimeKeys,
jsi::Array notifOneTimeKeys,
- jsi::String farcasterID) override;
+ jsi::String farcasterID,
+ jsi::String initialDeviceList) override;
virtual jsi::Value logInPasswordUser(
jsi::Runtime &rt,
jsi::String username,
@@ -47,7 +48,8 @@
jsi::String notifPrekeySignature,
jsi::Array contentOneTimeKeys,
jsi::Array notifOneTimeKeys,
- jsi::String farcasterID) override;
+ jsi::String farcasterID,
+ jsi::String initialDeviceList) override;
virtual jsi::Value logInWalletUser(
jsi::Runtime &rt,
jsi::String siweMessage,
diff --git a/native/cpp/CommonCpp/NativeModules/CommRustModule.cpp b/native/cpp/CommonCpp/NativeModules/CommRustModule.cpp
--- a/native/cpp/CommonCpp/NativeModules/CommRustModule.cpp
+++ b/native/cpp/CommonCpp/NativeModules/CommRustModule.cpp
@@ -43,7 +43,8 @@
jsi::String notifPrekeySignature,
jsi::Array contentOneTimeKeys,
jsi::Array notifOneTimeKeys,
- jsi::String farcasterID) {
+ jsi::String farcasterID,
+ jsi::String initialDeviceList) {
auto usernameRust = jsiStringToRustString(username, rt);
auto passwordRust = jsiStringToRustString(password, rt);
auto keyPayloadRust = jsiStringToRustString(keyPayload, rt);
@@ -57,6 +58,7 @@
auto contentOneTimeKeysRust = jsiStringArrayToRustVec(contentOneTimeKeys, rt);
auto notifOneTimeKeysRust = jsiStringArrayToRustVec(notifOneTimeKeys, rt);
auto farcasterIDRust = jsiStringToRustString(farcasterID, rt);
+ auto initialDeviceListRust = jsiStringToRustString(initialDeviceList, rt);
return createPromiseAsJSIValue(
rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {
@@ -76,6 +78,7 @@
contentOneTimeKeysRust,
notifOneTimeKeysRust,
farcasterIDRust,
+ initialDeviceListRust,
currentID);
} catch (const std::exception &e) {
error = e.what();
@@ -146,7 +149,8 @@
jsi::String notifPrekeySignature,
jsi::Array contentOneTimeKeys,
jsi::Array notifOneTimeKeys,
- jsi::String farcasterID) {
+ jsi::String farcasterID,
+ jsi::String initialDeviceList) {
auto siweMessageRust = jsiStringToRustString(siweMessage, rt);
auto siweSignatureRust = jsiStringToRustString(siweSignature, rt);
auto keyPayloadRust = jsiStringToRustString(keyPayload, rt);
@@ -160,6 +164,7 @@
auto contentOneTimeKeysRust = jsiStringArrayToRustVec(contentOneTimeKeys, rt);
auto notifOneTimeKeysRust = jsiStringArrayToRustVec(notifOneTimeKeys, rt);
auto farcasterIDRust = jsiStringToRustString(farcasterID, rt);
+ auto initialDeviceListRust = jsiStringToRustString(initialDeviceList, rt);
return createPromiseAsJSIValue(
rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {
@@ -179,6 +184,7 @@
contentOneTimeKeysRust,
notifOneTimeKeysRust,
farcasterIDRust,
+ initialDeviceListRust,
currentID);
} catch (const std::exception &e) {
error = e.what();
diff --git a/native/cpp/CommonCpp/_generated/rustJSI-generated.cpp b/native/cpp/CommonCpp/_generated/rustJSI-generated.cpp
--- a/native/cpp/CommonCpp/_generated/rustJSI-generated.cpp
+++ b/native/cpp/CommonCpp/_generated/rustJSI-generated.cpp
@@ -16,13 +16,13 @@
return static_cast<CommRustModuleSchemaCxxSpecJSI *>(&turboModule)->generateNonce(rt);
}
static jsi::Value __hostFunction_CommRustModuleSchemaCxxSpecJSI_registerPasswordUser(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommRustModuleSchemaCxxSpecJSI *>(&turboModule)->registerPasswordUser(rt, args[0].asString(rt), args[1].asString(rt), args[2].asString(rt), args[3].asString(rt), args[4].asString(rt), args[5].asString(rt), args[6].asString(rt), args[7].asString(rt), args[8].asObject(rt).asArray(rt), args[9].asObject(rt).asArray(rt), args[10].asString(rt));
+ return static_cast<CommRustModuleSchemaCxxSpecJSI *>(&turboModule)->registerPasswordUser(rt, args[0].asString(rt), args[1].asString(rt), args[2].asString(rt), args[3].asString(rt), args[4].asString(rt), args[5].asString(rt), args[6].asString(rt), args[7].asString(rt), args[8].asObject(rt).asArray(rt), args[9].asObject(rt).asArray(rt), args[10].asString(rt), args[11].asString(rt));
}
static jsi::Value __hostFunction_CommRustModuleSchemaCxxSpecJSI_logInPasswordUser(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
return static_cast<CommRustModuleSchemaCxxSpecJSI *>(&turboModule)->logInPasswordUser(rt, args[0].asString(rt), args[1].asString(rt), args[2].asString(rt), args[3].asString(rt), args[4].asString(rt), args[5].asString(rt), args[6].asString(rt), args[7].asString(rt));
}
static jsi::Value __hostFunction_CommRustModuleSchemaCxxSpecJSI_registerWalletUser(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommRustModuleSchemaCxxSpecJSI *>(&turboModule)->registerWalletUser(rt, args[0].asString(rt), args[1].asString(rt), args[2].asString(rt), args[3].asString(rt), args[4].asString(rt), args[5].asString(rt), args[6].asString(rt), args[7].asString(rt), args[8].asObject(rt).asArray(rt), args[9].asObject(rt).asArray(rt), args[10].asString(rt));
+ return static_cast<CommRustModuleSchemaCxxSpecJSI *>(&turboModule)->registerWalletUser(rt, args[0].asString(rt), args[1].asString(rt), args[2].asString(rt), args[3].asString(rt), args[4].asString(rt), args[5].asString(rt), args[6].asString(rt), args[7].asString(rt), args[8].asObject(rt).asArray(rt), args[9].asObject(rt).asArray(rt), args[10].asString(rt), args[11].asString(rt));
}
static jsi::Value __hostFunction_CommRustModuleSchemaCxxSpecJSI_logInWalletUser(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
return static_cast<CommRustModuleSchemaCxxSpecJSI *>(&turboModule)->logInWalletUser(rt, args[0].asString(rt), args[1].asString(rt), args[2].asString(rt), args[3].asString(rt), args[4].asString(rt), args[5].asString(rt), args[6].asString(rt), args[7].asString(rt));
@@ -91,9 +91,9 @@
CommRustModuleSchemaCxxSpecJSI::CommRustModuleSchemaCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
: TurboModule("CommRustTurboModule", jsInvoker) {
methodMap_["generateNonce"] = MethodMetadata {0, __hostFunction_CommRustModuleSchemaCxxSpecJSI_generateNonce};
- methodMap_["registerPasswordUser"] = MethodMetadata {11, __hostFunction_CommRustModuleSchemaCxxSpecJSI_registerPasswordUser};
+ methodMap_["registerPasswordUser"] = MethodMetadata {12, __hostFunction_CommRustModuleSchemaCxxSpecJSI_registerPasswordUser};
methodMap_["logInPasswordUser"] = MethodMetadata {8, __hostFunction_CommRustModuleSchemaCxxSpecJSI_logInPasswordUser};
- methodMap_["registerWalletUser"] = MethodMetadata {11, __hostFunction_CommRustModuleSchemaCxxSpecJSI_registerWalletUser};
+ methodMap_["registerWalletUser"] = MethodMetadata {12, __hostFunction_CommRustModuleSchemaCxxSpecJSI_registerWalletUser};
methodMap_["logInWalletUser"] = MethodMetadata {8, __hostFunction_CommRustModuleSchemaCxxSpecJSI_logInWalletUser};
methodMap_["updatePassword"] = MethodMetadata {4, __hostFunction_CommRustModuleSchemaCxxSpecJSI_updatePassword};
methodMap_["deletePasswordUser"] = MethodMetadata {4, __hostFunction_CommRustModuleSchemaCxxSpecJSI_deletePasswordUser};
diff --git a/native/cpp/CommonCpp/_generated/rustJSI.h b/native/cpp/CommonCpp/_generated/rustJSI.h
--- a/native/cpp/CommonCpp/_generated/rustJSI.h
+++ b/native/cpp/CommonCpp/_generated/rustJSI.h
@@ -21,9 +21,9 @@
public:
virtual jsi::Value generateNonce(jsi::Runtime &rt) = 0;
- virtual jsi::Value registerPasswordUser(jsi::Runtime &rt, jsi::String username, jsi::String password, jsi::String keyPayload, jsi::String keyPayloadSignature, jsi::String contentPrekey, jsi::String contentPrekeySignature, jsi::String notifPrekey, jsi::String notifPrekeySignature, jsi::Array contentOneTimeKeys, jsi::Array notifOneTimeKeys, jsi::String farcasterID) = 0;
+ virtual jsi::Value registerPasswordUser(jsi::Runtime &rt, jsi::String username, jsi::String password, jsi::String keyPayload, jsi::String keyPayloadSignature, jsi::String contentPrekey, jsi::String contentPrekeySignature, jsi::String notifPrekey, jsi::String notifPrekeySignature, jsi::Array contentOneTimeKeys, jsi::Array notifOneTimeKeys, jsi::String farcasterID, jsi::String initialDeviceList) = 0;
virtual jsi::Value logInPasswordUser(jsi::Runtime &rt, jsi::String username, jsi::String password, jsi::String keyPayload, jsi::String keyPayloadSignature, jsi::String contentPrekey, jsi::String contentPrekeySignature, jsi::String notifPrekey, jsi::String notifPrekeySignature) = 0;
- virtual jsi::Value registerWalletUser(jsi::Runtime &rt, jsi::String siweMessage, jsi::String siweSignature, jsi::String keyPayload, jsi::String keyPayloadSignature, jsi::String contentPrekey, jsi::String contentPrekeySignature, jsi::String notifPrekey, jsi::String notifPrekeySignature, jsi::Array contentOneTimeKeys, jsi::Array notifOneTimeKeys, jsi::String farcasterID) = 0;
+ virtual jsi::Value registerWalletUser(jsi::Runtime &rt, jsi::String siweMessage, jsi::String siweSignature, jsi::String keyPayload, jsi::String keyPayloadSignature, jsi::String contentPrekey, jsi::String contentPrekeySignature, jsi::String notifPrekey, jsi::String notifPrekeySignature, jsi::Array contentOneTimeKeys, jsi::Array notifOneTimeKeys, jsi::String farcasterID, jsi::String initialDeviceList) = 0;
virtual jsi::Value logInWalletUser(jsi::Runtime &rt, jsi::String siweMessage, jsi::String siweSignature, jsi::String keyPayload, jsi::String keyPayloadSignature, jsi::String contentPrekey, jsi::String contentPrekeySignature, jsi::String notifPrekey, jsi::String notifPrekeySignature) = 0;
virtual jsi::Value updatePassword(jsi::Runtime &rt, jsi::String userID, jsi::String deviceID, jsi::String accessToken, jsi::String password) = 0;
virtual jsi::Value deletePasswordUser(jsi::Runtime &rt, jsi::String userID, jsi::String deviceID, jsi::String accessToken, jsi::String password) = 0;
@@ -74,13 +74,13 @@
return bridging::callFromJs<jsi::Value>(
rt, &T::generateNonce, jsInvoker_, instance_);
}
- jsi::Value registerPasswordUser(jsi::Runtime &rt, jsi::String username, jsi::String password, jsi::String keyPayload, jsi::String keyPayloadSignature, jsi::String contentPrekey, jsi::String contentPrekeySignature, jsi::String notifPrekey, jsi::String notifPrekeySignature, jsi::Array contentOneTimeKeys, jsi::Array notifOneTimeKeys, jsi::String farcasterID) override {
+ jsi::Value registerPasswordUser(jsi::Runtime &rt, jsi::String username, jsi::String password, jsi::String keyPayload, jsi::String keyPayloadSignature, jsi::String contentPrekey, jsi::String contentPrekeySignature, jsi::String notifPrekey, jsi::String notifPrekeySignature, jsi::Array contentOneTimeKeys, jsi::Array notifOneTimeKeys, jsi::String farcasterID, jsi::String initialDeviceList) override {
static_assert(
- bridging::getParameterCount(&T::registerPasswordUser) == 12,
- "Expected registerPasswordUser(...) to have 12 parameters");
+ bridging::getParameterCount(&T::registerPasswordUser) == 13,
+ "Expected registerPasswordUser(...) to have 13 parameters");
return bridging::callFromJs<jsi::Value>(
- rt, &T::registerPasswordUser, jsInvoker_, instance_, std::move(username), std::move(password), std::move(keyPayload), std::move(keyPayloadSignature), std::move(contentPrekey), std::move(contentPrekeySignature), std::move(notifPrekey), std::move(notifPrekeySignature), std::move(contentOneTimeKeys), std::move(notifOneTimeKeys), std::move(farcasterID));
+ rt, &T::registerPasswordUser, jsInvoker_, instance_, std::move(username), std::move(password), std::move(keyPayload), std::move(keyPayloadSignature), std::move(contentPrekey), std::move(contentPrekeySignature), std::move(notifPrekey), std::move(notifPrekeySignature), std::move(contentOneTimeKeys), std::move(notifOneTimeKeys), std::move(farcasterID), std::move(initialDeviceList));
}
jsi::Value logInPasswordUser(jsi::Runtime &rt, jsi::String username, jsi::String password, jsi::String keyPayload, jsi::String keyPayloadSignature, jsi::String contentPrekey, jsi::String contentPrekeySignature, jsi::String notifPrekey, jsi::String notifPrekeySignature) override {
static_assert(
@@ -90,13 +90,13 @@
return bridging::callFromJs<jsi::Value>(
rt, &T::logInPasswordUser, jsInvoker_, instance_, std::move(username), std::move(password), std::move(keyPayload), std::move(keyPayloadSignature), std::move(contentPrekey), std::move(contentPrekeySignature), std::move(notifPrekey), std::move(notifPrekeySignature));
}
- jsi::Value registerWalletUser(jsi::Runtime &rt, jsi::String siweMessage, jsi::String siweSignature, jsi::String keyPayload, jsi::String keyPayloadSignature, jsi::String contentPrekey, jsi::String contentPrekeySignature, jsi::String notifPrekey, jsi::String notifPrekeySignature, jsi::Array contentOneTimeKeys, jsi::Array notifOneTimeKeys, jsi::String farcasterID) override {
+ jsi::Value registerWalletUser(jsi::Runtime &rt, jsi::String siweMessage, jsi::String siweSignature, jsi::String keyPayload, jsi::String keyPayloadSignature, jsi::String contentPrekey, jsi::String contentPrekeySignature, jsi::String notifPrekey, jsi::String notifPrekeySignature, jsi::Array contentOneTimeKeys, jsi::Array notifOneTimeKeys, jsi::String farcasterID, jsi::String initialDeviceList) override {
static_assert(
- bridging::getParameterCount(&T::registerWalletUser) == 12,
- "Expected registerWalletUser(...) to have 12 parameters");
+ bridging::getParameterCount(&T::registerWalletUser) == 13,
+ "Expected registerWalletUser(...) to have 13 parameters");
return bridging::callFromJs<jsi::Value>(
- rt, &T::registerWalletUser, jsInvoker_, instance_, std::move(siweMessage), std::move(siweSignature), std::move(keyPayload), std::move(keyPayloadSignature), std::move(contentPrekey), std::move(contentPrekeySignature), std::move(notifPrekey), std::move(notifPrekeySignature), std::move(contentOneTimeKeys), std::move(notifOneTimeKeys), std::move(farcasterID));
+ rt, &T::registerWalletUser, jsInvoker_, instance_, std::move(siweMessage), std::move(siweSignature), std::move(keyPayload), std::move(keyPayloadSignature), std::move(contentPrekey), std::move(contentPrekeySignature), std::move(notifPrekey), std::move(notifPrekeySignature), std::move(contentOneTimeKeys), std::move(notifOneTimeKeys), std::move(farcasterID), std::move(initialDeviceList));
}
jsi::Value logInWalletUser(jsi::Runtime &rt, jsi::String siweMessage, jsi::String siweSignature, jsi::String keyPayload, jsi::String keyPayloadSignature, jsi::String contentPrekey, jsi::String contentPrekeySignature, jsi::String notifPrekey, jsi::String notifPrekeySignature) override {
static_assert(
diff --git a/native/identity-service/identity-service-context-provider.react.js b/native/identity-service/identity-service-context-provider.react.js
--- a/native/identity-service/identity-service-context-provider.react.js
+++ b/native/identity-service/identity-service-context-provider.react.js
@@ -337,6 +337,7 @@
getOneTimeKeyValues(contentOneTimeKeys),
getOneTimeKeyValues(notificationsOneTimeKeys),
fid ?? '',
+ '', // initialDeviceList
);
const { userID, accessToken: token } = JSON.parse(registrationResult);
const identityAuthResult = { accessToken: token, userID, username };
@@ -415,6 +416,7 @@
getOneTimeKeyValues(contentOneTimeKeys),
getOneTimeKeyValues(notificationsOneTimeKeys),
fid ?? '',
+ '', // initialDeviceList
);
const { userID, accessToken: token } = JSON.parse(registrationResult);
const identityAuthResult = {
diff --git a/native/native_rust_library/src/identity/registration.rs b/native/native_rust_library/src/identity/registration.rs
--- a/native/native_rust_library/src/identity/registration.rs
+++ b/native/native_rust_library/src/identity/registration.rs
@@ -33,6 +33,7 @@
content_one_time_keys: Vec<String>,
notif_one_time_keys: Vec<String>,
farcaster_id: String,
+ initial_device_list: String,
promise_id: u32,
) {
RUNTIME.spawn(async move {
@@ -49,7 +50,9 @@
notif_one_time_keys,
farcaster_id: farcaster_id_string_to_option(&farcaster_id),
};
- let result = register_password_user_helper(password_user_info).await;
+ let result =
+ register_password_user_helper(password_user_info, initial_device_list)
+ .await;
handle_string_result_as_callback(result, promise_id);
});
}
@@ -67,6 +70,7 @@
content_one_time_keys: Vec<String>,
notif_one_time_keys: Vec<String>,
farcaster_id: String,
+ initial_device_list: String,
promise_id: u32,
) {
RUNTIME.spawn(async move {
@@ -83,7 +87,9 @@
notif_one_time_keys,
farcaster_id: farcaster_id_string_to_option(&farcaster_id),
};
- let result = register_wallet_user_helper(wallet_user_info).await;
+ let result =
+ register_wallet_user_helper(wallet_user_info, initial_device_list)
+ .await;
handle_string_result_as_callback(result, promise_id);
});
}
@@ -91,6 +97,7 @@
async fn register_password_user_helper(
password_user_info: PasswordUserInfo,
+ initial_device_list: String,
) -> Result<String, Error> {
let mut client_registration = Registration::new();
let opaque_registration_request = client_registration
@@ -117,7 +124,7 @@
device_type: DEVICE_TYPE.into(),
}),
farcaster_id: password_user_info.farcaster_id,
- initial_device_list: "".to_string(),
+ initial_device_list,
};
let mut identity_client = get_unauthenticated_client(
@@ -155,6 +162,7 @@
async fn register_wallet_user_helper(
wallet_user_info: WalletUserInfo,
+ initial_device_list: String,
) -> Result<String, Error> {
let registration_request = WalletAuthRequest {
siwe_message: wallet_user_info.siwe_message,
@@ -177,7 +185,7 @@
device_type: DEVICE_TYPE.into(),
}),
farcaster_id: wallet_user_info.farcaster_id,
- initial_device_list: "".to_string(),
+ initial_device_list,
};
let mut identity_client = get_unauthenticated_client(
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
@@ -59,6 +59,7 @@
content_one_time_keys: Vec<String>,
notif_one_time_keys: Vec<String>,
farcaster_id: String,
+ initial_device_list: String,
promise_id: u32,
);
@@ -88,6 +89,7 @@
content_one_time_keys: Vec<String>,
notif_one_time_keys: Vec<String>,
farcaster_id: String,
+ initial_device_list: String,
promise_id: u32,
);
diff --git a/native/schema/CommRustModuleSchema.js b/native/schema/CommRustModuleSchema.js
--- a/native/schema/CommRustModuleSchema.js
+++ b/native/schema/CommRustModuleSchema.js
@@ -19,6 +19,7 @@
contentOneTimeKeys: $ReadOnlyArray<string>,
notifOneTimeKeys: $ReadOnlyArray<string>,
farcasterID: string,
+ initialDeviceList: string,
) => Promise<string>;
+logInPasswordUser: (
username: string,
@@ -42,6 +43,7 @@
contentOneTimeKeys: $ReadOnlyArray<string>,
notifOneTimeKeys: $ReadOnlyArray<string>,
farcasterID: string,
+ initialDeviceList: string,
) => Promise<string>;
+logInWalletUser: (
siweMessage: string,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 12:03 PM (21 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2524033
Default Alt Text
D12066.diff (19 KB)
Attached To
Mode
D12066: [native] Pass initialDeviceList param through JSI
Attached
Detach File
Event Timeline
Log In to Comment