Skip to content

Commit 3dba619

Browse files
committed
Move totp
1 parent 58ce5e7 commit 3dba619

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

crates/bitwarden-vault/src/totp_client.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ use chrono::{DateTime, Utc};
33
#[cfg(feature = "wasm")]
44
use wasm_bindgen::prelude::*;
55

6-
use crate::{
7-
generate_totp, generate_totp_cipher_view, CipherListView, TotpError, TotpResponse, VaultClient,
8-
};
6+
use crate::{generate_totp, generate_totp_cipher_view, CipherListView, TotpError, TotpResponse};
97

108
#[cfg_attr(feature = "wasm", wasm_bindgen)]
119
pub struct TotpClient {
@@ -61,12 +59,3 @@ impl TotpClient {
6159
generate_totp_cipher_view(&mut key_store.context(), view, time)
6260
}
6361
}
64-
65-
#[cfg_attr(feature = "wasm", wasm_bindgen)]
66-
impl VaultClient {
67-
pub fn totp(&self) -> TotpClient {
68-
TotpClient {
69-
client: self.client.clone(),
70-
}
71-
}
72-
}

crates/bitwarden-vault/src/vault_client.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use wasm_bindgen::prelude::*;
55
use crate::{
66
sync::{sync, SyncError},
77
AttachmentsClient, CiphersClient, CollectionsClient, FoldersClient, PasswordHistoryClient,
8-
SyncRequest, SyncResponse,
8+
SyncRequest, SyncResponse, TotpClient,
99
};
1010

1111
#[derive(Clone)]
@@ -60,6 +60,13 @@ impl VaultClient {
6060
client: self.client.clone(),
6161
}
6262
}
63+
64+
/// TOTP related operations.
65+
pub fn totp(&self) -> TotpClient {
66+
TotpClient {
67+
client: self.client.clone(),
68+
}
69+
}
6370
}
6471

6572
pub trait VaultClientExt {

0 commit comments

Comments
 (0)