Licensing: Redact license when overriden by env variable (#81726)

This commit is contained in:
lean.dev 2024-02-01 14:37:36 -03:00 committed by GitHub
parent 2d83feaa5b
commit 7ab833d28c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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",