Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2846804
D11079.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
11 KB
Referenced Files
None
Subscribers
None
D11079.diff
View Options
diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js
--- a/lib/actions/user-actions.js
+++ b/lib/actions/user-actions.js
@@ -440,10 +440,10 @@
if (!identityClient) {
throw new Error('Identity service client is not initialized');
}
- if (!identityClient.registerUser) {
+ if (!identityClient.registerPasswordUser) {
throw new Error('Register user method unimplemented');
}
- return identityClient.registerUser(username, password);
+ return identityClient.registerPasswordUser(username, password);
},
[identityClient],
);
diff --git a/lib/types/identity-service-types.js b/lib/types/identity-service-types.js
--- a/lib/types/identity-service-types.js
+++ b/lib/types/identity-service-types.js
@@ -55,7 +55,7 @@
export interface IdentityServiceClient {
+deleteUser: () => Promise<void>;
+getKeyserverKeys: string => Promise<DeviceOlmOutboundKeys>;
- +registerUser?: (
+ +registerPasswordUser?: (
username: string,
password: string,
) => Promise<IdentityAuthResult>;
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
@@ -12,7 +12,7 @@
class CommRustModule : public facebook::react::CommRustModuleSchemaCxxSpecJSI {
virtual jsi::Value generateNonce(jsi::Runtime &rt) override;
- virtual jsi::Value registerUser(
+ virtual jsi::Value registerPasswordUser(
jsi::Runtime &rt,
jsi::String username,
jsi::String password,
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
@@ -31,7 +31,7 @@
});
}
-jsi::Value CommRustModule::registerUser(
+jsi::Value CommRustModule::registerPasswordUser(
jsi::Runtime &rt,
jsi::String username,
jsi::String password,
@@ -62,7 +62,7 @@
try {
auto currentID = RustPromiseManager::instance.addPromise(
{promise, this->jsInvoker_, innerRt});
- identityRegisterUser(
+ identityRegisterPasswordUser(
usernameRust,
passwordRust,
keyPayloadRust,
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
@@ -15,8 +15,8 @@
static jsi::Value __hostFunction_CommRustModuleSchemaCxxSpecJSI_generateNonce(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
return static_cast<CommRustModuleSchemaCxxSpecJSI *>(&turboModule)->generateNonce(rt);
}
-static jsi::Value __hostFunction_CommRustModuleSchemaCxxSpecJSI_registerUser(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommRustModuleSchemaCxxSpecJSI *>(&turboModule)->registerUser(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));
+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));
}
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), args[8].asObject(rt).asArray(rt), args[9].asObject(rt).asArray(rt));
@@ -58,7 +58,7 @@
CommRustModuleSchemaCxxSpecJSI::CommRustModuleSchemaCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
: TurboModule("CommRustTurboModule", jsInvoker) {
methodMap_["generateNonce"] = MethodMetadata {0, __hostFunction_CommRustModuleSchemaCxxSpecJSI_generateNonce};
- methodMap_["registerUser"] = MethodMetadata {10, __hostFunction_CommRustModuleSchemaCxxSpecJSI_registerUser};
+ methodMap_["registerPasswordUser"] = MethodMetadata {10, __hostFunction_CommRustModuleSchemaCxxSpecJSI_registerPasswordUser};
methodMap_["logInPasswordUser"] = MethodMetadata {10, __hostFunction_CommRustModuleSchemaCxxSpecJSI_logInPasswordUser};
methodMap_["logInWalletUser"] = MethodMetadata {10, __hostFunction_CommRustModuleSchemaCxxSpecJSI_logInWalletUser};
methodMap_["updatePassword"] = MethodMetadata {4, __hostFunction_CommRustModuleSchemaCxxSpecJSI_updatePassword};
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,7 +21,7 @@
public:
virtual jsi::Value generateNonce(jsi::Runtime &rt) = 0;
- virtual jsi::Value registerUser(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) = 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) = 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, jsi::Array contentOneTimeKeys, jsi::Array notifOneTimeKeys) = 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, jsi::Array contentOneTimeKeys, jsi::Array notifOneTimeKeys) = 0;
virtual jsi::Value updatePassword(jsi::Runtime &rt, jsi::String userID, jsi::String deviceID, jsi::String accessToken, jsi::String password) = 0;
@@ -63,13 +63,13 @@
return bridging::callFromJs<jsi::Value>(
rt, &T::generateNonce, jsInvoker_, instance_);
}
- jsi::Value registerUser(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) 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) override {
static_assert(
- bridging::getParameterCount(&T::registerUser) == 11,
- "Expected registerUser(...) to have 11 parameters");
+ bridging::getParameterCount(&T::registerPasswordUser) == 11,
+ "Expected registerPasswordUser(...) to have 11 parameters");
return bridging::callFromJs<jsi::Value>(
- rt, &T::registerUser, 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));
+ 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));
}
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, jsi::Array contentOneTimeKeys, jsi::Array notifOneTimeKeys) 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
@@ -198,7 +198,7 @@
})
.filter(Boolean);
},
- registerUser: async (username: string, password: string) => {
+ registerPasswordUser: async (username: string, password: string) => {
await commCoreModule.initializeCryptoAccount();
const [
{ blobPayload, signature },
@@ -209,7 +209,7 @@
commCoreModule.getOneTimeKeys(ONE_TIME_KEYS_NUMBER),
commCoreModule.validateAndGetPrekeys(),
]);
- const registrationResult = await commRustModule.registerUser(
+ const registrationResult = await commRustModule.registerPasswordUser(
username,
password,
blobPayload,
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
@@ -58,8 +58,8 @@
mod ffi {
extern "Rust" {
- #[cxx_name = "identityRegisterUser"]
- fn register_user(
+ #[cxx_name = "identityRegisterPasswordUser"]
+ fn register_password_user(
username: String,
password: String,
key_payload: String,
@@ -489,7 +489,7 @@
}
#[instrument]
-fn register_user(
+fn register_password_user(
username: String,
password: String,
key_payload: String,
@@ -515,7 +515,7 @@
content_one_time_keys,
notif_one_time_keys,
};
- let result = register_user_helper(password_user_info).await;
+ let result = register_password_user_helper(password_user_info).await;
handle_string_result_as_callback(result, promise_id);
});
}
@@ -554,7 +554,7 @@
}
}
-async fn register_user_helper(
+async fn register_password_user_helper(
password_user_info: PasswordUserInfo,
) -> Result<String, Error> {
let mut client_registration = Registration::new();
diff --git a/native/schema/CommRustModuleSchema.js b/native/schema/CommRustModuleSchema.js
--- a/native/schema/CommRustModuleSchema.js
+++ b/native/schema/CommRustModuleSchema.js
@@ -7,7 +7,7 @@
export interface Spec extends TurboModule {
+generateNonce: () => Promise<string>;
- +registerUser: (
+ +registerPasswordUser: (
username: string,
password: string,
keyPayload: string,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 1, 12:19 AM (21 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2208474
Default Alt Text
D11079.diff (11 KB)
Attached To
Mode
D11079: [lib][native] rename registerUser -> registerPasswordUser
Attached
Detach File
Event Timeline
Log In to Comment