Page MenuHomePhabricator

D6926.id23378.diff
No OneTemporary

D6926.id23378.diff

diff --git a/services/identity/src/service.rs b/services/identity/src/service.rs
--- a/services/identity/src/service.rs
+++ b/services/identity/src/service.rs
@@ -108,7 +108,7 @@
registration::handle_registration_upload_and_credential_request(
second_message,
tx.clone(),
- self.client.clone(),
+ &self.client,
&registration_state,
pake_state,
)
@@ -117,7 +117,7 @@
registration::handle_credential_finalization(
third_message,
tx,
- self.client.clone(),
+ &self.client,
&registration_state,
server_login,
)
@@ -141,12 +141,9 @@
let (tx, rx) = mpsc::channel(MPSC_CHANNEL_BUFFER_CAPACITY);
let first_message = in_stream.next().await;
- let login_state = login::handle_login_request(
- first_message,
- tx.clone(),
- self.client.clone(),
- )
- .await?;
+ let login_state =
+ login::handle_login_request(first_message, tx.clone(), &self.client)
+ .await?;
// login_state will be None if user is logging in with a wallet
if let Some(state) = login_state {
@@ -298,7 +295,7 @@
}
async fn put_token_helper(
- client: DatabaseClient,
+ client: &DatabaseClient,
auth_type: AuthType,
user_id: &str,
signing_public_key: &str,
@@ -370,7 +367,7 @@
}
async fn wallet_login_helper(
- client: DatabaseClient,
+ client: &DatabaseClient,
wallet_login_request: WalletLoginRequestStruct,
rng: &mut (impl Rng + CryptoRng),
) -> Result<LoginResponse, Status> {
@@ -410,7 +407,7 @@
}
async fn pake_login_start(
- client: DatabaseClient,
+ client: &DatabaseClient,
user_id: &str,
pake_credential_request: &[u8],
) -> Result<LoginResponseAndPakeState, Status> {
@@ -462,7 +459,7 @@
async fn pake_login_finish(
user_id: &str,
signing_public_key: &str,
- client: DatabaseClient,
+ client: &DatabaseClient,
server_login: ServerLogin<Cipher>,
pake_credential_finalization: &[u8],
rng: &mut (impl Rng + CryptoRng),
@@ -548,7 +545,7 @@
async fn pake_registration_finish(
user_id: &str,
- client: DatabaseClient,
+ client: &DatabaseClient,
registration_upload_bytes: &[u8],
server_registration: Option<ServerRegistration<Cipher>>,
username: &str,
diff --git a/services/identity/src/service/login.rs b/services/identity/src/service/login.rs
--- a/services/identity/src/service/login.rs
+++ b/services/identity/src/service/login.rs
@@ -8,7 +8,7 @@
pub async fn handle_login_request(
message: Option<Result<LoginRequest, Status>>,
tx: mpsc::Sender<Result<LoginResponse, Status>>,
- client: DatabaseClient,
+ client: &DatabaseClient,
) -> Result<Option<LoginState>, Status> {
match message {
Some(Ok(LoginRequest {
@@ -77,7 +77,7 @@
let login_finish_result = pake_login_finish(
&login_state.user_id,
&login_state.signing_public_key,
- client,
+ &client,
login_state.pake_state,
&pake_credential_finalization,
&mut OsRng,
diff --git a/services/identity/src/service/registration.rs b/services/identity/src/service/registration.rs
--- a/services/identity/src/service/registration.rs
+++ b/services/identity/src/service/registration.rs
@@ -65,7 +65,7 @@
pub async fn handle_registration_upload_and_credential_request(
message: Option<Result<RegistrationRequest, Status>>,
tx: mpsc::Sender<Result<RegistrationResponse, Status>>,
- client: DatabaseClient,
+ client: &DatabaseClient,
registration_state: &RegistrationState,
pake_state: ServerRegistration<Cipher>,
) -> Result<ServerLogin<Cipher>, Status> {
@@ -78,7 +78,7 @@
})) => {
let response_and_state = match pake_registration_finish(
&registration_state.user_id,
- client.clone(),
+ client,
&pake_registration_upload_and_credential_request
.pake_registration_upload,
Some(pake_state),
@@ -119,7 +119,7 @@
pub async fn handle_credential_finalization(
message: Option<Result<RegistrationRequest, Status>>,
tx: mpsc::Sender<Result<RegistrationResponse, Status>>,
- client: DatabaseClient,
+ client: &DatabaseClient,
registration_state: &RegistrationState,
server_login: ServerLogin<Cipher>,
) -> Result<(), Status> {

File Metadata

Mime Type
text/plain
Expires
Wed, Jan 8, 11:03 PM (4 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2806512
Default Alt Text
D6926.id23378.diff (4 KB)

Event Timeline