Skip to content

Commit

Permalink
Move common dependencies to the root cargo.toml (#1090)
Browse files Browse the repository at this point in the history
To ensure we use consistent version ranges we should concentrate common
dependencies to the root cargo.toml. This should make it easier to
maintain the SM dependency ranges.
  • Loading branch information
Hinton authored Oct 1, 2024
1 parent fa7a02c commit 6c22e06
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 127 deletions.
25 changes: 25 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,31 @@ bitwarden-send = { path = "crates/bitwarden-send", version = "=1.0.0" }
bitwarden-sm = { path = "crates/bitwarden-sm", version = "=1.0.0" }
bitwarden-vault = { path = "crates/bitwarden-vault", version = "=1.0.0" }

# External crates that are expected to maintain a consistent version across all crates
chrono = { version = ">=0.4.26, <0.5", features = [
"clock",
"serde",
"std",
], default-features = false }
log = "0.4.20"
reqwest = { version = ">=0.12.5, <0.13", features = [
"json",
"multipart",
"http2",
], default-features = false }
schemars = { version = ">=0.8.9, <0.9", features = ["uuid1", "chrono"] }
serde = { version = ">=1.0, <2.0", features = ["derive"] }
serde_json = ">=1.0.96, <2.0"
serde_qs = ">=0.12.0, <0.14"
serde_repr = ">=0.1.12, <0.2"
thiserror = ">=1.0.40, <2.0"
tokio = { version = "1.36.0", features = ["macros"] }
uniffi = "=0.28.1"
uuid = { version = ">=1.3.3, <2.0", features = ["serde", "v4"] }
validator = { version = "0.18.1", features = ["derive"] }
wasm-bindgen = { version = "0.2.91", features = ["serde-serialize"] }
wasm-bindgen-futures = "0.4.41"

[workspace.lints.clippy]
unused_async = "deny"
unwrap_used = "deny"
Expand Down
16 changes: 10 additions & 6 deletions crates/bitwarden-api-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ license-file.workspace = true
keywords.workspace = true

[dependencies]
serde = { version = ">=1.0.163, <2", features = ["derive"] }
serde_with = { version = ">=3.8, <4", default-features = false, features = ["base64", "std", "macros"] }
serde_json = ">=1.0.96, <2"
serde_repr = ">=0.1.12, <0.2"
serde = { workspace = true }
serde_with = { version = ">=3.8, <4", default-features = false, features = [
"base64",
"std",
"macros",
] }
serde_json = { workspace = true }
serde_repr = { workspace = true }
url = ">=2.5, <3"
uuid = { version = ">=1.3.3, <2", features = ["serde", "v4"] }
reqwest = { version = ">=0.12.5, <0.13", features = ["json", "multipart", "http2"], default-features = false }
uuid = { workspace = true }
reqwest = { workspace = true }
16 changes: 10 additions & 6 deletions crates/bitwarden-api-identity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ license-file.workspace = true
keywords.workspace = true

[dependencies]
serde = { version = ">=1.0.163, <2", features = ["derive"] }
serde_with = { version = ">=3.8, <4", default-features = false, features = ["base64", "std", "macros"] }
serde_json = ">=1.0.96, <2"
serde_repr = ">=0.1.12, <0.2"
serde = { workspace = true }
serde_with = { version = ">=3.8, <4", default-features = false, features = [
"base64",
"std",
"macros",
] }
serde_json = { workspace = true }
serde_repr = { workspace = true }
url = ">=2.5, <3"
uuid = { version = ">=1.3.3, <2", features = ["serde", "v4"] }
reqwest = { version = ">=0.12.5, <0.13", features = ["json", "multipart", "http2"], default-features = false }
uuid = { workspace = true }
reqwest = { workspace = true }
35 changes: 13 additions & 22 deletions crates/bitwarden-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,46 +26,37 @@ base64 = ">=0.22.1, <0.23"
bitwarden-api-api = { workspace = true }
bitwarden-api-identity = { workspace = true }
bitwarden-crypto = { workspace = true }
chrono = { version = ">=0.4.26, <0.5", features = [
"clock",
"serde",
"std",
], default-features = false }
chrono = { workspace = true, features = ["std"] }
# We don't use this directly (it's used by rand), but we need it here to enable WASM support
getrandom = { version = ">=0.2.9, <0.3", features = ["js"] }
hmac = ">=0.12.1, <0.13"
log = ">=0.4.18, <0.5"
rand = ">=0.8.5, <0.9"
reqwest = { version = ">=0.12.5, <0.13", features = [
"http2",
"json",
], default-features = false }
schemars = { version = ">=0.8.9, <0.9", features = ["uuid1", "chrono"] }
serde = { version = ">=1.0, <2.0", features = ["derive"] }
serde_json = ">=1.0.96, <2.0"
serde_qs = ">=0.12.0, <0.14"
serde_repr = ">=0.1.12, <0.2"
reqwest = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde_qs = { workspace = true }
serde_repr = { workspace = true }
sha1 = ">=0.10.5, <0.11"
sha2 = ">=0.10.6, <0.11"
thiserror = ">=1.0.40, <2.0"
uniffi = { version = "=0.28.1", optional = true, features = ["tokio"] }
uuid = { version = ">=1.3.3, <2.0", features = ["serde"] }
validator = { version = "0.18.1", features = ["derive"] }
thiserror = { workspace = true }
uniffi = { workspace = true, optional = true, features = ["tokio"] }
uuid = { workspace = true }
validator = { workspace = true }
zeroize = { version = ">=1.7.0, <2.0", features = ["derive", "aarch64"] }
zxcvbn = { version = ">=3.0.1, <4.0", optional = true }

[target.'cfg(not(target_arch="wasm32"))'.dependencies]
# By default, we use rustls as the TLS stack and rust-platform-verifier to support user-installed root certificates
# The only exception is WASM, as it just uses the browsers/node fetch
reqwest = { version = ">=0.12.5, <0.13", features = [
"rustls-tls-manual-roots",
], default-features = false }
reqwest = { workspace = true, features = ["rustls-tls-manual-roots"] }
rustls-platform-verifier = "0.3.4"

[dev-dependencies]
bitwarden-crypto = { workspace = true }
rand_chacha = "0.3.1"
tokio = { version = "1.36.0", features = ["rt", "macros"] }
tokio = { workspace = true, features = ["rt"] }
wiremock = "0.6.0"
zeroize = { version = ">=1.7.0, <2.0", features = ["derive", "aarch64"] }

Expand Down
12 changes: 6 additions & 6 deletions crates/bitwarden-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ pbkdf2 = { version = ">=0.12.1, <0.13", default-features = false }
rand = ">=0.8.5, <0.9"
rayon = ">=1.8.1, <2.0"
rsa = ">=0.9.2, <0.10"
schemars = { version = ">=0.8, <0.9", features = ["uuid1"] }
serde = { version = ">=1.0, <2.0", features = ["derive"] }
schemars = { workspace = true }
serde = { workspace = true }
sha1 = ">=0.10.5, <0.11"
sha2 = ">=0.10.6, <0.11"
subtle = ">=2.5.0, <3.0"
thiserror = ">=1.0.40, <2.0"
uniffi = { version = "=0.28.1", optional = true }
uuid = { version = ">=1.3.3, <2.0", features = ["serde"] }
thiserror = { workspace = true }
uniffi = { workspace = true, optional = true }
uuid = { workspace = true }
zeroize = { version = ">=1.7.0, <2.0", features = ["derive", "aarch64"] }

[dev-dependencies]
criterion = "0.5.1"
rand_chacha = "0.3.1"
serde_json = ">=1.0.96, <2.0"
serde_json = { workspace = true }

[[bench]]
name = "default_allocator"
Expand Down
18 changes: 7 additions & 11 deletions crates/bitwarden-exporters/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,14 @@ base64 = ">=0.22.1, <0.23"
bitwarden-core = { workspace = true }
bitwarden-crypto = { workspace = true }
bitwarden-vault = { workspace = true }
chrono = { version = ">=0.4.26, <0.5", features = [
"clock",
"serde",
"std",
], default-features = false }
chrono = { workspace = true, features = ["std"] }
csv = "1.3.0"
schemars = { version = ">=0.8.9, <0.9", features = ["uuid1", "chrono"] }
serde = { version = ">=1.0, <2.0", features = ["derive"] }
serde_json = ">=1.0.96, <2.0"
thiserror = ">=1.0.40, <2.0"
uniffi = { version = "=0.28.1", optional = true }
uuid = { version = ">=1.3.3, <2.0", features = ["serde", "v4"] }
schemars = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
uniffi = { workspace = true, optional = true }
uuid = { workspace = true }

[lints]
workspace = true
19 changes: 8 additions & 11 deletions crates/bitwarden-fido/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ base64 = ">=0.22.1, <0.23"
bitwarden-core = { workspace = true }
bitwarden-crypto = { workspace = true }
bitwarden-vault = { workspace = true }
chrono = { version = ">=0.4.26, <0.5", features = [
"clock",
"serde",
], default-features = false }
chrono = { workspace = true }
coset = { version = "0.3.7" }
itertools = "0.13.0"
log = ">=0.4.18, <0.5"
Expand All @@ -34,13 +31,13 @@ passkey = { git = "https://github.com/bitwarden/passkey-rs", rev = "ff757604cd7b
passkey-client = { git = "https://github.com/bitwarden/passkey-rs", rev = "ff757604cd7b4e8f321ed1616fef7e40e21ac5df", features = [
"android-asset-validation",
] }
reqwest = { version = ">=0.12.5, <0.13", default-features = false }
schemars = { version = "0.8.21", features = ["uuid1", "chrono"] }
serde = { version = ">=1.0, <2.0", features = ["derive"] }
serde_json = ">=1.0.96, <2.0"
thiserror = ">=1.0.40, <2.0"
uniffi = { version = "=0.28.1", optional = true }
uuid = { version = ">=1.3.3, <2.0", features = ["serde"] }
reqwest = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
uniffi = { workspace = true, optional = true }
uuid = { workspace = true }

[lints]
workspace = true
17 changes: 7 additions & 10 deletions crates/bitwarden-generators/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,16 @@ uniffi = ["dep:uniffi"] # Uniffi bindings
bitwarden-core = { workspace = true, features = ["internal"] }
bitwarden-crypto = { workspace = true }
rand = ">=0.8.5, <0.9"
reqwest = { version = ">=0.12.5, <0.13", features = [
"http2",
"json",
], default-features = false }
schemars = { version = ">=0.8.9, <0.9", features = ["uuid1", "chrono"] }
serde = { version = ">=1.0, <2.0", features = ["derive"] }
serde_json = ">=1.0.96, <2.0"
thiserror = ">=1.0.40, <2.0"
uniffi = { version = "=0.28.1", optional = true }
reqwest = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
uniffi = { workspace = true, optional = true }

[dev-dependencies]
rand_chacha = "0.3.1"
tokio = { version = "1.36.0", features = ["rt", "macros"] }
tokio = { workspace = true, features = ["rt"] }
wiremock = "0.6.0"

[lints]
Expand Down
6 changes: 3 additions & 3 deletions crates/bitwarden-json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ secrets = ["bitwarden/secrets"] # Secrets manager API
[dependencies]
bitwarden = { workspace = true }
log = ">=0.4.18, <0.5"
schemars = ">=0.8.12, <0.9"
serde = { version = ">=1.0, <2.0", features = ["derive"] }
serde_json = ">=1.0.96, <2.0"
schemars = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }

[lints]
workspace = true
2 changes: 1 addition & 1 deletion crates/bitwarden-napi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ bitwarden-json = { path = "../bitwarden-json", version = "0.3.0", features = [
"secrets",
] }
env_logger = "0.11.1"
log = "0.4.20"
log = { workspace = true }
napi = { version = "2", features = ["async"] }
napi-derive = "2"

Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pyo3-log = "0.11.0"
pyo3-build-config = { version = "0.22.1" }

[target.'cfg(not(target_arch="wasm32"))'.dependencies]
tokio = { version = "1.36.0", features = ["rt-multi-thread", "macros"] }
tokio = { workspace = true, features = ["rt-multi-thread"] }

[lints]
workspace = true
17 changes: 7 additions & 10 deletions crates/bitwarden-send/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@ base64 = ">=0.22.1, <0.23"
bitwarden-api-api = { workspace = true }
bitwarden-core = { workspace = true }
bitwarden-crypto = { workspace = true }
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"
thiserror = ">=1.0.40, <2.0"
uniffi = { version = "=0.28.1", optional = true }
uuid = { version = ">=1.3.3, <2.0", features = ["serde"] }
chrono = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
serde_repr = { workspace = true }
thiserror = { workspace = true }
uniffi = { workspace = true, optional = true }
uuid = { workspace = true }
zeroize = { version = ">=1.7.0, <2.0" }

[lints]
Expand Down
19 changes: 8 additions & 11 deletions crates/bitwarden-sm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,16 @@ keywords.workspace = true
bitwarden-api-api = { workspace = true }
bitwarden-core = { workspace = true }
bitwarden-crypto = { workspace = true }
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_json = ">=1.0.96, <2.0"
thiserror = ">=1.0.40, <2.0"
uuid = { version = ">=1.3.3, <2.0", features = ["serde"] }
validator = { version = "0.18.1", features = ["derive"] }
chrono = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
uuid = { workspace = true }
validator = { workspace = true }

[dev-dependencies]
tokio = { version = "1.36.0", features = ["rt", "macros"] }
tokio = { workspace = true, features = ["rt"] }

[lints]
workspace = true
17 changes: 7 additions & 10 deletions crates/bitwarden-uniffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,13 @@ bitwarden-fido = { workspace = true, features = ["uniffi"] }
bitwarden-generators = { workspace = true, features = ["uniffi"] }
bitwarden-send = { workspace = true, features = ["uniffi"] }
bitwarden-vault = { workspace = true, features = ["uniffi"] }
chrono = { version = ">=0.4.26, <0.5", features = [
"serde",
"std",
], default-features = false }
log = "0.4.20"
chrono = { workspace = true, features = ["std"] }
log = { workspace = true }
env_logger = "0.11.1"
schemars = { version = ">=0.8, <0.9", optional = true }
thiserror = ">=1.0.40, <2.0"
uniffi = "=0.28.1"
uuid = ">=1.3.3, <2"
schemars = { workspace = true, optional = true }
thiserror = { workspace = true }
uniffi = { workspace = true }
uuid = { workspace = true }

[target.'cfg(target_os = "android")'.dependencies]
android_logger = "0.14"
Expand All @@ -50,7 +47,7 @@ rustls-platform-verifier = "0.3.4"
oslog = "0.2.0"

[build-dependencies]
uniffi = { version = "=0.28.1", features = ["build"] }
uniffi = { workspace = true, features = ["build"] }

[lints]
workspace = true
21 changes: 9 additions & 12 deletions crates/bitwarden-vault/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,22 @@ base64 = ">=0.22.1, <0.23"
bitwarden-api-api = { workspace = true }
bitwarden-core = { workspace = true, features = ["internal"] }
bitwarden-crypto = { workspace = true }
chrono = { version = ">=0.4.26, <0.5", features = [
"clock",
"serde",
], default-features = false }
chrono = { workspace = true }
rand = ">=0.8.5, <0.9"
hmac = ">=0.12.1, <0.13"
reqwest = { version = ">=0.12.5, <0.13", default-features = false }
schemars = { version = ">=0.8.9, <0.9", features = ["uuid1", "chrono"] }
serde = { version = ">=1.0, <2.0", features = ["derive"] }
serde_json = ">=1.0.96, <2.0"
serde_repr = ">=0.1.12, <0.2"
reqwest = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde_repr = { workspace = true }
sha1 = ">=0.10.5, <0.11"
sha2 = ">=0.10.6, <0.11"
thiserror = ">=1.0.40, <2.0"
thiserror = { workspace = true }
uniffi = { version = "=0.28.1", optional = true }
uuid = { version = ">=1.3.3, <2.0", features = ["serde"] }
uuid = { workspace = true }

[dev-dependencies]
tokio = { version = "1.36.0", features = ["rt", "macros"] }
tokio = { workspace = true, features = ["rt"] }

[lints]
workspace = true
Loading

0 comments on commit 6c22e06

Please sign in to comment.