-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
87 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
use bitwarden_core::{ | ||
auth::client_auth::ClientAuth, | ||
client::client_settings::ClientSettings, | ||
error::Error, | ||
mobile::ClientKdf, | ||
platform::{SyncRequest, SyncResponse}, | ||
}; | ||
|
||
#[cfg(feature = "secrets")] | ||
use bitwarden_sm::{ClientProjects, ClientProjectsExt, ClientSecrets, ClientSecretsExt}; | ||
|
||
#[cfg(feature = "mobile")] | ||
use bitwarden_core::mobile::vault::ClientVault; | ||
|
||
#[cfg(feature = "internal")] | ||
use bitwarden_core::platform::{ | ||
client_platform::ClientPlatform, SecretVerificationRequest, UserApiKeyResponse, | ||
}; | ||
|
||
#[cfg(feature = "internal")] | ||
use bitwarden_generators::{ClientGenerator, ClientGeneratorExt}; | ||
|
||
pub struct Client(bitwarden_core::Client); | ||
|
||
impl Client { | ||
pub fn new(settings: Option<ClientSettings>) -> Self { | ||
Self(bitwarden_core::Client::new(settings)) | ||
} | ||
|
||
#[cfg(feature = "internal")] | ||
pub async fn sync(&mut self, input: &SyncRequest) -> Result<SyncResponse, Error> { | ||
self.0.sync(input).await | ||
} | ||
|
||
#[cfg(feature = "internal")] | ||
pub async fn get_user_api_key( | ||
&mut self, | ||
input: SecretVerificationRequest, | ||
) -> Result<UserApiKeyResponse, Error> { | ||
self.0.get_user_api_key(input).await | ||
} | ||
|
||
#[cfg(feature = "mobile")] | ||
pub fn kdf(&mut self) -> ClientKdf { | ||
self.0.kdf() | ||
} | ||
|
||
pub fn auth(&mut self) -> ClientAuth { | ||
self.0.auth() | ||
} | ||
|
||
#[cfg(feature = "mobile")] | ||
pub fn vault(&mut self) -> ClientVault { | ||
self.0.vault() | ||
} | ||
|
||
#[cfg(feature = "internal")] | ||
pub fn platform(&mut self) -> ClientPlatform { | ||
self.0.platform() | ||
} | ||
|
||
#[cfg(feature = "internal")] | ||
pub fn generator(&mut self) -> ClientGenerator { | ||
self.0.generator() | ||
} | ||
|
||
#[cfg(feature = "secrets")] | ||
pub fn secrets(&mut self) -> ClientSecrets { | ||
self.0.secrets() | ||
} | ||
|
||
#[cfg(feature = "secrets")] | ||
pub fn projects(&mut self) -> ClientProjects { | ||
self.0.projects() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters