Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3362342
D9473.id32165.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D9473.id32165.diff
View Options
diff --git a/keyserver/addons/rust-node-addon/src/identity_client/add_reserved_usernames.rs b/keyserver/addons/rust-node-addon/src/identity_client/add_reserved_usernames.rs
--- a/keyserver/addons/rust-node-addon/src/identity_client/add_reserved_usernames.rs
+++ b/keyserver/addons/rust-node-addon/src/identity_client/add_reserved_usernames.rs
@@ -7,7 +7,7 @@
signature: String,
) -> Result<()> {
// Set up the gRPC client that will be used to talk to the Identity service
- let mut identity_client = get_identity_client_service_channel().await?;
+ let mut identity_client = get_identity_client().await?;
let add_reserved_usernames_request =
AddReservedUsernamesRequest { message, signature };
diff --git a/keyserver/addons/rust-node-addon/src/identity_client/get_inbound_keys_for_user.rs b/keyserver/addons/rust-node-addon/src/identity_client/get_inbound_keys_for_user.rs
--- a/keyserver/addons/rust-node-addon/src/identity_client/get_inbound_keys_for_user.rs
+++ b/keyserver/addons/rust-node-addon/src/identity_client/get_inbound_keys_for_user.rs
@@ -1,3 +1,7 @@
+use grpc_clients::identity::protos::client::{
+ inbound_keys_for_user_request::Identifier, InboundKeysForUserRequest,
+};
+
use super::*;
#[napi]
@@ -8,8 +12,7 @@
device_id: String,
) -> Result<InboundKeyInfoResponse> {
// Set up the gRPC client that will be used to talk to the Identity service
- let channel = get_identity_service_channel().await?;
- let mut identity_client = IdentityClientServiceClient::new(channel);
+ let mut identity_client = get_identity_client().await?;
let identifier = match identifier_type.as_str() {
"walletAddress" => Some(Identifier::WalletAddress(identifier_value)),
diff --git a/keyserver/addons/rust-node-addon/src/identity_client/login.rs b/keyserver/addons/rust-node-addon/src/identity_client/login.rs
--- a/keyserver/addons/rust-node-addon/src/identity_client/login.rs
+++ b/keyserver/addons/rust-node-addon/src/identity_client/login.rs
@@ -22,7 +22,7 @@
debug!("Attempting to login user: {}", username);
// Set up the gRPC client that will be used to talk to the Identity service
- let mut identity_client = get_identity_client_service_channel().await?;
+ let mut identity_client = get_identity_client().await?;
// Start OPAQUE registration and send initial registration request
let mut client_login = Login::new();
diff --git a/keyserver/addons/rust-node-addon/src/identity_client/mod.rs b/keyserver/addons/rust-node-addon/src/identity_client/mod.rs
--- a/keyserver/addons/rust-node-addon/src/identity_client/mod.rs
+++ b/keyserver/addons/rust-node-addon/src/identity_client/mod.rs
@@ -1,4 +1,5 @@
pub mod add_reserved_usernames;
+pub mod get_inbound_keys_for_user;
pub mod login;
pub mod prekey;
pub mod register_user;
@@ -66,7 +67,7 @@
}
}
-async fn get_identity_client_service_channel() -> Result<
+async fn get_identity_client() -> Result<
IdentityClientServiceClient<InterceptedService<Channel, CodeVersionLayer>>,
> {
info!("Connecting to identity service");
@@ -85,7 +86,7 @@
})
}
-async fn get_identity_authenticated_service_channel(
+async fn get_authenticated_identity_client(
user_id: String,
device_id: String,
access_token: String,
diff --git a/keyserver/addons/rust-node-addon/src/identity_client/prekey.rs b/keyserver/addons/rust-node-addon/src/identity_client/prekey.rs
--- a/keyserver/addons/rust-node-addon/src/identity_client/prekey.rs
+++ b/keyserver/addons/rust-node-addon/src/identity_client/prekey.rs
@@ -1,4 +1,4 @@
-use super::get_identity_authenticated_service_channel;
+use super::get_authenticated_identity_client;
use super::{Error, Status};
use grpc_clients::identity::protos::{
authenticated::RefreshUserPreKeysRequest, unauthenticated::PreKey,
@@ -18,12 +18,8 @@
) -> Result<bool> {
// Once this rust addon can do getCommConfig, remove explicit passing of user
// credentials within this scope
- let mut client = get_identity_authenticated_service_channel(
- user_id,
- device_id,
- access_token,
- )
- .await?;
+ let mut client =
+ get_authenticated_identity_client(user_id, device_id, access_token).await?;
let message = RefreshUserPreKeysRequest {
new_content_pre_keys: Some(PreKey {
diff --git a/keyserver/addons/rust-node-addon/src/identity_client/register_user.rs b/keyserver/addons/rust-node-addon/src/identity_client/register_user.rs
--- a/keyserver/addons/rust-node-addon/src/identity_client/register_user.rs
+++ b/keyserver/addons/rust-node-addon/src/identity_client/register_user.rs
@@ -18,7 +18,7 @@
debug!("Attempting to register user: {}", username);
// Set up the gRPC client that will be used to talk to the Identity service
- let mut identity_client = get_identity_client_service_channel().await?;
+ let mut identity_client = get_identity_client().await?;
// Start OPAQUE registration and send initial registration request
let mut opaque_registration = comm_opaque2::client::Registration::new();
diff --git a/keyserver/addons/rust-node-addon/src/identity_client/remove_reserved_usernames.rs b/keyserver/addons/rust-node-addon/src/identity_client/remove_reserved_usernames.rs
--- a/keyserver/addons/rust-node-addon/src/identity_client/remove_reserved_usernames.rs
+++ b/keyserver/addons/rust-node-addon/src/identity_client/remove_reserved_usernames.rs
@@ -7,7 +7,7 @@
signature: String,
) -> Result<()> {
// Set up the gRPC client that will be used to talk to the Identity service
- let mut identity_client = get_identity_client_service_channel().await?;
+ let mut identity_client = get_identity_client().await?;
let remove_reserved_username_request =
RemoveReservedUsernameRequest { message, signature };
diff --git a/keyserver/addons/rust-node-addon/src/identity_client/upload_one_time_keys.rs b/keyserver/addons/rust-node-addon/src/identity_client/upload_one_time_keys.rs
--- a/keyserver/addons/rust-node-addon/src/identity_client/upload_one_time_keys.rs
+++ b/keyserver/addons/rust-node-addon/src/identity_client/upload_one_time_keys.rs
@@ -12,7 +12,7 @@
notif_one_time_pre_keys: Vec<String>,
) -> Result<bool> {
// Set up the gRPC client that will be used to talk to the Identity service
- let mut identity_client = get_identity_client_service_channel().await?;
+ let mut identity_client = get_identity_client().await?;
let upload_request = UploadOneTimeKeysRequest {
user_id,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 10:21 PM (11 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2581140
Default Alt Text
D9473.id32165.diff (6 KB)
Attached To
Mode
D9473: [keyserver] change function names for getting clients to be more intuitive
Attached
Detach File
Event Timeline
Log In to Comment