diff --git a/services/identity/src/database/farcaster.rs b/services/identity/src/database/farcaster.rs index 0b4550264..01f8ad816 100644 --- a/services/identity/src/database/farcaster.rs +++ b/services/identity/src/database/farcaster.rs @@ -1,128 +1,148 @@ use comm_lib::aws::ddb::types::AttributeValue; use comm_lib::aws::ddb::types::ReturnValue; use comm_lib::database::AttributeExtractor; use comm_lib::database::AttributeMap; use comm_lib::database::DBItemAttributeError; use comm_lib::database::DBItemError; use comm_lib::database::Value; use tracing::error; use crate::constants::USERS_TABLE; use crate::constants::USERS_TABLE_FARCASTER_ID_ATTRIBUTE_NAME; use crate::constants::USERS_TABLE_FARCASTER_ID_INDEX; use crate::constants::USERS_TABLE_PARTITION_KEY; use crate::constants::USERS_TABLE_USERNAME_ATTRIBUTE; use crate::constants::USERS_TABLE_WALLET_ADDRESS_ATTRIBUTE; use crate::grpc_services::protos::unauth::FarcasterUser; use super::DatabaseClient; use super::Error; pub struct FarcasterUserData(pub FarcasterUser); impl DatabaseClient { pub async fn get_farcaster_users( &self, farcaster_ids: Vec, ) -> Result, Error> { let mut users: Vec = Vec::new(); for id in farcaster_ids { let query_response = self .client .query() .table_name(USERS_TABLE) .index_name(USERS_TABLE_FARCASTER_ID_INDEX) .key_condition_expression(format!( "{} = :val", USERS_TABLE_FARCASTER_ID_ATTRIBUTE_NAME )) .expression_attribute_values(":val", AttributeValue::S(id)) .send() .await .map_err(|e| { error!("Failed to query users by farcasterID: {:?}", e); Error::AwsSdk(e.into()) })? .items .and_then(|mut items| items.pop()) .map(FarcasterUserData::try_from) .transpose() .map_err(Error::from)?; if let Some(data) = query_response { users.push(data); } } Ok(users) } pub async fn add_farcaster_id( &self, user_id: String, farcaster_id: String, ) -> Result<(), Error> { let update_expression = format!( "SET {0} = if_not_exists({0}, :val)", USERS_TABLE_FARCASTER_ID_ATTRIBUTE_NAME, ); let response = self .client .update_item() .table_name(USERS_TABLE) .key(USERS_TABLE_PARTITION_KEY, AttributeValue::S(user_id)) .update_expression(update_expression) .expression_attribute_values( ":val", AttributeValue::S(farcaster_id.clone()), ) .return_values(ReturnValue::UpdatedNew) .send() .await .map_err(|e| Error::AwsSdk(e.into()))?; match response.attributes { None => return Err(Error::MissingItem), Some(mut attrs) => { let farcaster_id_from_table: String = attrs.take_attr(USERS_TABLE_FARCASTER_ID_ATTRIBUTE_NAME)?; if farcaster_id_from_table != farcaster_id { return Err(Error::CannotOverwrite); } } } Ok(()) } + + pub async fn remove_farcaster_id( + &self, + user_id: String, + ) -> Result<(), Error> { + let update_expression = + format!("REMOVE {}", USERS_TABLE_FARCASTER_ID_ATTRIBUTE_NAME); + + self + .client + .update_item() + .table_name(USERS_TABLE) + .key(USERS_TABLE_PARTITION_KEY, AttributeValue::S(user_id)) + .update_expression(update_expression) + .send() + .await + .map_err(|e| Error::AwsSdk(e.into()))?; + + Ok(()) + } } impl TryFrom for FarcasterUserData { type Error = DBItemError; fn try_from(mut attrs: AttributeMap) -> Result { let user_id = attrs.take_attr(USERS_TABLE_PARTITION_KEY)?; let maybe_username = attrs.take_attr(USERS_TABLE_USERNAME_ATTRIBUTE)?; let maybe_wallet_address = attrs.take_attr(USERS_TABLE_WALLET_ADDRESS_ATTRIBUTE)?; let username = match (maybe_username, maybe_wallet_address) { (Some(u), _) => u, (_, Some(w)) => w, (_, _) => { return Err(DBItemError { attribute_name: USERS_TABLE_USERNAME_ATTRIBUTE.to_string(), attribute_value: Value::AttributeValue(None), attribute_error: DBItemAttributeError::Missing, }); } }; let farcaster_id = attrs.take_attr(USERS_TABLE_FARCASTER_ID_ATTRIBUTE_NAME)?; Ok(Self(FarcasterUser { user_id, username, farcaster_id, })) } } diff --git a/services/identity/src/grpc_services/authenticated.rs b/services/identity/src/grpc_services/authenticated.rs index f937f65c9..0ec1859dd 100644 --- a/services/identity/src/grpc_services/authenticated.rs +++ b/services/identity/src/grpc_services/authenticated.rs @@ -1,575 +1,591 @@ use std::collections::HashMap; use crate::config::CONFIG; use crate::database::{DeviceListRow, DeviceListUpdate}; use crate::{ client_service::{handle_db_error, UpdateState, WorkflowInProgress}, constants::request_metadata, database::DatabaseClient, ddb_utils::DateTimeExt, grpc_services::shared::get_value, }; use chrono::{DateTime, Utc}; use comm_opaque2::grpc::protocol_error_to_grpc_status; use tonic::{Request, Response, Status}; use tracing::{debug, error, warn}; use super::protos::auth::{ identity, identity_client_service_server::IdentityClientService, GetDeviceListRequest, GetDeviceListResponse, Identity, InboundKeyInfo, InboundKeysForUserRequest, InboundKeysForUserResponse, KeyserverKeysResponse, LinkFarcasterAccountRequest, OutboundKeyInfo, OutboundKeysForUserRequest, OutboundKeysForUserResponse, RefreshUserPrekeysRequest, UpdateDeviceListRequest, UpdateUserPasswordFinishRequest, UpdateUserPasswordStartRequest, UpdateUserPasswordStartResponse, UploadOneTimeKeysRequest, }; use super::protos::unauth::Empty; #[derive(derive_more::Constructor)] pub struct AuthenticatedService { db_client: DatabaseClient, } fn get_auth_info(req: &Request<()>) -> Option<(String, String, String)> { debug!("Retrieving auth info for request: {:?}", req); let user_id = get_value(req, request_metadata::USER_ID)?; let device_id = get_value(req, request_metadata::DEVICE_ID)?; let access_token = get_value(req, request_metadata::ACCESS_TOKEN)?; Some((user_id, device_id, access_token)) } pub fn auth_interceptor( req: Request<()>, db_client: &DatabaseClient, ) -> Result, Status> { debug!("Intercepting request to check auth info: {:?}", req); let (user_id, device_id, access_token) = get_auth_info(&req) .ok_or_else(|| Status::unauthenticated("Missing credentials"))?; let handle = tokio::runtime::Handle::current(); let new_db_client = db_client.clone(); // This function cannot be `async`, yet must call the async db call // Force tokio to resolve future in current thread without an explicit .await let valid_token = tokio::task::block_in_place(move || { handle .block_on(new_db_client.verify_access_token( user_id, device_id, access_token, )) .map_err(handle_db_error) })?; if !valid_token { return Err(Status::aborted("Bad Credentials")); } Ok(req) } pub fn get_user_and_device_id( request: &Request, ) -> Result<(String, String), Status> { let user_id = get_value(request, request_metadata::USER_ID) .ok_or_else(|| Status::unauthenticated("Missing user_id field"))?; let device_id = get_value(request, request_metadata::DEVICE_ID) .ok_or_else(|| Status::unauthenticated("Missing device_id field"))?; Ok((user_id, device_id)) } #[tonic::async_trait] impl IdentityClientService for AuthenticatedService { async fn refresh_user_prekeys( &self, request: Request, ) -> Result, Status> { let (user_id, device_id) = get_user_and_device_id(&request)?; let message = request.into_inner(); debug!("Refreshing prekeys for user: {}", user_id); let content_keys = message .new_content_prekeys .ok_or_else(|| Status::invalid_argument("Missing content keys"))?; let notif_keys = message .new_notif_prekeys .ok_or_else(|| Status::invalid_argument("Missing notification keys"))?; self .db_client .update_device_prekeys( user_id, device_id, content_keys.into(), notif_keys.into(), ) .await .map_err(handle_db_error)?; let response = Response::new(Empty {}); Ok(response) } async fn get_outbound_keys_for_user( &self, request: tonic::Request, ) -> Result, tonic::Status> { let message = request.into_inner(); let user_id = &message.user_id; let devices_map = self .db_client .get_keys_for_user(user_id, true) .await .map_err(handle_db_error)? .ok_or_else(|| tonic::Status::not_found("user not found"))?; let transformed_devices = devices_map .into_iter() .map(|(key, device_info)| (key, OutboundKeyInfo::from(device_info))) .collect::>(); Ok(tonic::Response::new(OutboundKeysForUserResponse { devices: transformed_devices, })) } async fn get_inbound_keys_for_user( &self, request: tonic::Request, ) -> Result, tonic::Status> { use identity::IdentityInfo; let message = request.into_inner(); let user_id = &message.user_id; let devices_map = self .db_client .get_keys_for_user(user_id, false) .await .map_err(handle_db_error)? .ok_or_else(|| tonic::Status::not_found("user not found"))?; let transformed_devices = devices_map .into_iter() .map(|(key, device_info)| (key, InboundKeyInfo::from(device_info))) .collect::>(); let identifier = self .db_client .get_user_identifier(user_id) .await .map_err(handle_db_error)?; let identity_info = IdentityInfo::try_from(identifier)?; Ok(tonic::Response::new(InboundKeysForUserResponse { devices: transformed_devices, identity: Some(Identity { identity_info: Some(identity_info), }), })) } async fn get_keyserver_keys( &self, request: Request, ) -> Result, Status> { use identity::IdentityInfo; let message = request.into_inner(); let keyserver_info = self .db_client .get_keyserver_keys_for_user(&message.user_id) .await .map_err(handle_db_error)? .map(OutboundKeyInfo::from); let identifier = self .db_client .get_user_identifier(&message.user_id) .await .map_err(handle_db_error)?; let identity_info = IdentityInfo::try_from(identifier)?; let identity = Some(Identity { identity_info: Some(identity_info), }); let response = Response::new(KeyserverKeysResponse { keyserver_info, identity, }); return Ok(response); } async fn upload_one_time_keys( &self, request: tonic::Request, ) -> Result, tonic::Status> { let (user_id, device_id) = get_user_and_device_id(&request)?; let message = request.into_inner(); debug!("Attempting to update one time keys for user: {}", user_id); self .db_client .append_one_time_prekeys( device_id, message.content_one_time_prekeys, message.notif_one_time_prekeys, ) .await .map_err(handle_db_error)?; Ok(tonic::Response::new(Empty {})) } async fn update_user_password_start( &self, request: tonic::Request, ) -> Result, tonic::Status> { let (user_id, _) = get_user_and_device_id(&request)?; let message = request.into_inner(); let server_registration = comm_opaque2::server::Registration::new(); let server_message = server_registration .start( &CONFIG.server_setup, &message.opaque_registration_request, user_id.as_bytes(), ) .map_err(protocol_error_to_grpc_status)?; let update_state = UpdateState { user_id }; let session_id = self .db_client .insert_workflow(WorkflowInProgress::Update(update_state)) .await .map_err(handle_db_error)?; let response = UpdateUserPasswordStartResponse { session_id, opaque_registration_response: server_message, }; Ok(Response::new(response)) } async fn update_user_password_finish( &self, request: tonic::Request, ) -> Result, tonic::Status> { let message = request.into_inner(); let Some(WorkflowInProgress::Update(state)) = self .db_client .get_workflow(message.session_id) .await .map_err(handle_db_error)? else { return Err(tonic::Status::not_found("session not found")); }; let server_registration = comm_opaque2::server::Registration::new(); let password_file = server_registration .finish(&message.opaque_registration_upload) .map_err(protocol_error_to_grpc_status)?; self .db_client .update_user_password(state.user_id, password_file) .await .map_err(handle_db_error)?; let response = Empty {}; Ok(Response::new(response)) } async fn log_out_user( &self, request: tonic::Request, ) -> Result, tonic::Status> { let (user_id, device_id) = get_user_and_device_id(&request)?; self .db_client .remove_device(&user_id, &device_id) .await .map_err(handle_db_error)?; self .db_client .delete_access_token_data(user_id, device_id) .await .map_err(handle_db_error)?; let response = Empty {}; Ok(Response::new(response)) } async fn delete_user( &self, request: tonic::Request, ) -> Result, tonic::Status> { let (user_id, _) = get_user_and_device_id(&request)?; self .db_client .delete_user(user_id) .await .map_err(handle_db_error)?; let response = Empty {}; Ok(Response::new(response)) } async fn get_device_list_for_user( &self, request: tonic::Request, ) -> Result, tonic::Status> { let GetDeviceListRequest { user_id, since_timestamp, } = request.into_inner(); let since = since_timestamp .map(|timestamp| { DateTime::::from_utc_timestamp_millis(timestamp) .ok_or_else(|| tonic::Status::invalid_argument("Invalid timestamp")) }) .transpose()?; let mut db_result = self .db_client .get_device_list_history(user_id, since) .await .map_err(handle_db_error)?; // these should be sorted already, but just in case db_result.sort_by_key(|list| list.timestamp); let device_list_updates: Vec = db_result .into_iter() .map(RawDeviceList::from) .map(SignedDeviceList::try_from_raw) .collect::, _>>()?; let stringified_updates = device_list_updates .iter() .map(serde_json::to_string) .collect::, _>>() .map_err(|err| { error!("Failed to serialize device list updates: {}", err); tonic::Status::failed_precondition("unexpected error") })?; Ok(Response::new(GetDeviceListResponse { device_list_updates: stringified_updates, })) } async fn update_device_list( &self, request: tonic::Request, ) -> Result, tonic::Status> { let (user_id, _device_id) = get_user_and_device_id(&request)?; // TODO: when we stop doing "primary device rotation" (migration procedure) // we should verify if this RPC is called by primary device only let new_list = SignedDeviceList::try_from(request.into_inner())?; let update = DeviceListUpdate::try_from(new_list)?; self .db_client .apply_devicelist_update(&user_id, update) .await .map_err(handle_db_error)?; Ok(Response::new(Empty {})) } async fn link_farcaster_account( &self, request: tonic::Request, ) -> Result, tonic::Status> { let (user_id, _) = get_user_and_device_id(&request)?; let message = request.into_inner(); let mut get_farcaster_users_response = self .db_client .get_farcaster_users(vec![message.farcaster_id.clone()]) .await .map_err(handle_db_error)?; if get_farcaster_users_response.len() > 1 { error!("multiple users associated with the same Farcaster ID"); return Err(Status::failed_precondition("cannot link Farcaster ID")); } if let Some(u) = get_farcaster_users_response.pop() { if u.0.user_id == user_id { return Ok(Response::new(Empty {})); } else { return Err(Status::already_exists( "farcaster ID already associated with different user", )); } } self .db_client .add_farcaster_id(user_id, message.farcaster_id) .await .map_err(handle_db_error)?; let response = Empty {}; Ok(Response::new(response)) } + + async fn unlink_farcaster_account( + &self, + request: tonic::Request, + ) -> Result, tonic::Status> { + let (user_id, _) = get_user_and_device_id(&request)?; + + self + .db_client + .remove_farcaster_id(user_id) + .await + .map_err(handle_db_error)?; + + let response = Empty {}; + Ok(Response::new(response)) + } } // raw device list that can be serialized to JSON (and then signed in the future) #[derive(serde::Serialize, serde::Deserialize)] struct RawDeviceList { devices: Vec, timestamp: i64, } impl From for RawDeviceList { fn from(row: DeviceListRow) -> Self { Self { devices: row.device_ids, timestamp: row.timestamp.timestamp_millis(), } } } #[derive(serde::Serialize, serde::Deserialize)] #[serde(rename_all = "camelCase")] struct SignedDeviceList { /// JSON-stringified [`RawDeviceList`] raw_device_list: String, } impl SignedDeviceList { /// Serialize (and sign in the future) a [`RawDeviceList`] fn try_from_raw(raw: RawDeviceList) -> Result { let stringified_list = serde_json::to_string(&raw).map_err(|err| { error!("Failed to serialize raw device list: {}", err); tonic::Status::failed_precondition("unexpected error") })?; Ok(Self { raw_device_list: stringified_list, }) } fn as_raw(&self) -> Result { // The device list payload is sent as an escaped JSON payload. // Escaped double quotes need to be trimmed before attempting to deserialize serde_json::from_str(&self.raw_device_list.replace(r#"\""#, r#"""#)) .map_err(|err| { warn!("Failed to deserialize raw device list: {}", err); tonic::Status::invalid_argument("invalid device list payload") }) } } impl TryFrom for SignedDeviceList { type Error = tonic::Status; fn try_from(request: UpdateDeviceListRequest) -> Result { serde_json::from_str(&request.new_device_list).map_err(|err| { warn!("Failed to deserialize device list update: {}", err); tonic::Status::invalid_argument("invalid device list payload") }) } } impl TryFrom for DeviceListUpdate { type Error = tonic::Status; fn try_from(signed_list: SignedDeviceList) -> Result { let RawDeviceList { devices, timestamp: raw_timestamp, } = signed_list.as_raw()?; let timestamp = DateTime::::from_utc_timestamp_millis(raw_timestamp) .ok_or_else(|| { error!("Failed to parse RawDeviceList timestamp!"); tonic::Status::invalid_argument("invalid timestamp") })?; Ok(DeviceListUpdate::new(devices, timestamp)) } } #[cfg(test)] mod tests { use super::*; #[test] fn serialize_device_list_updates() { let raw_updates = vec![ RawDeviceList { devices: vec!["device1".into()], timestamp: 111111111, }, RawDeviceList { devices: vec!["device1".into(), "device2".into()], timestamp: 222222222, }, ]; let expected_raw_list1 = r#"{"devices":["device1"],"timestamp":111111111}"#; let expected_raw_list2 = r#"{"devices":["device1","device2"],"timestamp":222222222}"#; let signed_updates = raw_updates .into_iter() .map(SignedDeviceList::try_from_raw) .collect::, _>>() .expect("signing device list updates failed"); assert_eq!(signed_updates[0].raw_device_list, expected_raw_list1); assert_eq!(signed_updates[1].raw_device_list, expected_raw_list2); let stringified_updates = signed_updates .iter() .map(serde_json::to_string) .collect::, _>>() .expect("serialize signed device lists failed"); let expected_stringified_list1 = r#"{"rawDeviceList":"{\"devices\":[\"device1\"],\"timestamp\":111111111}"}"#; let expected_stringified_list2 = r#"{"rawDeviceList":"{\"devices\":[\"device1\",\"device2\"],\"timestamp\":222222222}"}"#; assert_eq!(stringified_updates[0], expected_stringified_list1); assert_eq!(stringified_updates[1], expected_stringified_list2); } #[test] fn deserialize_device_list_update() { let raw_payload = r#"{"rawDeviceList":"{\"devices\":[\"device1\",\"device2\"],\"timestamp\":123456789}"}"#; let request = UpdateDeviceListRequest { new_device_list: raw_payload.to_string(), }; let signed_list = SignedDeviceList::try_from(request) .expect("Failed to parse SignedDeviceList"); let update = DeviceListUpdate::try_from(signed_list) .expect("Failed to parse DeviceListUpdate from signed list"); let expected_timestamp = DateTime::::from_utc_timestamp_millis(123456789).unwrap(); assert_eq!(update.timestamp, expected_timestamp); assert_eq!( update.devices, vec!["device1".to_string(), "device2".to_string()] ); } } diff --git a/shared/protos/identity_auth.proto b/shared/protos/identity_auth.proto index ef862b87c..67c13ebac 100644 --- a/shared/protos/identity_auth.proto +++ b/shared/protos/identity_auth.proto @@ -1,206 +1,209 @@ syntax = "proto3"; import "identity_unauth.proto"; package identity.auth; // RPCs from a client (iOS, Android, or web) to identity service // // This service will assert authenticity of a device by verifying the access // token through an interceptor, thus avoiding the need to explicitly pass // the credentials on every request service IdentityClientService { // X3DH actions // Replenish one-time preKeys rpc UploadOneTimeKeys(UploadOneTimeKeysRequest) returns (identity.unauth.Empty) {} // Rotate a device's prekey and prekey signature // Rotated for deniability of older messages rpc RefreshUserPrekeys(RefreshUserPrekeysRequest) returns (identity.unauth.Empty) {} // Called by clients to get all device keys associated with a user in order // to open a new channel of communication on any of their devices. // Specially, this will return the following per device: // - Identity keys (both Content and Notif Keys) // - Prekey (including prekey signature) // - One-time Prekey rpc GetOutboundKeysForUser(OutboundKeysForUserRequest) returns (OutboundKeysForUserResponse) {} // Called by receivers of a communication request. The reponse will return // identity keys (both content and notif keys) and related prekeys per device, // but will not contain one-time keys. Additionally, the response will contain // the other user's username. rpc GetInboundKeysForUser(InboundKeysForUserRequest) returns (InboundKeysForUserResponse) {} // Called by user to update password and receive new access token rpc UpdateUserPasswordStart(UpdateUserPasswordStartRequest) returns (UpdateUserPasswordStartResponse) {} rpc UpdateUserPasswordFinish(UpdateUserPasswordFinishRequest) returns (identity.unauth.Empty) {} // Called by user to log out (clears device's keys and access token) rpc LogOutUser(identity.unauth.Empty) returns (identity.unauth.Empty) {} // Called by a user to delete their own account rpc DeleteUser(identity.unauth.Empty) returns (identity.unauth.Empty) {} // Called by clients to get required keys for opening a connection // to a user's keyserver rpc GetKeyserverKeys(OutboundKeysForUserRequest) returns (KeyserverKeysResponse) {} // Returns device list history rpc GetDeviceListForUser(GetDeviceListRequest) returns (GetDeviceListResponse) {} rpc UpdateDeviceList(UpdateDeviceListRequest) returns (identity.unauth.Empty) {} // Farcaster actions // Called by an existing user to link their Farcaster account rpc LinkFarcasterAccount(LinkFarcasterAccountRequest) returns (identity.unauth.Empty) {} + // Called by an existing user to unlink their Farcaster account + rpc UnlinkFarcasterAccount(identity.unauth.Empty) returns + (identity.unauth.Empty) {} } // Helper types message EthereumIdentity { string wallet_address = 1; string social_proof = 2; } message Identity { oneof identity_info { string username = 1; EthereumIdentity eth_identity = 2; } } // UploadOneTimeKeys // As OPKs get exhausted, they need to be refreshed message UploadOneTimeKeysRequest { repeated string content_one_time_prekeys = 1; repeated string notif_one_time_prekeys = 2; } // RefreshUserPreKeys message RefreshUserPrekeysRequest { identity.unauth.Prekey new_content_prekeys = 1; identity.unauth.Prekey new_notif_prekeys = 2; } // Information needed when establishing communication to someone else's device message OutboundKeyInfo { identity.unauth.IdentityKeyInfo identity_info = 1; identity.unauth.Prekey content_prekey = 2; identity.unauth.Prekey notif_prekey = 3; optional string one_time_content_prekey = 4; optional string one_time_notif_prekey = 5; } message KeyserverKeysResponse { optional OutboundKeyInfo keyserver_info = 1; Identity identity = 2; } // GetOutboundKeysForUser message OutboundKeysForUserResponse { // Map is keyed on devices' public ed25519 key used for signing map devices = 1; } // Information needed by a device to establish communcation when responding // to a request. // The device receiving a request only needs the content key and prekey. message OutboundKeysForUserRequest { string user_id = 1; } // GetInboundKeysForUser message InboundKeyInfo { identity.unauth.IdentityKeyInfo identity_info = 1; identity.unauth.Prekey content_prekey = 2; identity.unauth.Prekey notif_prekey = 3; } message InboundKeysForUserResponse { // Map is keyed on devices' public ed25519 key used for signing map devices = 1; Identity identity = 2; } message InboundKeysForUserRequest { string user_id = 1; } // UpdateUserPassword // Request for updating a user, similar to registration but need a // access token to validate user before updating password message UpdateUserPasswordStartRequest { // Message sent to initiate PAKE registration (step 1) bytes opaque_registration_request = 1; } // Do a user registration, but overwrite the existing credentials // after validation of user message UpdateUserPasswordFinishRequest { // Identifier used to correlate start and finish request string session_id = 1; // Opaque client registration upload (step 3) bytes opaque_registration_upload = 2; } message UpdateUserPasswordStartResponse { // Identifier used to correlate start request with finish request string session_id = 1; bytes opaque_registration_response = 2; } // GetDeviceListForUser message GetDeviceListRequest { // User whose device lists we want to retrieve string user_id = 1; // UTC timestamp in milliseconds // If none, whole device list history will be retrieved optional int64 since_timestamp = 2; } message GetDeviceListResponse { // A list of stringified JSON objects of the following format: // { // "rawDeviceList": JSON.stringify({ // "devices": [, ...] // "timestamp": , // }) // } repeated string device_list_updates = 1; } // UpdateDeviceListForUser message UpdateDeviceListRequest { // A stringified JSON object of the following format: // { // "rawDeviceList": JSON.stringify({ // "devices": [, ...] // "timestamp": , // }) // } string new_device_list = 1; } // LinkFarcasterAccount message LinkFarcasterAccountRequest { string farcaster_id = 1; } diff --git a/web/protobufs/identity-auth-client.cjs b/web/protobufs/identity-auth-client.cjs index 14dee1779..5fa2d0154 100644 --- a/web/protobufs/identity-auth-client.cjs +++ b/web/protobufs/identity-auth-client.cjs @@ -1,813 +1,874 @@ /** * @fileoverview gRPC-Web generated client stub for identity.auth * @enhanceable * @public * @generated */ // Code generated by protoc-gen-grpc-web. DO NOT EDIT. // versions: // protoc-gen-grpc-web v1.4.2 // protoc v3.21.12 // source: identity_auth.proto /* eslint-disable */ // @ts-nocheck const grpc = {}; grpc.web = require('grpc-web'); var identity_unauth_pb = require('./identity-unauth-structs.cjs') const proto = {}; proto.identity = {}; proto.identity.auth = require('./identity-auth-structs.cjs'); /** * @param {string} hostname * @param {?Object} credentials * @param {?grpc.web.ClientOptions} options * @constructor * @struct * @final */ proto.identity.auth.IdentityClientServiceClient = function(hostname, credentials, options) { if (!options) options = {}; options.format = 'text'; /** * @private @const {!grpc.web.GrpcWebClientBase} The client */ this.client_ = new grpc.web.GrpcWebClientBase(options); /** * @private @const {string} The hostname */ this.hostname_ = hostname.replace(/\/+$/, ''); }; /** * @param {string} hostname * @param {?Object} credentials * @param {?grpc.web.ClientOptions} options * @constructor * @struct * @final */ proto.identity.auth.IdentityClientServicePromiseClient = function(hostname, credentials, options) { if (!options) options = {}; options.format = 'text'; /** * @private @const {!grpc.web.GrpcWebClientBase} The client */ this.client_ = new grpc.web.GrpcWebClientBase(options); /** * @private @const {string} The hostname */ this.hostname_ = hostname.replace(/\/+$/, ''); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.UploadOneTimeKeysRequest, * !proto.identity.unauth.Empty>} */ const methodDescriptor_IdentityClientService_UploadOneTimeKeys = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/UploadOneTimeKeys', grpc.web.MethodType.UNARY, proto.identity.auth.UploadOneTimeKeysRequest, identity_unauth_pb.Empty, /** * @param {!proto.identity.auth.UploadOneTimeKeysRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, identity_unauth_pb.Empty.deserializeBinary ); /** * @param {!proto.identity.auth.UploadOneTimeKeysRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.uploadOneTimeKeys = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/UploadOneTimeKeys', request, metadata || {}, methodDescriptor_IdentityClientService_UploadOneTimeKeys, callback); }; /** * @param {!proto.identity.auth.UploadOneTimeKeysRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.uploadOneTimeKeys = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/UploadOneTimeKeys', request, metadata || {}, methodDescriptor_IdentityClientService_UploadOneTimeKeys); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.RefreshUserPrekeysRequest, * !proto.identity.unauth.Empty>} */ const methodDescriptor_IdentityClientService_RefreshUserPrekeys = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/RefreshUserPrekeys', grpc.web.MethodType.UNARY, proto.identity.auth.RefreshUserPrekeysRequest, identity_unauth_pb.Empty, /** * @param {!proto.identity.auth.RefreshUserPrekeysRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, identity_unauth_pb.Empty.deserializeBinary ); /** * @param {!proto.identity.auth.RefreshUserPrekeysRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.refreshUserPrekeys = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/RefreshUserPrekeys', request, metadata || {}, methodDescriptor_IdentityClientService_RefreshUserPrekeys, callback); }; /** * @param {!proto.identity.auth.RefreshUserPrekeysRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.refreshUserPrekeys = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/RefreshUserPrekeys', request, metadata || {}, methodDescriptor_IdentityClientService_RefreshUserPrekeys); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.OutboundKeysForUserRequest, * !proto.identity.auth.OutboundKeysForUserResponse>} */ const methodDescriptor_IdentityClientService_GetOutboundKeysForUser = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/GetOutboundKeysForUser', grpc.web.MethodType.UNARY, proto.identity.auth.OutboundKeysForUserRequest, proto.identity.auth.OutboundKeysForUserResponse, /** * @param {!proto.identity.auth.OutboundKeysForUserRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, proto.identity.auth.OutboundKeysForUserResponse.deserializeBinary ); /** * @param {!proto.identity.auth.OutboundKeysForUserRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.auth.OutboundKeysForUserResponse)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.getOutboundKeysForUser = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/GetOutboundKeysForUser', request, metadata || {}, methodDescriptor_IdentityClientService_GetOutboundKeysForUser, callback); }; /** * @param {!proto.identity.auth.OutboundKeysForUserRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.getOutboundKeysForUser = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/GetOutboundKeysForUser', request, metadata || {}, methodDescriptor_IdentityClientService_GetOutboundKeysForUser); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.InboundKeysForUserRequest, * !proto.identity.auth.InboundKeysForUserResponse>} */ const methodDescriptor_IdentityClientService_GetInboundKeysForUser = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/GetInboundKeysForUser', grpc.web.MethodType.UNARY, proto.identity.auth.InboundKeysForUserRequest, proto.identity.auth.InboundKeysForUserResponse, /** * @param {!proto.identity.auth.InboundKeysForUserRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, proto.identity.auth.InboundKeysForUserResponse.deserializeBinary ); /** * @param {!proto.identity.auth.InboundKeysForUserRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.auth.InboundKeysForUserResponse)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.getInboundKeysForUser = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/GetInboundKeysForUser', request, metadata || {}, methodDescriptor_IdentityClientService_GetInboundKeysForUser, callback); }; /** * @param {!proto.identity.auth.InboundKeysForUserRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.getInboundKeysForUser = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/GetInboundKeysForUser', request, metadata || {}, methodDescriptor_IdentityClientService_GetInboundKeysForUser); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.UpdateUserPasswordStartRequest, * !proto.identity.auth.UpdateUserPasswordStartResponse>} */ const methodDescriptor_IdentityClientService_UpdateUserPasswordStart = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/UpdateUserPasswordStart', grpc.web.MethodType.UNARY, proto.identity.auth.UpdateUserPasswordStartRequest, proto.identity.auth.UpdateUserPasswordStartResponse, /** * @param {!proto.identity.auth.UpdateUserPasswordStartRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, proto.identity.auth.UpdateUserPasswordStartResponse.deserializeBinary ); /** * @param {!proto.identity.auth.UpdateUserPasswordStartRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.auth.UpdateUserPasswordStartResponse)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.updateUserPasswordStart = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/UpdateUserPasswordStart', request, metadata || {}, methodDescriptor_IdentityClientService_UpdateUserPasswordStart, callback); }; /** * @param {!proto.identity.auth.UpdateUserPasswordStartRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.updateUserPasswordStart = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/UpdateUserPasswordStart', request, metadata || {}, methodDescriptor_IdentityClientService_UpdateUserPasswordStart); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.UpdateUserPasswordFinishRequest, * !proto.identity.unauth.Empty>} */ const methodDescriptor_IdentityClientService_UpdateUserPasswordFinish = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/UpdateUserPasswordFinish', grpc.web.MethodType.UNARY, proto.identity.auth.UpdateUserPasswordFinishRequest, identity_unauth_pb.Empty, /** * @param {!proto.identity.auth.UpdateUserPasswordFinishRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, identity_unauth_pb.Empty.deserializeBinary ); /** * @param {!proto.identity.auth.UpdateUserPasswordFinishRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.updateUserPasswordFinish = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/UpdateUserPasswordFinish', request, metadata || {}, methodDescriptor_IdentityClientService_UpdateUserPasswordFinish, callback); }; /** * @param {!proto.identity.auth.UpdateUserPasswordFinishRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.updateUserPasswordFinish = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/UpdateUserPasswordFinish', request, metadata || {}, methodDescriptor_IdentityClientService_UpdateUserPasswordFinish); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.unauth.Empty, * !proto.identity.unauth.Empty>} */ const methodDescriptor_IdentityClientService_LogOutUser = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/LogOutUser', grpc.web.MethodType.UNARY, identity_unauth_pb.Empty, identity_unauth_pb.Empty, /** * @param {!proto.identity.unauth.Empty} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, identity_unauth_pb.Empty.deserializeBinary ); /** * @param {!proto.identity.unauth.Empty} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.logOutUser = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/LogOutUser', request, metadata || {}, methodDescriptor_IdentityClientService_LogOutUser, callback); }; /** * @param {!proto.identity.unauth.Empty} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.logOutUser = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/LogOutUser', request, metadata || {}, methodDescriptor_IdentityClientService_LogOutUser); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.unauth.Empty, * !proto.identity.unauth.Empty>} */ const methodDescriptor_IdentityClientService_DeleteUser = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/DeleteUser', grpc.web.MethodType.UNARY, identity_unauth_pb.Empty, identity_unauth_pb.Empty, /** * @param {!proto.identity.unauth.Empty} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, identity_unauth_pb.Empty.deserializeBinary ); /** * @param {!proto.identity.unauth.Empty} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.deleteUser = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/DeleteUser', request, metadata || {}, methodDescriptor_IdentityClientService_DeleteUser, callback); }; /** * @param {!proto.identity.unauth.Empty} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.deleteUser = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/DeleteUser', request, metadata || {}, methodDescriptor_IdentityClientService_DeleteUser); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.OutboundKeysForUserRequest, * !proto.identity.auth.KeyserverKeysResponse>} */ const methodDescriptor_IdentityClientService_GetKeyserverKeys = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/GetKeyserverKeys', grpc.web.MethodType.UNARY, proto.identity.auth.OutboundKeysForUserRequest, proto.identity.auth.KeyserverKeysResponse, /** * @param {!proto.identity.auth.OutboundKeysForUserRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, proto.identity.auth.KeyserverKeysResponse.deserializeBinary ); /** * @param {!proto.identity.auth.OutboundKeysForUserRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.auth.KeyserverKeysResponse)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.getKeyserverKeys = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/GetKeyserverKeys', request, metadata || {}, methodDescriptor_IdentityClientService_GetKeyserverKeys, callback); }; /** * @param {!proto.identity.auth.OutboundKeysForUserRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.getKeyserverKeys = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/GetKeyserverKeys', request, metadata || {}, methodDescriptor_IdentityClientService_GetKeyserverKeys); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.GetDeviceListRequest, * !proto.identity.auth.GetDeviceListResponse>} */ const methodDescriptor_IdentityClientService_GetDeviceListForUser = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/GetDeviceListForUser', grpc.web.MethodType.UNARY, proto.identity.auth.GetDeviceListRequest, proto.identity.auth.GetDeviceListResponse, /** * @param {!proto.identity.auth.GetDeviceListRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, proto.identity.auth.GetDeviceListResponse.deserializeBinary ); /** * @param {!proto.identity.auth.GetDeviceListRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.auth.GetDeviceListResponse)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.getDeviceListForUser = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/GetDeviceListForUser', request, metadata || {}, methodDescriptor_IdentityClientService_GetDeviceListForUser, callback); }; /** * @param {!proto.identity.auth.GetDeviceListRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.getDeviceListForUser = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/GetDeviceListForUser', request, metadata || {}, methodDescriptor_IdentityClientService_GetDeviceListForUser); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.UpdateDeviceListRequest, * !proto.identity.unauth.Empty>} */ const methodDescriptor_IdentityClientService_UpdateDeviceList = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/UpdateDeviceList', grpc.web.MethodType.UNARY, proto.identity.auth.UpdateDeviceListRequest, identity_unauth_pb.Empty, /** * @param {!proto.identity.auth.UpdateDeviceListRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, identity_unauth_pb.Empty.deserializeBinary ); /** * @param {!proto.identity.auth.UpdateDeviceListRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.updateDeviceList = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/UpdateDeviceList', request, metadata || {}, methodDescriptor_IdentityClientService_UpdateDeviceList, callback); }; /** * @param {!proto.identity.auth.UpdateDeviceListRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.updateDeviceList = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/UpdateDeviceList', request, metadata || {}, methodDescriptor_IdentityClientService_UpdateDeviceList); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.identity.auth.LinkFarcasterAccountRequest, * !proto.identity.unauth.Empty>} */ const methodDescriptor_IdentityClientService_LinkFarcasterAccount = new grpc.web.MethodDescriptor( '/identity.auth.IdentityClientService/LinkFarcasterAccount', grpc.web.MethodType.UNARY, proto.identity.auth.LinkFarcasterAccountRequest, identity_unauth_pb.Empty, /** * @param {!proto.identity.auth.LinkFarcasterAccountRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, identity_unauth_pb.Empty.deserializeBinary ); /** * @param {!proto.identity.auth.LinkFarcasterAccountRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.identity.auth.IdentityClientServiceClient.prototype.linkFarcasterAccount = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/identity.auth.IdentityClientService/LinkFarcasterAccount', request, metadata || {}, methodDescriptor_IdentityClientService_LinkFarcasterAccount, callback); }; /** * @param {!proto.identity.auth.LinkFarcasterAccountRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.identity.auth.IdentityClientServicePromiseClient.prototype.linkFarcasterAccount = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/identity.auth.IdentityClientService/LinkFarcasterAccount', request, metadata || {}, methodDescriptor_IdentityClientService_LinkFarcasterAccount); }; +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.identity.unauth.Empty, + * !proto.identity.unauth.Empty>} + */ +const methodDescriptor_IdentityClientService_UnlinkFarcasterAccount = new grpc.web.MethodDescriptor( + '/identity.auth.IdentityClientService/UnlinkFarcasterAccount', + grpc.web.MethodType.UNARY, + identity_unauth_pb.Empty, + identity_unauth_pb.Empty, + /** + * @param {!proto.identity.unauth.Empty} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + identity_unauth_pb.Empty.deserializeBinary +); + + +/** + * @param {!proto.identity.unauth.Empty} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.identity.auth.IdentityClientServiceClient.prototype.unlinkFarcasterAccount = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/identity.auth.IdentityClientService/UnlinkFarcasterAccount', + request, + metadata || {}, + methodDescriptor_IdentityClientService_UnlinkFarcasterAccount, + callback); +}; + + +/** + * @param {!proto.identity.unauth.Empty} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.identity.auth.IdentityClientServicePromiseClient.prototype.unlinkFarcasterAccount = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/identity.auth.IdentityClientService/UnlinkFarcasterAccount', + request, + metadata || {}, + methodDescriptor_IdentityClientService_UnlinkFarcasterAccount); +}; + + module.exports = proto.identity.auth; diff --git a/web/protobufs/identity-auth-client.cjs.flow b/web/protobufs/identity-auth-client.cjs.flow index 455333929..017787da8 100644 --- a/web/protobufs/identity-auth-client.cjs.flow +++ b/web/protobufs/identity-auth-client.cjs.flow @@ -1,163 +1,175 @@ // @flow import * as grpcWeb from 'grpc-web'; import * as identityAuthStructs from './identity-auth-structs.cjs'; import * as identityStructs from './identity-unauth-structs.cjs'; declare export class IdentityClientServiceClient { constructor (hostname: string, credentials?: null | { +[index: string]: string; }, options?: null | { +[index: string]: any; }): void; uploadOneTimeKeys( request: identityAuthStructs.UploadOneTimeKeysRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; refreshUserPrekeys( request: identityAuthStructs.RefreshUserPrekeysRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; getOutboundKeysForUser( request: identityAuthStructs.OutboundKeysForUserRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityAuthStructs.OutboundKeysForUserResponse) => void ): grpcWeb.ClientReadableStream; getInboundKeysForUser( request: identityAuthStructs.InboundKeysForUserRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityAuthStructs.InboundKeysForUserResponse) => void ): grpcWeb.ClientReadableStream; updateUserPasswordStart( request: identityAuthStructs.UpdateUserPasswordStartRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityAuthStructs.UpdateUserPasswordStartResponse) => void ): grpcWeb.ClientReadableStream; updateUserPasswordFinish( request: identityAuthStructs.UpdateUserPasswordFinishRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; logOutUser( request: identityStructs.Empty, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; deleteUser( request: identityStructs.Empty, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; getKeyserverKeys( request: identityAuthStructs.OutboundKeysForUserRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityAuthStructs.KeyserverKeysResponse) => void ): grpcWeb.ClientReadableStream; getDeviceListForUser( request: identityAuthStructs.GetDeviceListRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityAuthStructs.GetDeviceListResponse) => void ): grpcWeb.ClientReadableStream; updateDeviceList( request: identityAuthStructs.UpdateDeviceListRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; linkFarcasterAccount( request: identityAuthStructs.LinkFarcasterAccountRequest, metadata: grpcWeb.Metadata | void, callback: (err: grpcWeb.RpcError, response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; + + unlinkFarcasterAccount( + request: identityStructs.Empty, + metadata: grpcWeb.Metadata | void, + callback: (err: grpcWeb.RpcError, + response: identityStructs.Empty) => void + ): grpcWeb.ClientReadableStream; } declare export class IdentityClientServicePromiseClient { constructor (hostname: string, credentials?: null | { +[index: string]: string; }, options?: null | { +[index: string]: any; }): void; uploadOneTimeKeys( request: identityAuthStructs.UploadOneTimeKeysRequest, metadata?: grpcWeb.Metadata ): Promise; refreshUserPrekeys( request: identityAuthStructs.RefreshUserPrekeysRequest, metadata?: grpcWeb.Metadata ): Promise; getOutboundKeysForUser( request: identityAuthStructs.OutboundKeysForUserRequest, metadata?: grpcWeb.Metadata ): Promise; getInboundKeysForUser( request: identityAuthStructs.InboundKeysForUserRequest, metadata?: grpcWeb.Metadata ): Promise; updateUserPasswordStart( request: identityAuthStructs.UpdateUserPasswordStartRequest, metadata?: grpcWeb.Metadata ): Promise; updateUserPasswordFinish( request: identityAuthStructs.UpdateUserPasswordFinishRequest, metadata?: grpcWeb.Metadata ): Promise; logOutUser( request: identityStructs.Empty, metadata?: grpcWeb.Metadata ): Promise; deleteUser( request: identityStructs.Empty, metadata?: grpcWeb.Metadata ): Promise; getKeyserverKeys( request: identityAuthStructs.OutboundKeysForUserRequest, metadata?: grpcWeb.Metadata ): Promise; getDeviceListForUser( request: identityAuthStructs.GetDeviceListRequest, metadata?: grpcWeb.Metadata ): Promise; updateDeviceList( request: identityAuthStructs.UpdateDeviceListRequest, metadata?: grpcWeb.Metadata ): Promise; linkFarcasterAccount( request: identityAuthStructs.LinkFarcasterAccountRequest, metadata?: grpcWeb.Metadata ): Promise; + + unlinkFarcasterAccount( + request: identityStructs.Empty, + metadata?: grpcWeb.Metadata + ): Promise; }