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.
Этот коммит содержится в:
Martin Kraft
2020-08-20 09:01:22 -04:00
коммит произвёл GitHub
родитель 5979ce7823
Коммит 7cc26bf659
2 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

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