Files
tuliprox/tools/tuliprox-testkit/src/secret.rs
T
euzuandGitHub 6a567d264e Feature/connection handling (#869)
* **New Features**
  * Added an opt-in runtime liveness watchdog with diagnostics, health status, and optional automatic restart.
  * Added configurable stream cleanup capacity and eviction re-entry protection.
  * Expanded configuration and UI access for users with playlist or user permissions, with safer data sanitization.
  * Added testkit scenarios and reporting for playback, admission, provider limits, sharing, and VOD behavior.
  * Added support for experimental-branch Docker builds.

* **Bug Fixes**
  * Improved provider prioritization, shared playback capacity, cleanup, reconnect handling, and concurrent client behavior.
  * Fixed playlist parsing for declared media types.
  * Release links now use the configured destination.
2026-09-19 10:17:23 +02:00

21 lines
655 B
Rust

use crate::TestkitError;
pub fn environment(name: &str) -> Result<String, TestkitError> {
if name.trim().is_empty() {
return Err(TestkitError::Configuration("secret environment variable name is empty".to_owned()));
}
std::env::var(name)
.map_err(|_| TestkitError::Configuration(format!("required secret environment variable {name} is not set")))
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn missing_variable_does_not_expose_a_value() {
let error = environment("TULIPROX_TESTKIT_MISSING_SECRET").unwrap_err().to_string();
assert!(error.contains("TULIPROX_TESTKIT_MISSING_SECRET"));
}
}