aien-sovereign-core
Autonomous sovereign intelligence engine and runtime core for NVIDIA DGX Spark
Brought by drakestapleton
aien-sovereign-core / crates / spark-discord-hub / src / vault.rs
| 1 | use std::process::Command; |
| 2 | |
| 3 | pub fn get_vault_secret(key: &str) -> Option<String> { |
| 4 | if let Ok(val) = std::env::var(key) { |
| 5 | if !val.trim().is_empty() { |
| 6 | return Some(val.trim().to_string()); |
| 7 | } |
| 8 | } |
| 9 | |
| 10 | let output = Command::new("/home/drakestapleton/.local/bin/atlas-vault") |
| 11 | .arg("get") |
| 12 | .arg(key) |
| 13 | .output() |
| 14 | .ok()?; |
| 15 | |
| 16 | if output.status.success() { |
| 17 | let val = String::from_utf8_lossy(&output.stdout).trim().to_string(); |
| 18 | if !val.is_empty() { |
| 19 | return Some(val); |
| 20 | } |
| 21 | } |
| 22 | None |
| 23 | } |