2026-02-20 14:54:12 -07:00
|
|
|
const ENV_KEY_NAME: &str = "OBFUSCATION_KEY";
|
|
|
|
|
const BACKUP_ENV_KEY: &str = "OBFUSCATION_KEY_DO_NOT_USE";
|
|
|
|
|
|
2026-04-25 11:11:19 -06:00
|
|
|
/// Returns the obfuscation key used by the proc macros.
|
|
|
|
|
///
|
|
|
|
|
/// The fallback keeps macro expansion deterministic when the environment variable is absent.
|
2026-02-20 14:54:12 -07:00
|
|
|
pub fn get_encryption_key() -> String {
|
2026-02-20 18:17:11 -07:00
|
|
|
if let Ok(key) = std::env::var(ENV_KEY_NAME) {
|
|
|
|
|
key
|
|
|
|
|
} else {
|
2026-02-20 14:54:12 -07:00
|
|
|
println!("Using default encryption key!");
|
|
|
|
|
BACKUP_ENV_KEY.to_owned()
|
2026-02-20 18:17:11 -07:00
|
|
|
}
|
2026-02-20 14:54:12 -07:00
|
|
|
}
|