mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Licensing: Redact license when overriden by env variable (#81726)
This commit is contained in:
parent
2d83feaa5b
commit
7ab833d28c
@ -587,6 +587,7 @@ func RedactedValue(key, value string) string {
|
||||
"ENCRYPTION_KEY",
|
||||
"VAULT_TOKEN",
|
||||
"CLIENT_SECRET",
|
||||
"ENTERPRISE_LICENSE",
|
||||
} {
|
||||
if match, err := regexp.MatchString(pattern, uppercased); match && err == nil {
|
||||
return RedactedPassword
|
||||
|
@ -830,6 +830,12 @@ func TestRedactedValue(t *testing.T) {
|
||||
value: "/path/to/key",
|
||||
expected: RedactedPassword,
|
||||
},
|
||||
{
|
||||
desc: "license key with non-empty value",
|
||||
key: "GF_ENTERPRISE_LICENSE_TEXT",
|
||||
value: "some_license_key_test",
|
||||
expected: RedactedPassword,
|
||||
},
|
||||
{
|
||||
desc: "sensitive key with empty value",
|
||||
key: "private_key_path",
|
||||
|
Loading…
Reference in New Issue
Block a user