Skip to content

Commit

Permalink
Migrate test to testcontainers
Browse files Browse the repository at this point in the history
  • Loading branch information
stormshield-gt committed Nov 19, 2024
1 parent d12c6cf commit 2777cb9
Show file tree
Hide file tree
Showing 39 changed files with 1,662 additions and 1,920 deletions.
25 changes: 5 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ license = "MIT"
readme = "README.md"
repository = "https://github.com/jmgilman/vaultrs"
keywords = ["Vault", "API", "Client", "Hashicorp"]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[workspace]
members = [
"vaultrs-login",
members = [
"vaultrs-login", "vaultrs-tests", "."
]

default-members = ["vaultrs-login", "vaultrs-tests", "."]

[features]
default = [ "rustls" ]
rustls = [ "reqwest/rustls-tls", "rustify/rustls-tls" ]
Expand All @@ -36,20 +38,3 @@ thiserror = "1.0.40"
url = "2.3.1"
tracing = { version = "0.1.37", features = ["log"] }

[dev-dependencies]
base64 = "0.21"
chrono = "0.4.38"
data-encoding = "2.3.3"
tokio-test = "0.4.2"
tracing-subscriber = { version = "0.3.16", default-features = false, features = ["env-filter", "fmt"] }
tracing-test = "0.2.4"
test-log = { version = "0.2.11", features = ["trace"] }
env_logger = "0.10.0"
dockertest = "0.3.0"
dockertest-server = { version = "0.1.7", features = ["hashi", "database", "webserver", "cloud"] }
jwt = "0.16.0"
sha2 = "0.10.6"
hmac = "0.12.1"
serial_test = "1.0.0"
rcgen = "0.12.1"
tempfile = "3.10.1"
4 changes: 4 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ impl VaultClient {
/// Creates a new [VaultClient] using the given [VaultClientSettings].
#[instrument(skip(settings), err)]
pub fn new(settings: VaultClientSettings) -> Result<VaultClient, ClientError> {
#[cfg(not(feature = "rustls"))]
let mut http_client = reqwest::ClientBuilder::new();

#[cfg(feature = "rustls")]
let mut http_client = reqwest::ClientBuilder::new().use_rustls_tls();

// Optionally set timeout on client
http_client = if let Some(timeout) = settings.timeout {
http_client.timeout(timeout)
Expand Down
263 changes: 0 additions & 263 deletions tests/cert.rs

This file was deleted.

Loading

0 comments on commit 2777cb9

Please sign in to comment.