Page MenuHomePhabricator

D12547.id41629.diff
No OneTemporary

D12547.id41629.diff

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
@@ -158,14 +158,6 @@
siweSignature: string,
fid: ?string,
) => Promise<IdentityAuthResult>;
- // Users cannot register from web
- +registerReservedWalletUser?: (
- walletAddress: string,
- siweMessage: string,
- siweSignature: string,
- keyserverMessage: string,
- keyserverSignature: string,
- ) => Promise<IdentityAuthResult>;
+logInWalletUser: (
walletAddress: string,
siweMessage: string,
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
@@ -65,21 +65,6 @@
jsi::Array notifOneTimeKeys,
jsi::String farcasterID,
jsi::String initialDeviceList) override;
- virtual jsi::Value registerReservedWalletUser(
- 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 keyserverMessage,
- jsi::String keyserverSignature,
- 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
@@ -258,68 +258,6 @@
});
}
-jsi::Value CommRustModule::registerReservedWalletUser(
- 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 keyserverMessage,
- jsi::String keyserverSignature,
- jsi::String initialDeviceList) {
- auto siweMessageRust = jsiStringToRustString(siweMessage, rt);
- auto siweSignatureRust = jsiStringToRustString(siweSignature, rt);
- auto keyPayloadRust = jsiStringToRustString(keyPayload, rt);
- auto keyPayloadSignatureRust = jsiStringToRustString(keyPayloadSignature, rt);
- auto contentPrekeyRust = jsiStringToRustString(contentPrekey, rt);
- auto contentPrekeySignatureRust =
- jsiStringToRustString(contentPrekeySignature, rt);
- auto notifPrekeyRust = jsiStringToRustString(notifPrekey, rt);
- auto notifPrekeySignatureRust =
- jsiStringToRustString(notifPrekeySignature, rt);
- auto contentOneTimeKeysRust = jsiStringArrayToRustVec(contentOneTimeKeys, rt);
- auto notifOneTimeKeysRust = jsiStringArrayToRustVec(notifOneTimeKeys, rt);
- auto keyserverMessageRust = jsiStringToRustString(keyserverMessage, rt);
- auto keyserverSignatureRust = jsiStringToRustString(keyserverSignature, rt);
- auto initialDeviceListRust = jsiStringToRustString(initialDeviceList, rt);
-
- return createPromiseAsJSIValue(
- rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {
- std::string error;
- try {
- auto currentID = RustPromiseManager::instance.addPromise(
- {promise, this->jsInvoker_, innerRt});
- identityRegisterReservedWalletUser(
- siweMessageRust,
- siweSignatureRust,
- keyPayloadRust,
- keyPayloadSignatureRust,
- contentPrekeyRust,
- contentPrekeySignatureRust,
- notifPrekeyRust,
- notifPrekeySignatureRust,
- contentOneTimeKeysRust,
- notifOneTimeKeysRust,
- keyserverMessageRust,
- keyserverSignatureRust,
- initialDeviceListRust,
- currentID);
- } catch (const std::exception &e) {
- error = e.what();
- };
- if (!error.empty()) {
- this->jsInvoker_->invokeAsync(
- [error, promise]() { promise->reject(error); });
- }
- });
-}
-
jsi::Value CommRustModule::logInWalletUser(
jsi::Runtime &rt,
jsi::String siweMessage,
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
@@ -27,9 +27,6 @@
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), args[11].asString(rt));
}
-static jsi::Value __hostFunction_CommRustModuleSchemaCxxSpecJSI_registerReservedWalletUser(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommRustModuleSchemaCxxSpecJSI *>(&turboModule)->registerReservedWalletUser(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), args[12].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));
}
@@ -107,7 +104,6 @@
methodMap_["registerReservedPasswordUser"] = MethodMetadata {13, __hostFunction_CommRustModuleSchemaCxxSpecJSI_registerReservedPasswordUser};
methodMap_["logInPasswordUser"] = MethodMetadata {8, __hostFunction_CommRustModuleSchemaCxxSpecJSI_logInPasswordUser};
methodMap_["registerWalletUser"] = MethodMetadata {12, __hostFunction_CommRustModuleSchemaCxxSpecJSI_registerWalletUser};
- methodMap_["registerReservedWalletUser"] = MethodMetadata {13, __hostFunction_CommRustModuleSchemaCxxSpecJSI_registerReservedWalletUser};
methodMap_["logInWalletUser"] = MethodMetadata {8, __hostFunction_CommRustModuleSchemaCxxSpecJSI_logInWalletUser};
methodMap_["updatePassword"] = MethodMetadata {5, __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
@@ -25,7 +25,6 @@
virtual jsi::Value registerReservedPasswordUser(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 keyserverMessage, jsi::String keyserverSignature, 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, jsi::String initialDeviceList) = 0;
- virtual jsi::Value registerReservedWalletUser(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 keyserverMessage, jsi::String keyserverSignature, 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 oldPassword, jsi::String newPassword) = 0;
virtual jsi::Value deletePasswordUser(jsi::Runtime &rt, jsi::String userID, jsi::String deviceID, jsi::String accessToken, jsi::String password) = 0;
@@ -110,14 +109,6 @@
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), std::move(initialDeviceList));
}
- jsi::Value registerReservedWalletUser(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 keyserverMessage, jsi::String keyserverSignature, jsi::String initialDeviceList) override {
- static_assert(
- bridging::getParameterCount(&T::registerReservedWalletUser) == 14,
- "Expected registerReservedWalletUser(...) to have 14 parameters");
-
- return bridging::callFromJs<jsi::Value>(
- rt, &T::registerReservedWalletUser, 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(keyserverMessage), std::move(keyserverSignature), 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(
bridging::getParameterCount(&T::logInWalletUser) == 9,
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
@@ -465,48 +465,6 @@
primaryIdentityPublicKeys.ed25519,
);
},
- registerReservedWalletUser: async (
- walletAddress: string,
- siweMessage: string,
- siweSignature: string,
- keyserverMessage: string,
- keyserverSignature: string,
- ) => {
- await commCoreModule.initializeCryptoAccount();
- const [
- { blobPayload, signature, primaryIdentityPublicKeys },
- { contentOneTimeKeys, notificationsOneTimeKeys },
- prekeys,
- ] = await Promise.all([
- commCoreModule.getUserPublicKey(),
- commCoreModule.getOneTimeKeys(ONE_TIME_KEYS_NUMBER),
- commCoreModule.validateAndGetPrekeys(),
- ]);
- const initialDeviceList = await createAndSignInitialDeviceList(
- primaryIdentityPublicKeys.ed25519,
- );
- const registrationResult =
- await commRustModule.registerReservedWalletUser(
- siweMessage,
- siweSignature,
- blobPayload,
- signature,
- prekeys.contentPrekey,
- prekeys.contentPrekeySignature,
- prekeys.notifPrekey,
- prekeys.notifPrekeySignature,
- getOneTimeKeyValues(contentOneTimeKeys),
- getOneTimeKeyValues(notificationsOneTimeKeys),
- keyserverMessage,
- keyserverSignature,
- JSON.stringify(initialDeviceList),
- );
-
- return await processAuthResult(
- registrationResult,
- primaryIdentityPublicKeys.ed25519,
- );
- },
logInWalletUser: async (
walletAddress: string,
siweMessage: string,
diff --git a/native/native_rust_library/src/identity.rs b/native/native_rust_library/src/identity.rs
--- a/native/native_rust_library/src/identity.rs
+++ b/native/native_rust_library/src/identity.rs
@@ -145,15 +145,6 @@
pub initial_device_list: String,
}
-pub struct RegisterReservedWalletUserInfo {
- pub siwe_message: String,
- pub siwe_signature: String,
- pub device_keys: DeviceKeys,
- pub keyserver_message: String,
- pub keyserver_signature: String,
- pub initial_device_list: String,
-}
-
/// Counterpart of proto [`AuthResponse`] message
/// that implements the `Serialize` trait.
#[derive(Serialize)]
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
@@ -7,8 +7,7 @@
get_unauthenticated_client,
protos::unauth::{
RegistrationFinishRequest, RegistrationStartRequest,
- ReservedRegistrationStartRequest, ReservedWalletRegistrationRequest,
- WalletAuthRequest,
+ ReservedRegistrationStartRequest, WalletAuthRequest,
},
};
use tracing::instrument;
@@ -16,7 +15,7 @@
use super::{
farcaster::farcaster_id_string_to_option, IdentityAuthResult,
RegisterPasswordUserInfo, RegisterReservedPasswordUserInfo,
- RegisterReservedWalletUserInfo, RegisterWalletUserInfo, PLATFORM_METADATA,
+ RegisterWalletUserInfo, PLATFORM_METADATA,
};
#[allow(clippy::too_many_arguments)]
@@ -144,46 +143,6 @@
handle_string_result_as_callback(result, promise_id);
});
}
-
- #[instrument]
- pub fn register_reserved_wallet_user(
- siwe_message: String,
- siwe_signature: String,
- key_payload: String,
- key_payload_signature: String,
- content_prekey: String,
- content_prekey_signature: String,
- notif_prekey: String,
- notif_prekey_signature: String,
- content_one_time_keys: Vec<String>,
- notif_one_time_keys: Vec<String>,
- keyserver_message: String,
- keyserver_signature: String,
- initial_device_list: String,
- promise_id: u32,
- ) {
- RUNTIME.spawn(async move {
- let wallet_user_info = RegisterReservedWalletUserInfo {
- siwe_message,
- siwe_signature,
- device_keys: DeviceKeys {
- key_payload,
- key_payload_signature,
- content_prekey,
- content_prekey_signature,
- notif_prekey,
- notif_prekey_signature,
- content_one_time_keys,
- notif_one_time_keys,
- },
- keyserver_message,
- keyserver_signature,
- initial_device_list,
- };
- let result = register_reserved_wallet_user_helper(wallet_user_info).await;
- handle_string_result_as_callback(result, promise_id);
- });
- }
}
async fn register_password_user_helper(
@@ -298,28 +257,3 @@
let auth_result = IdentityAuthResult::from(registration_response);
Ok(serde_json::to_string(&auth_result)?)
}
-
-async fn register_reserved_wallet_user_helper(
- wallet_user_info: RegisterReservedWalletUserInfo,
-) -> Result<String, Error> {
- let registration_request = ReservedWalletRegistrationRequest {
- siwe_message: wallet_user_info.siwe_message,
- siwe_signature: wallet_user_info.siwe_signature,
- device_key_upload: Some(wallet_user_info.device_keys.into()),
- keyserver_message: wallet_user_info.keyserver_message,
- keyserver_signature: wallet_user_info.keyserver_signature,
- initial_device_list: wallet_user_info.initial_device_list,
- };
-
- let mut identity_client =
- get_unauthenticated_client(IDENTITY_SOCKET_ADDR, PLATFORM_METADATA.clone())
- .await?;
-
- let registration_response = identity_client
- .register_reserved_wallet_user(registration_request)
- .await?
- .into_inner();
-
- let auth_result = IdentityAuthResult::from(registration_response);
- Ok(serde_json::to_string(&auth_result)?)
-}
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
@@ -112,24 +112,6 @@
promise_id: u32,
);
- #[cxx_name = "identityRegisterReservedWalletUser"]
- fn register_reserved_wallet_user(
- siwe_message: String,
- siwe_signature: String,
- key_payload: String,
- key_payload_signature: String,
- content_prekey: String,
- content_prekey_signature: String,
- notif_prekey: String,
- notif_prekey_signature: String,
- content_one_time_keys: Vec<String>,
- notif_one_time_keys: Vec<String>,
- keyserver_message: String,
- keyserver_signature: String,
- initial_device_list: String,
- promise_id: u32,
- );
-
#[cxx_name = "identityLogInWalletUser"]
fn log_in_wallet_user(
siwe_message: String,
diff --git a/native/schema/CommRustModuleSchema.js b/native/schema/CommRustModuleSchema.js
--- a/native/schema/CommRustModuleSchema.js
+++ b/native/schema/CommRustModuleSchema.js
@@ -60,21 +60,6 @@
farcasterID: string,
initialDeviceList: string,
) => Promise<string>;
- +registerReservedWalletUser: (
- siweMessage: string,
- siweSignature: string,
- keyPayload: string,
- keyPayloadSignature: string,
- contentPrekey: string,
- contentPrekeySignature: string,
- notifPrekey: string,
- notifPrekeySignature: string,
- contentOneTimeKeys: $ReadOnlyArray<string>,
- notifOneTimeKeys: $ReadOnlyArray<string>,
- keyserverMessage: string,
- keyserverSignature: string,
- initialDeviceList: string,
- ) => Promise<string>;
+logInWalletUser: (
siweMessage: string,
siweSignature: string,
diff --git a/services/identity/src/client_service.rs b/services/identity/src/client_service.rs
--- a/services/identity/src/client_service.rs
+++ b/services/identity/src/client_service.rs
@@ -26,7 +26,7 @@
GenerateNonceResponse, OpaqueLoginFinishRequest, OpaqueLoginStartRequest,
OpaqueLoginStartResponse, RegistrationFinishRequest, RegistrationStartRequest,
RegistrationStartResponse, RemoveReservedUsernameRequest,
- ReservedRegistrationStartRequest, ReservedWalletRegistrationRequest,
+ ReservedRegistrationStartRequest,
SecondaryDeviceKeysUploadRequest, VerifyUserAccessTokenRequest,
VerifyUserAccessTokenResponse, WalletAuthRequest, GetFarcasterUsersRequest,
GetFarcasterUsersResponse
@@ -671,87 +671,6 @@
Ok(Response::new(response))
}
- #[tracing::instrument(skip_all)]
- async fn register_reserved_wallet_user(
- &self,
- request: tonic::Request<ReservedWalletRegistrationRequest>,
- ) -> Result<tonic::Response<AuthResponse>, tonic::Status> {
- let platform_metadata = get_platform_metadata(&request)?;
- let message = request.into_inner();
-
- let parsed_message = parse_and_verify_siwe_message(
- &message.siwe_message,
- &message.siwe_signature,
- )?;
-
- self.verify_and_remove_nonce(&parsed_message.nonce).await?;
-
- let wallet_address = eip55(&parsed_message.address);
-
- self.check_wallet_address_taken(&wallet_address).await?;
-
- let maybe_user_id = self
- .client
- .get_user_id_from_reserved_usernames_table(&wallet_address)
- .await
- .map_err(handle_db_error)?;
- let Some(user_id) = maybe_user_id else {
- return Err(tonic::Status::permission_denied(
- tonic_status_messages::WALLET_ADDRESS_NOT_RESERVED,
- ));
- };
-
- let flattened_device_key_upload =
- construct_flattened_device_key_upload(&message)?;
- self
- .check_device_id_taken(&flattened_device_key_upload, None)
- .await?;
-
- let initial_device_list = message.get_and_verify_initial_device_list()?;
- let social_proof =
- SocialProof::new(message.siwe_message, message.siwe_signature);
-
- let login_time = chrono::Utc::now();
- self
- .client
- .add_wallet_user_to_users_table(
- flattened_device_key_upload.clone(),
- wallet_address.clone(),
- social_proof,
- Some(user_id.clone()),
- platform_metadata,
- login_time,
- None,
- initial_device_list,
- )
- .await
- .map_err(handle_db_error)?;
-
- let token = AccessTokenData::with_created_time(
- user_id.clone(),
- flattened_device_key_upload.device_id_key,
- login_time,
- crate::token::AuthType::Wallet,
- &mut OsRng,
- );
-
- let access_token = token.access_token.clone();
-
- self
- .client
- .put_access_token_data(token)
- .await
- .map_err(handle_db_error)?;
-
- let response = AuthResponse {
- user_id,
- access_token,
- username: wallet_address,
- };
-
- Ok(Response::new(response))
- }
-
#[tracing::instrument(skip_all)]
async fn upload_keys_for_registered_device_and_log_in(
&self,
diff --git a/services/identity/src/grpc_utils.rs b/services/identity/src/grpc_utils.rs
--- a/services/identity/src/grpc_utils.rs
+++ b/services/identity/src/grpc_utils.rs
@@ -14,8 +14,7 @@
unauth::{
DeviceKeyUpload, ExistingDeviceLoginRequest, OpaqueLoginStartRequest,
RegistrationStartRequest, ReservedRegistrationStartRequest,
- ReservedWalletRegistrationRequest, SecondaryDeviceKeysUploadRequest,
- WalletAuthRequest,
+ SecondaryDeviceKeysUploadRequest, WalletAuthRequest,
},
},
};
@@ -166,12 +165,6 @@
}
}
-impl DeviceKeyUploadData for ReservedWalletRegistrationRequest {
- fn device_key_upload(&self) -> Option<&DeviceKeyUpload> {
- self.device_key_upload.as_ref()
- }
-}
-
impl DeviceKeyUploadData for SecondaryDeviceKeysUploadRequest {
fn device_key_upload(&self) -> Option<&DeviceKeyUpload> {
self.device_key_upload.as_ref()
@@ -298,11 +291,6 @@
&self.initial_device_list
}
}
-impl RegistrationData for ReservedWalletRegistrationRequest {
- fn initial_device_list(&self) -> &str {
- &self.initial_device_list
- }
-}
/// Similar to `[DeviceKeyUploadActions]` but only for registration requests
pub trait RegistrationActions {
diff --git a/shared/protos/identity_unauth.proto b/shared/protos/identity_unauth.proto
--- a/shared/protos/identity_unauth.proto
+++ b/shared/protos/identity_unauth.proto
@@ -25,8 +25,6 @@
rpc LogInWalletUser(WalletAuthRequest) returns (AuthResponse) {}
rpc RegisterWalletUser(WalletAuthRequest) returns (AuthResponse) {}
- rpc RegisterReservedWalletUser(ReservedWalletRegistrationRequest) returns
- (AuthResponse) {}
rpc UploadKeysForRegisteredDeviceAndLogIn(SecondaryDeviceKeysUploadRequest)
returns (AuthResponse) {}
@@ -232,30 +230,6 @@
string initial_device_list = 5;
}
-message ReservedWalletRegistrationRequest {
- string siwe_message = 1;
- string siwe_signature = 2;
- // Information specific to a user's device needed to open a new channel of
- // communication with this user
- DeviceKeyUpload device_key_upload = 3;
- // Message from authoritative keyserver attesting that a given user
- // has ownership of a given wallet address
- string keyserver_message = 4;
- // Above message signed with authoritative keyserver's signing ed25519 key
- string keyserver_signature = 5;
- // A stringified JSON object of the following format:
- // {
- // "rawDeviceList": JSON.stringify({
- // "devices": [<primary_device_id: string>]
- // "timestamp": <UTC timestamp in milliseconds: int>,
- // }),
- // "curPrimarySignature": "base64-encoded primary device signature"
- // }
- // It's an empty string when used for older clients
- // which don't sign device lists yet.
- string initial_device_list = 6;
-}
-
// UploadKeysForRegisteredDeviceAndLogIn
message SecondaryDeviceKeysUploadRequest {
diff --git a/web/protobufs/identity-unauth-structs.cjs b/web/protobufs/identity-unauth-structs.cjs
--- a/web/protobufs/identity-unauth-structs.cjs
+++ b/web/protobufs/identity-unauth-structs.cjs
@@ -45,7 +45,6 @@
goog.exportSymbol('proto.identity.unauth.RegistrationStartResponse', null, global);
goog.exportSymbol('proto.identity.unauth.RemoveReservedUsernameRequest', null, global);
goog.exportSymbol('proto.identity.unauth.ReservedRegistrationStartRequest', null, global);
-goog.exportSymbol('proto.identity.unauth.ReservedWalletRegistrationRequest', null, global);
goog.exportSymbol('proto.identity.unauth.SecondaryDeviceKeysUploadRequest', null, global);
goog.exportSymbol('proto.identity.unauth.VerifyUserAccessTokenRequest', null, global);
goog.exportSymbol('proto.identity.unauth.VerifyUserAccessTokenResponse', null, global);
@@ -323,27 +322,6 @@
*/
proto.identity.unauth.WalletAuthRequest.displayName = 'proto.identity.unauth.WalletAuthRequest';
}
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest = function(opt_data) {
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
-};
-goog.inherits(proto.identity.unauth.ReservedWalletRegistrationRequest, jspb.Message);
-if (goog.DEBUG && !COMPILED) {
- /**
- * @public
- * @override
- */
- proto.identity.unauth.ReservedWalletRegistrationRequest.displayName = 'proto.identity.unauth.ReservedWalletRegistrationRequest';
-}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@@ -3544,307 +3522,6 @@
-if (jspb.Message.GENERATE_TO_OBJECT) {
-/**
- * Creates an object representation of this proto.
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
- * Optional fields that are not set will be set to undefined.
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
- * For the list of reserved names please see:
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
- * JSPB instance for transitional soy proto support:
- * http://goto/soy-param-migration
- * @return {!Object}
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.toObject = function(opt_includeInstance) {
- return proto.identity.unauth.ReservedWalletRegistrationRequest.toObject(opt_includeInstance, this);
-};
-
-
-/**
- * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
- * the JSPB instance for transitional soy proto support:
- * http://goto/soy-param-migration
- * @param {!proto.identity.unauth.ReservedWalletRegistrationRequest} msg The msg instance to transform.
- * @return {!Object}
- * @suppress {unusedLocalVariables} f is only used for nested messages
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.toObject = function(includeInstance, msg) {
- var f, obj = {
- siweMessage: jspb.Message.getFieldWithDefault(msg, 1, ""),
- siweSignature: jspb.Message.getFieldWithDefault(msg, 2, ""),
- deviceKeyUpload: (f = msg.getDeviceKeyUpload()) && proto.identity.unauth.DeviceKeyUpload.toObject(includeInstance, f),
- keyserverMessage: jspb.Message.getFieldWithDefault(msg, 4, ""),
- keyserverSignature: jspb.Message.getFieldWithDefault(msg, 5, ""),
- initialDeviceList: jspb.Message.getFieldWithDefault(msg, 6, "")
- };
-
- if (includeInstance) {
- obj.$jspbMessageInstance = msg;
- }
- return obj;
-};
-}
-
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest}
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.deserializeBinary = function(bytes) {
- var reader = new jspb.BinaryReader(bytes);
- var msg = new proto.identity.unauth.ReservedWalletRegistrationRequest;
- return proto.identity.unauth.ReservedWalletRegistrationRequest.deserializeBinaryFromReader(msg, reader);
-};
-
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.identity.unauth.ReservedWalletRegistrationRequest} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest}
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.deserializeBinaryFromReader = function(msg, reader) {
- while (reader.nextField()) {
- if (reader.isEndGroup()) {
- break;
- }
- var field = reader.getFieldNumber();
- switch (field) {
- case 1:
- var value = /** @type {string} */ (reader.readString());
- msg.setSiweMessage(value);
- break;
- case 2:
- var value = /** @type {string} */ (reader.readString());
- msg.setSiweSignature(value);
- break;
- case 3:
- var value = new proto.identity.unauth.DeviceKeyUpload;
- reader.readMessage(value,proto.identity.unauth.DeviceKeyUpload.deserializeBinaryFromReader);
- msg.setDeviceKeyUpload(value);
- break;
- case 4:
- var value = /** @type {string} */ (reader.readString());
- msg.setKeyserverMessage(value);
- break;
- case 5:
- var value = /** @type {string} */ (reader.readString());
- msg.setKeyserverSignature(value);
- break;
- case 6:
- var value = /** @type {string} */ (reader.readString());
- msg.setInitialDeviceList(value);
- break;
- default:
- reader.skipField();
- break;
- }
- }
- return msg;
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.serializeBinary = function() {
- var writer = new jspb.BinaryWriter();
- proto.identity.unauth.ReservedWalletRegistrationRequest.serializeBinaryToWriter(this, writer);
- return writer.getResultBuffer();
-};
-
-
-/**
- * Serializes the given message to binary data (in protobuf wire
- * format), writing to the given BinaryWriter.
- * @param {!proto.identity.unauth.ReservedWalletRegistrationRequest} message
- * @param {!jspb.BinaryWriter} writer
- * @suppress {unusedLocalVariables} f is only used for nested messages
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.serializeBinaryToWriter = function(message, writer) {
- var f = undefined;
- f = message.getSiweMessage();
- if (f.length > 0) {
- writer.writeString(
- 1,
- f
- );
- }
- f = message.getSiweSignature();
- if (f.length > 0) {
- writer.writeString(
- 2,
- f
- );
- }
- f = message.getDeviceKeyUpload();
- if (f != null) {
- writer.writeMessage(
- 3,
- f,
- proto.identity.unauth.DeviceKeyUpload.serializeBinaryToWriter
- );
- }
- f = message.getKeyserverMessage();
- if (f.length > 0) {
- writer.writeString(
- 4,
- f
- );
- }
- f = message.getKeyserverSignature();
- if (f.length > 0) {
- writer.writeString(
- 5,
- f
- );
- }
- f = message.getInitialDeviceList();
- if (f.length > 0) {
- writer.writeString(
- 6,
- f
- );
- }
-};
-
-
-/**
- * optional string siwe_message = 1;
- * @return {string}
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.getSiweMessage = function() {
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
-};
-
-
-/**
- * @param {string} value
- * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} returns this
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.setSiweMessage = function(value) {
- return jspb.Message.setProto3StringField(this, 1, value);
-};
-
-
-/**
- * optional string siwe_signature = 2;
- * @return {string}
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.getSiweSignature = function() {
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
-};
-
-
-/**
- * @param {string} value
- * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} returns this
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.setSiweSignature = function(value) {
- return jspb.Message.setProto3StringField(this, 2, value);
-};
-
-
-/**
- * optional DeviceKeyUpload device_key_upload = 3;
- * @return {?proto.identity.unauth.DeviceKeyUpload}
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.getDeviceKeyUpload = function() {
- return /** @type{?proto.identity.unauth.DeviceKeyUpload} */ (
- jspb.Message.getWrapperField(this, proto.identity.unauth.DeviceKeyUpload, 3));
-};
-
-
-/**
- * @param {?proto.identity.unauth.DeviceKeyUpload|undefined} value
- * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} returns this
-*/
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.setDeviceKeyUpload = function(value) {
- return jspb.Message.setWrapperField(this, 3, value);
-};
-
-
-/**
- * Clears the message field making it undefined.
- * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} returns this
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.clearDeviceKeyUpload = function() {
- return this.setDeviceKeyUpload(undefined);
-};
-
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.hasDeviceKeyUpload = function() {
- return jspb.Message.getField(this, 3) != null;
-};
-
-
-/**
- * optional string keyserver_message = 4;
- * @return {string}
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.getKeyserverMessage = function() {
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
-};
-
-
-/**
- * @param {string} value
- * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} returns this
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.setKeyserverMessage = function(value) {
- return jspb.Message.setProto3StringField(this, 4, value);
-};
-
-
-/**
- * optional string keyserver_signature = 5;
- * @return {string}
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.getKeyserverSignature = function() {
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
-};
-
-
-/**
- * @param {string} value
- * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} returns this
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.setKeyserverSignature = function(value) {
- return jspb.Message.setProto3StringField(this, 5, value);
-};
-
-
-/**
- * optional string initial_device_list = 6;
- * @return {string}
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.getInitialDeviceList = function() {
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
-};
-
-
-/**
- * @param {string} value
- * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} returns this
- */
-proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.setInitialDeviceList = function(value) {
- return jspb.Message.setProto3StringField(this, 6, value);
-};
-
-
-
-
-
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
diff --git a/web/protobufs/identity-unauth-structs.cjs.flow b/web/protobufs/identity-unauth-structs.cjs.flow
--- a/web/protobufs/identity-unauth-structs.cjs.flow
+++ b/web/protobufs/identity-unauth-structs.cjs.flow
@@ -362,44 +362,6 @@
initialDeviceList: string,
};
-declare export class ReservedWalletRegistrationRequest extends Message {
- getSiweMessage(): string;
- setSiweMessage(value: string): ReservedWalletRegistrationRequest;
-
- getSiweSignature(): string;
- setSiweSignature(value: string): ReservedWalletRegistrationRequest;
-
- getDeviceKeyUpload(): DeviceKeyUpload | void;
- setDeviceKeyUpload(value?: DeviceKeyUpload): ReservedWalletRegistrationRequest;
- hasDeviceKeyUpload(): boolean;
- clearDeviceKeyUpload(): ReservedWalletRegistrationRequest;
-
- getKeyserverMessage(): string;
- setKeyserverMessage(value: string): ReservedWalletRegistrationRequest;
-
- getKeyserverSignature(): string;
- setKeyserverSignature(value: string): ReservedWalletRegistrationRequest;
-
- getInitialDeviceList(): string;
- setInitialDeviceList(value: string): ReservedWalletRegistrationRequest;
-
- serializeBinary(): Uint8Array;
- toObject(includeInstance?: boolean): ReservedWalletRegistrationRequestObject;
- static toObject(includeInstance: boolean, msg: ReservedWalletRegistrationRequest): ReservedWalletRegistrationRequestObject;
- static serializeBinaryToWriter(message: ReservedWalletRegistrationRequest, writer: BinaryWriter): void;
- static deserializeBinary(bytes: Uint8Array): ReservedWalletRegistrationRequest;
- static deserializeBinaryFromReader(message: ReservedWalletRegistrationRequest, reader: BinaryReader): ReservedWalletRegistrationRequest;
-}
-
-export type ReservedWalletRegistrationRequestObject = {
- siweMessage: string,
- siweSignature: string,
- deviceKeyUpload?: DeviceKeyUploadObject,
- keyserverMessage: string,
- keyserverSignature: string,
- initialDeviceList: string,
-};
-
declare export class SecondaryDeviceKeysUploadRequest extends Message {
getUserId(): string;
setUserId(value: string): SecondaryDeviceKeysUploadRequest;
diff --git a/web/protobufs/identity-unauth.cjs b/web/protobufs/identity-unauth.cjs
--- a/web/protobufs/identity-unauth.cjs
+++ b/web/protobufs/identity-unauth.cjs
@@ -503,67 +503,6 @@
};
-/**
- * @const
- * @type {!grpc.web.MethodDescriptor<
- * !proto.identity.unauth.ReservedWalletRegistrationRequest,
- * !proto.identity.unauth.AuthResponse>}
- */
-const methodDescriptor_IdentityClientService_RegisterReservedWalletUser = new grpc.web.MethodDescriptor(
- '/identity.unauth.IdentityClientService/RegisterReservedWalletUser',
- grpc.web.MethodType.UNARY,
- proto.identity.unauth.ReservedWalletRegistrationRequest,
- proto.identity.unauth.AuthResponse,
- /**
- * @param {!proto.identity.unauth.ReservedWalletRegistrationRequest} request
- * @return {!Uint8Array}
- */
- function(request) {
- return request.serializeBinary();
- },
- proto.identity.unauth.AuthResponse.deserializeBinary
-);
-
-
-/**
- * @param {!proto.identity.unauth.ReservedWalletRegistrationRequest} request The
- * request proto
- * @param {?Object<string, string>} metadata User defined
- * call metadata
- * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.AuthResponse)}
- * callback The callback function(error, response)
- * @return {!grpc.web.ClientReadableStream<!proto.identity.unauth.AuthResponse>|undefined}
- * The XHR Node Readable Stream
- */
-proto.identity.unauth.IdentityClientServiceClient.prototype.registerReservedWalletUser =
- function(request, metadata, callback) {
- return this.client_.rpcCall(this.hostname_ +
- '/identity.unauth.IdentityClientService/RegisterReservedWalletUser',
- request,
- metadata || {},
- methodDescriptor_IdentityClientService_RegisterReservedWalletUser,
- callback);
-};
-
-
-/**
- * @param {!proto.identity.unauth.ReservedWalletRegistrationRequest} request The
- * request proto
- * @param {?Object<string, string>=} metadata User defined
- * call metadata
- * @return {!Promise<!proto.identity.unauth.AuthResponse>}
- * Promise that resolves to the response
- */
-proto.identity.unauth.IdentityClientServicePromiseClient.prototype.registerReservedWalletUser =
- function(request, metadata) {
- return this.client_.unaryCall(this.hostname_ +
- '/identity.unauth.IdentityClientService/RegisterReservedWalletUser',
- request,
- metadata || {},
- methodDescriptor_IdentityClientService_RegisterReservedWalletUser);
-};
-
-
/**
* @const
* @type {!grpc.web.MethodDescriptor<
diff --git a/web/protobufs/identity-unauth.cjs.flow b/web/protobufs/identity-unauth.cjs.flow
--- a/web/protobufs/identity-unauth.cjs.flow
+++ b/web/protobufs/identity-unauth.cjs.flow
@@ -58,13 +58,6 @@
response: identityStructs.AuthResponse) => void
): grpcWeb.ClientReadableStream<identityStructs.AuthResponse>;
- registerReservedWalletUser(
- request: identityStructs.ReservedWalletRegistrationRequest,
- metadata: grpcWeb.Metadata | void,
- callback: (err: grpcWeb.RpcError,
- response: identityStructs.AuthResponse) => void
- ): grpcWeb.ClientReadableStream<identityStructs.AuthResponse>;
-
uploadKeysForRegisteredDeviceAndLogIn(
request: identityStructs.SecondaryDeviceKeysUploadRequest,
metadata: grpcWeb.Metadata | void,
@@ -169,11 +162,6 @@
metadata?: grpcWeb.Metadata
): Promise<identityStructs.AuthResponse>;
- registerReservedWalletUser(
- request: identityStructs.ReservedWalletRegistrationRequest,
- metadata?: grpcWeb.Metadata
- ): Promise<identityStructs.AuthResponse>;
-
uploadKeysForRegisteredDeviceAndLogIn(
request: identityStructs.SecondaryDeviceKeysUploadRequest,
metadata?: grpcWeb.Metadata

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 3:56 PM (15 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2682013
Default Alt Text
D12547.id41629.diff (42 KB)

Event Timeline