mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Redact sensitive values before logging them (#33829)
* use a common way to redact sensitive values before logging them * fix panic on missing testCase.err, simplify require checks * fix a silly typo * combine readConfig and buildConnectionString methods, as they are closely related
This commit is contained in:
@@ -28,7 +28,7 @@ func parseRedisConnStr(connStr string) (*redis.Options, error) {
|
||||
if len(keyValueTuple) != 2 {
|
||||
if strings.HasPrefix(rawKeyValue, "password") {
|
||||
// don't log the password
|
||||
rawKeyValue = "password******"
|
||||
rawKeyValue = "password" + setting.RedactedPassword
|
||||
}
|
||||
return nil, fmt.Errorf("incorrect redis connection string format detected for '%v', format is key=value,key=value", rawKeyValue)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user