Skip to content

Commit e32222c

Browse files
authored
Revert "[PM-24243] Add load_flags method to wasm PlatformClient (#369)"
This reverts commit 4813492.
1 parent 4813492 commit e32222c

File tree

5 files changed

+3
-27
lines changed

5 files changed

+3
-27
lines changed

crates/bitwarden-core/src/client/flags.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
/// Feature flags for the Bitwarden SDK client.
2-
#[derive(Debug, Default, Clone, serde::Deserialize, serde::Serialize)]
3-
#[cfg_attr(
4-
feature = "wasm",
5-
derive(tsify::Tsify),
6-
tsify(into_wasm_abi, from_wasm_abi)
7-
)]
1+
#[derive(Debug, Default, Clone, serde::Deserialize)]
82
pub struct Flags {
9-
/// Enable cipher key encryption within the `CipherClient`
103
#[serde(default, rename = "enableCipherKeyEncryption")]
114
pub enable_cipher_key_encryption: bool,
125
}
136

147
impl Flags {
15-
/// Create a new `Flags` instance from a map of flag names and values.
168
pub fn load_from_map(map: std::collections::HashMap<String, bool>) -> Self {
179
let map = map
1810
.into_iter()

crates/bitwarden-core/src/client/internal.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,6 @@ impl InternalClient {
116116
*self.flags.write().expect("RwLock is not poisoned") = Flags::load_from_map(flags);
117117
}
118118

119-
#[allow(missing_docs)]
120-
#[cfg(feature = "internal")]
121-
pub fn set_flags(&self, flags: &Flags) {
122-
*self.flags.write().expect("RwLock is not poisoned") = flags.clone();
123-
}
124-
125119
#[allow(missing_docs)]
126120
#[cfg(feature = "internal")]
127121
pub fn get_flags(&self) -> Flags {

crates/bitwarden-core/src/client/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ mod flags;
1919

2020
pub use client::Client;
2121
pub use client_settings::{ClientSettings, DeviceType};
22-
#[cfg(feature = "internal")]
23-
pub use flags::Flags;
2422

2523
#[allow(missing_docs)]
2624
#[cfg(feature = "internal")]

crates/bitwarden-core/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ pub mod secrets_manager;
2424
mod util;
2525

2626
pub use bitwarden_crypto::ZeroizingAllocator;
27-
#[cfg(feature = "internal")]
28-
pub use client::Flags;
2927
pub use client::{Client, ClientSettings, DeviceType};
3028

3129
mod ids;

crates/bitwarden-wasm-internal/src/platform/mod.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use bitwarden_core::{Client, Flags};
1+
use bitwarden_core::Client;
22
use bitwarden_vault::{Cipher, Folder};
3-
use wasm_bindgen::prelude::*;
3+
use wasm_bindgen::prelude::wasm_bindgen;
44

55
mod repository;
66
pub mod token_provider;
@@ -19,12 +19,6 @@ impl PlatformClient {
1919
pub fn state(&self) -> StateClient {
2020
StateClient::new(self.0.clone())
2121
}
22-
23-
/// Load feature flags into the client
24-
pub fn load_flags(&self, flags: Flags) -> Result<(), JsValue> {
25-
self.0.internal.set_flags(&flags);
26-
Ok(())
27-
}
2822
}
2923

3024
#[wasm_bindgen]

0 commit comments

Comments
 (0)