Skip to content

Commit

Permalink
Support Rustls through cargo features
Browse files Browse the repository at this point in the history
  • Loading branch information
dani-garcia committed Dec 1, 2023
1 parent b6c6532 commit 3f52576
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 5 deletions.
104 changes: 103 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/bitwarden-api-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ uuid = { version = ">=1.3.3, <2", features = ["serde"] }
[dependencies.reqwest]
version = ">=0.11.18, <0.12"
features = ["json", "multipart"]
default-features = false

[dev-dependencies]
1 change: 1 addition & 0 deletions crates/bitwarden-api-identity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ uuid = { version = ">=1.3.3, <2", features = ["serde"] }
[dependencies.reqwest]
version = ">=0.11.18, <0.12"
features = ["json", "multipart"]
default-features = false

[dev-dependencies]
8 changes: 7 additions & 1 deletion crates/bitwarden-json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ edition = "2021"
rust-version = "1.57"

[features]
default = ["use_native_tls"]

internal = ["bitwarden/internal"] # Internal testing methods
secrets = ["bitwarden/secrets"] # Secrets manager API

# TLS backend selection
use_native_tls = ["bitwarden/use_native_tls"]
use_rustls = ["bitwarden/use_rustls"]

[dependencies]
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"

bitwarden = { path = "../bitwarden" }
bitwarden = { path = "../bitwarden", default-features = false }
5 changes: 4 additions & 1 deletion crates/bitwarden-py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ crate-type = ["cdylib"]
pyo3 = { version = "0.20.0", features = ["extension-module"] }
pyo3-log = "0.9.0"

bitwarden-json = { path = "../bitwarden-json", features = ["secrets"] }
bitwarden-json = { path = "../bitwarden-json", features = [
"secrets",
"use_rustls",
], default-features = false }

[build-dependencies]
pyo3-build-config = { version = "0.20.0" }
Expand Down
10 changes: 8 additions & 2 deletions crates/bitwarden/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ edition = "2021"
rust-version = "1.57"

[features]
default = ["secrets"]
default = ["secrets", "use_native_tls"]

secrets = [] # Secrets manager API
internal = [] # Internal testing methods
mobile = ["uniffi", "internal"] # Mobile-specific features

# TLS backend selection
use_native_tls = ["reqwest/native-tls"]
use_rustls = ["reqwest/rustls-tls"]

[dependencies]
aes = ">=0.8.2, <0.9"
argon2 = { version = ">=0.5.0, <0.6", features = [
Expand All @@ -43,7 +47,9 @@ num-bigint = ">=0.4, <0.5"
num-traits = ">=0.2.15, <0.3"
pbkdf2 = { version = ">=0.12.1, <0.13", default-features = false }
rand = ">=0.8.5, <0.9"
reqwest = { version = ">=0.11, <0.12", features = ["json"] }
reqwest = { version = ">=0.11, <0.12", features = [
"json",
], default-features = false }
rsa = ">=0.9.2, <0.10"
schemars = { version = ">=0.8, <0.9", features = ["uuid1", "chrono"] }
serde = { version = ">=1.0, <2.0", features = ["derive"] }
Expand Down

0 comments on commit 3f52576

Please sign in to comment.