Redact license keys in environment variables from log output (#34711)
Release Notes: - N/A
This commit is contained in:
parent
2ac99e7a11
commit
6a24b2479c
1 changed files with 9 additions and 2 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue