Redact license keys in environment variables from log output (#34711)

Release Notes:

- N/A
This commit is contained in:
Peter Tripp 2025-07-18 10:28:20 -04:00 committed by GitHub
parent 2ac99e7a11
commit 6a24b2479c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,14 @@
/// Whether a given environment variable name should have its value redacted
pub fn should_redact(env_var_name: &str) -> bool {
const REDACTED_SUFFIXES: &[&str] =
&["KEY", "TOKEN", "PASSWORD", "SECRET", "PASS", "CREDENTIALS"];
const REDACTED_SUFFIXES: &[&str] = &[
"KEY",
"TOKEN",
"PASSWORD",
"SECRET",
"PASS",
"CREDENTIALS",
"LICENSE",
];
REDACTED_SUFFIXES
.iter()
.any(|suffix| env_var_name.ends_with(suffix))