diff --git a/Cargo.toml b/Cargo.toml index 0030be8..1841ff4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ resolver = "2" [package] name = "lade" -version = "0.9.0" +version = "0.9.1" edition = "2021" description = "Automatically load secrets from your preferred vault as environment variables, and clear them once your shell command is over." license = "MPL-2.0" @@ -24,7 +24,7 @@ serde = { version = "1.0.188", features = ["derive"] } serde_yaml = "0.9.25" clap = { version = "4.4.6", features = ["derive"] } regex = "1.9.6" -lade-sdk = { path = "./sdk", version = "0.9.0" } +lade-sdk = { path = "./sdk", version = "0.9.1" } tokio = { version = "1", features = ["full"] } indexmap = { version = "2.0.2", features = ["serde"] } clap-verbosity-flag = "2.0.1" diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index 089aecd..7343fc6 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lade-sdk" -version = "0.9.0" +version = "0.9.1" edition = "2021" description = "Lade SDK" license = "MPL-2.0" diff --git a/sdk/src/providers/doppler.rs b/sdk/src/providers/doppler.rs index e21b5d6..60e1700 100644 --- a/sdk/src/providers/doppler.rs +++ b/sdk/src/providers/doppler.rs @@ -1,6 +1,6 @@ use std::{collections::HashMap, path::Path}; -use crate::Hydration; +use crate::{providers::envs, Hydration}; use anyhow::{anyhow, bail, Result}; use async_process::{Command, Stdio}; use async_trait::async_trait; @@ -89,6 +89,7 @@ impl Provider for Doppler { let child = match Command::new(cmd[0]) .args(&cmd[1..]) + .envs(envs()) .stdout(Stdio::piped()) .stderr(Stdio::piped()) .output() diff --git a/sdk/src/providers/infisical.rs b/sdk/src/providers/infisical.rs index 4c7a850..28efaa6 100644 --- a/sdk/src/providers/infisical.rs +++ b/sdk/src/providers/infisical.rs @@ -9,7 +9,7 @@ use std::{collections::HashMap, fs::File, io::Write, path::Path}; use tempfile::tempdir; use url::Url; -use crate::Hydration; +use crate::{providers::envs, Hydration}; use super::Provider; @@ -103,6 +103,7 @@ impl Provider for Infisical { let child = match Command::new(cmd[0]) .args(&cmd[1..]) .current_dir(temp_dir.path()) + .envs(envs()) .stdout(Stdio::piped()) .stderr(Stdio::piped()) .output() diff --git a/sdk/src/providers/mod.rs b/sdk/src/providers/mod.rs index e0869a5..5a99c05 100644 --- a/sdk/src/providers/mod.rs +++ b/sdk/src/providers/mod.rs @@ -1,4 +1,4 @@ -use std::path::Path; +use std::{collections::HashMap, path::Path}; use anyhow::Result; use async_trait::async_trait; @@ -28,3 +28,7 @@ pub fn providers() -> Vec> { Box::new(raw::Raw::new()), ] } + +pub fn envs() -> HashMap { + std::env::vars().collect() +} diff --git a/sdk/src/providers/onepassword.rs b/sdk/src/providers/onepassword.rs index 4c50687..4f15fc2 100644 --- a/sdk/src/providers/onepassword.rs +++ b/sdk/src/providers/onepassword.rs @@ -9,7 +9,7 @@ use itertools::Itertools; use log::debug; use url::Url; -use crate::Hydration; +use crate::{providers::envs, Hydration}; use super::Provider; @@ -63,6 +63,7 @@ impl Provider for OnePassword { let mut process = Command::new(cmd[0]) .args(&cmd[1..]) + .envs(envs()) .stdout(Stdio::piped()) .stderr(Stdio::piped()) .stdin(Stdio::piped()) diff --git a/sdk/src/providers/vault.rs b/sdk/src/providers/vault.rs index 32ff70d..1a34649 100644 --- a/sdk/src/providers/vault.rs +++ b/sdk/src/providers/vault.rs @@ -8,7 +8,7 @@ use serde::Deserialize; use std::{collections::HashMap, path::Path}; use url::Url; -use crate::Hydration; +use crate::{providers::envs, Hydration}; use super::Provider; @@ -87,6 +87,7 @@ impl Provider for Vault { let child = match Command::new(cmd[0]) .args(&cmd[1..]) + .envs(envs()) .stdout(Stdio::piped()) .stderr(Stdio::piped()) .output()