Skip to content

Commit

Permalink
Mark exporters and generators as internal dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton committed Mar 14, 2024
1 parent 07a4ceb commit 4222222
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/bitwarden/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ rust-version = "1.71"
default = ["secrets"]

secrets = [] # Secrets manager API
internal = [] # Internal testing methods
internal = [
"bitwarden-exporters",
"bitwarden-generators",
] # Internal testing methods
mobile = [
"uniffi",
"internal",
Expand All @@ -31,8 +34,8 @@ base64 = ">=0.21.2, <0.22"
bitwarden-api-api = { path = "../bitwarden-api-api", version = "=0.2.3" }
bitwarden-api-identity = { path = "../bitwarden-api-identity", version = "=0.2.3" }
bitwarden-crypto = { path = "../bitwarden-crypto", version = "=0.1.0" }
bitwarden-exporters = { path = "../bitwarden-exporters", version = "0.1.0" }
bitwarden-generators = { path = "../bitwarden-generators", version = "0.1.0" }
bitwarden-exporters = { path = "../bitwarden-exporters", version = "0.1.0", optional = true }
bitwarden-generators = { path = "../bitwarden-generators", version = "0.1.0", optional = true }
chrono = { version = ">=0.4.26, <0.5", features = [
"clock",
"serde",
Expand Down
6 changes: 6 additions & 0 deletions crates/bitwarden/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ use std::{borrow::Cow, fmt::Debug};

use bitwarden_api_api::apis::Error as ApiError;
use bitwarden_api_identity::apis::Error as IdentityError;
#[cfg(feature = "internal")]
use bitwarden_exporters::ExportError;
#[cfg(feature = "internal")]
use bitwarden_generators::{PassphraseError, PasswordError, UsernameError};
use reqwest::StatusCode;
use thiserror::Error;
Expand Down Expand Up @@ -52,13 +54,17 @@ pub enum Error {
InvalidStateFile,

// Generators
#[cfg(feature = "internal")]
#[error(transparent)]
UsernameError(#[from] UsernameError),
#[cfg(feature = "internal")]
#[error(transparent)]
PassphraseError(#[from] PassphraseError),
#[cfg(feature = "internal")]
#[error(transparent)]
PasswordError(#[from] PasswordError),

#[cfg(feature = "internal")]
#[error(transparent)]
ExportError(#[from] ExportError),

Expand Down
1 change: 1 addition & 0 deletions crates/bitwarden/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ pub use client::Client;
#[doc = include_str!("../README.md")]
mod readme {}

#[cfg(feature = "internal")]
pub mod generators {
pub use bitwarden_generators::{
PassphraseGeneratorRequest, PasswordGeneratorRequest, UsernameGeneratorRequest,
Expand Down

0 comments on commit 4222222

Please sign in to comment.