Skip to content

Commit

Permalink
Merge main into sm/sm-1287
Browse files Browse the repository at this point in the history
  • Loading branch information
coltonhurst committed Jun 17, 2024
2 parents f95d762 + 331c321 commit 8320d5a
Show file tree
Hide file tree
Showing 20 changed files with 56 additions and 32 deletions.
6 changes: 6 additions & 0 deletions crates/bitwarden-cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Bitwarden Cli

This is an internal crate for the Bitwarden SDK do not depend on this directly and use the
[`bitwarden`](https://crates.io/crates/bitwarden) crate instead.

This crate does not follow semantic versioning and the public interface may change at any time.
6 changes: 6 additions & 0 deletions crates/bitwarden-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Bitwarden Crypto

This is an internal crate for the Bitwarden SDK do not depend on this directly and use the
[`bitwarden`](https://crates.io/crates/bitwarden) crate instead.

This crate does not follow semantic versioning and the public interface may change at any time.
6 changes: 6 additions & 0 deletions crates/bitwarden-fido/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Bitwarden Fido

This is an internal crate for the Bitwarden SDK do not depend on this directly and use the
[`bitwarden`](https://crates.io/crates/bitwarden) crate instead.

This crate does not follow semantic versioning and the public interface may change at any time.
2 changes: 1 addition & 1 deletion crates/bitwarden-json/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bitwarden::client::client_settings::ClientSettings;
use bitwarden::ClientSettings;

#[cfg(feature = "secrets")]
use crate::command::{ProjectsCommand, SecretsCommand};
Expand Down
5 changes: 4 additions & 1 deletion crates/bitwarden-send/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ base64 = ">=0.21.2, <0.23"
bitwarden-api-api = { workspace = true }
bitwarden-core = { workspace = true }
bitwarden-crypto = { workspace = true }
chrono = { version = ">=0.4.26, <0.5", default-features = false }
chrono = { version = ">=0.4.26, <0.5", features = [
"clock",
"serde",
], default-features = false }
schemars = { version = ">=0.8.9, <0.9", features = ["uuid1", "chrono"] }
serde = { version = ">=1.0, <2.0", features = ["derive"] }
serde_repr = ">=0.1.12, <0.2"
Expand Down
6 changes: 6 additions & 0 deletions crates/bitwarden-send/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Bitwarden Send

This is an internal crate for the Bitwarden SDK do not depend on this directly and use the
[`bitwarden`](https://crates.io/crates/bitwarden) crate instead.

This crate does not follow semantic versioning and the public interface may change at any time.
2 changes: 1 addition & 1 deletion crates/bitwarden-uniffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uniffi::setup_scaffolding!();
use std::sync::Arc;

use auth::ClientAuth;
use bitwarden::client::client_settings::ClientSettings;
use bitwarden::ClientSettings;

pub mod auth;
pub mod crypto;
Expand Down
5 changes: 4 additions & 1 deletion crates/bitwarden-vault/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ base64 = ">=0.21.2, <0.23"
bitwarden-api-api = { workspace = true }
bitwarden-core = { workspace = true }
bitwarden-crypto = { workspace = true }
chrono = { version = ">=0.4.26, <0.5", default-features = false }
chrono = { version = ">=0.4.26, <0.5", features = [
"clock",
"serde",
], default-features = false }
rand = ">=0.8.5, <0.9"
hmac = ">=0.12.1, <0.13"
reqwest = { version = ">=0.12, <0.13", default-features = false }
Expand Down
6 changes: 6 additions & 0 deletions crates/bitwarden-vault/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Bitwarden Vault

This is an internal crate for the Bitwarden SDK do not depend on this directly and use the
[`bitwarden`](https://crates.io/crates/bitwarden) crate instead.

This crate does not follow semantic versioning and the public interface may change at any time.
7 changes: 1 addition & 6 deletions crates/bitwarden-vault/src/cipher/cipher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ use super::{
local_data::{LocalData, LocalDataView},
login, secure_note,
};
#[cfg(feature = "uniffi")]
use crate::Fido2CredentialView;
use crate::{password_history, Fido2CredentialFullView, VaultParseError};
use crate::{password_history, Fido2CredentialFullView, Fido2CredentialView, VaultParseError};

#[derive(Debug, Error)]
pub enum CipherError {
Expand Down Expand Up @@ -396,7 +394,6 @@ impl CipherView {
Ok(())
}

#[cfg(feature = "uniffi")]
pub fn decrypt_fido2_credentials(
&self,
enc: &dyn KeyContainer,
Expand Down Expand Up @@ -458,7 +455,6 @@ impl CipherView {
Ok(())
}

#[cfg(feature = "uniffi")]
pub fn set_new_fido2_credentials(
&mut self,
enc: &dyn KeyContainer,
Expand All @@ -475,7 +471,6 @@ impl CipherView {
Ok(())
}

#[cfg(feature = "uniffi")]
pub fn get_fido2_credentials(
&self,
enc: &dyn KeyContainer,
Expand Down
7 changes: 2 additions & 5 deletions crates/bitwarden/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ Rust **1.71** or higher.

```rust
use bitwarden::{
auth::login::AccessTokenLoginRequest,
client::client_settings::{ClientSettings, DeviceType},
error::Result,
secrets_manager::secrets::SecretIdentifiersRequest,
Client,
auth::login::AccessTokenLoginRequest, error::Result,
secrets_manager::secrets::SecretIdentifiersRequest, Client, ClientSettings, DeviceType,
};
use uuid::Uuid;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ use serde::{Deserialize, Serialize};
use uuid::Uuid;

use crate::{
auth::api::response::IdentityTokenResponse,
client::{client_settings::DeviceType, ApiConfigurations},
error::Result,
auth::api::response::IdentityTokenResponse, client::ApiConfigurations, error::Result,
DeviceType,
};

#[derive(Serialize, Deserialize, Debug)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ use crate::{
api::response::IdentityTokenResponse,
login::{TwoFactorProvider, TwoFactorRequest},
},
client::{client_settings::DeviceType, ApiConfigurations},
client::ApiConfigurations,
error::Result,
DeviceType,
};

#[derive(Serialize, Deserialize, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden/src/auth/login/password.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async fn request_identity_tokens(
input: &PasswordLoginRequest,
password_hash: &str,
) -> Result<IdentityTokenResponse> {
use crate::client::client_settings::DeviceType;
use crate::DeviceType;

let config = client.get_api_configurations().await;
PasswordTokenRequest::new(
Expand Down
8 changes: 2 additions & 6 deletions crates/bitwarden/src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ use uuid::Uuid;
#[cfg(feature = "internal")]
use crate::client::flags::Flags;
use crate::{
auth::AccessToken,
client::{
client_settings::{ClientSettings, DeviceType},
encryption_settings::EncryptionSettings,
},
error::Result,
auth::AccessToken, client::encryption_settings::EncryptionSettings, error::Result,
ClientSettings, DeviceType,
};

#[derive(Debug, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden/src/client/client_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize};
/// Defaults to
///
/// ```
/// # use bitwarden::client::client_settings::{ClientSettings, DeviceType};
/// # use bitwarden::{ClientSettings, DeviceType};
/// let settings = ClientSettings {
/// identity_url: "https://identity.bitwarden.com".to_string(),
/// api_url: "https://api.bitwarden.com".to_string(),
Expand Down
4 changes: 2 additions & 2 deletions crates/bitwarden/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ pub async fn start_mock(mocks: Vec<wiremock::Mock>) -> (wiremock::MockServer, cr
server.register(mock).await;
}

let settings = crate::client::client_settings::ClientSettings {
let settings = crate::ClientSettings {
identity_url: format!("http://{}/identity", server.address()),
api_url: format!("http://{}/api", server.address()),
user_agent: "Bitwarden Rust-SDK [TEST]".into(),
device_type: crate::client::client_settings::DeviceType::SDK,
device_type: crate::DeviceType::SDK,
};

(server, crate::Client::new(Some(settings)))
Expand Down
2 changes: 1 addition & 1 deletion crates/bw/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bitwarden::{
auth::RegisterRequest,
client::client_settings::ClientSettings,
generators::{PassphraseGeneratorRequest, PasswordGeneratorRequest},
ClientSettings,
};
use bitwarden_cli::{install_color_eyre, text_prompt_when_none, Color};
use clap::{command, Args, CommandFactory, Parser, Subcommand};
Expand Down
2 changes: 1 addition & 1 deletion crates/bws/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{path::PathBuf, str::FromStr};

use bitwarden::{
auth::{login::AccessTokenLoginRequest, AccessToken},
client::client_settings::ClientSettings,
ClientSettings,
};
use bitwarden_cli::install_color_eyre;
use clap::{CommandFactory, Parser};
Expand Down
2 changes: 1 addition & 1 deletion crates/sdk-schemas/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ use bitwarden_json::response::Response;
#[derive(JsonSchema)]
struct SchemaTypes {
// Input types for new Client
client_settings: bitwarden::client::client_settings::ClientSettings,
client_settings: bitwarden::ClientSettings,

// Input types for Client::run_command
input_command: bitwarden_json::command::Command,
Expand Down

0 comments on commit 8320d5a

Please sign in to comment.