MM-27525: Obscure Global Relay's SMTP password. (#15228)
* MM-27525: Obscures the Global Relay SMTP password. * MM-27525: Desanitize global relay's SMTP password. * MM-27525: Does not set the fake value if the field is blank.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5979ce7823
Коммит
7cc26bf659
@@ -53,6 +53,10 @@ func desanitize(actual, target *model.Config) {
|
||||
for i := range target.SqlSettings.DataSourceSearchReplicas {
|
||||
target.SqlSettings.DataSourceSearchReplicas[i] = actual.SqlSettings.DataSourceSearchReplicas[i]
|
||||
}
|
||||
|
||||
if *target.MessageExportSettings.GlobalRelaySettings.SmtpPassword == model.FAKE_SETTING {
|
||||
*target.MessageExportSettings.GlobalRelaySettings.SmtpPassword = *actual.MessageExportSettings.GlobalRelaySettings.SmtpPassword
|
||||
}
|
||||
}
|
||||
|
||||
// fixConfig patches invalid or missing data in the configuration, returning true if changed.
|
||||
|
||||
@@ -3487,4 +3487,8 @@ func (o *Config) Sanitize() {
|
||||
for i := range o.SqlSettings.DataSourceSearchReplicas {
|
||||
o.SqlSettings.DataSourceSearchReplicas[i] = FAKE_SETTING
|
||||
}
|
||||
|
||||
if o.MessageExportSettings.GlobalRelaySettings.SmtpPassword != nil && len(*o.MessageExportSettings.GlobalRelaySettings.SmtpPassword) > 0 {
|
||||
*o.MessageExportSettings.GlobalRelaySettings.SmtpPassword = FAKE_SETTING
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user