Removing unnused InviteSalt config (#10446)

This commit is contained in:
Jesús Espino
2019-03-15 07:06:28 +01:00
committed by GitHub
parent 5dbf8aec7d
commit 921504483b
8 changed files with 0 additions and 32 deletions

View File

@@ -96,7 +96,6 @@ func (cs *commonStore) load(f io.ReadCloser, needsSave bool, validate func(*mode
// such a change will be made before invoking.
needsSave = needsSave || loadedCfg.SqlSettings.AtRestEncryptKey == nil || len(*loadedCfg.SqlSettings.AtRestEncryptKey) == 0
needsSave = needsSave || loadedCfg.FileSettings.PublicLinkSalt == nil || len(*loadedCfg.FileSettings.PublicLinkSalt) == 0
needsSave = needsSave || loadedCfg.EmailSettings.InviteSalt == nil || len(*loadedCfg.EmailSettings.InviteSalt) == 0
loadedCfg.SetDefaults()

View File

@@ -26,9 +26,6 @@ func init() {
FileSettings: model.FileSettings{
PublicLinkSalt: sToP("abcdefghijklmnopqrstuvwxyz0123456789"),
},
EmailSettings: model.EmailSettings{
InviteSalt: sToP("abcdefghijklmnopqrstuvwxyz0123456789"),
},
LocalizationSettings: model.LocalizationSettings{
DefaultServerLocale: sToP("en"),
DefaultClientLocale: sToP("en"),
@@ -51,9 +48,6 @@ func init() {
Directory: sToP("/path/to/directory"),
PublicLinkSalt: sToP("abcdefghijklmnopqrstuvwxyz0123456789"),
},
EmailSettings: model.EmailSettings{
InviteSalt: sToP("abcdefghijklmnopqrstuvwxyz0123456789"),
},
LocalizationSettings: model.LocalizationSettings{
DefaultServerLocale: sToP("garbage"),
DefaultClientLocale: sToP("garbage"),

View File

@@ -191,7 +191,6 @@
"SMTPServer": "dockerhost",
"SMTPPort": "2500",
"ConnectionSecurity": "",
"InviteSalt": "",
"SendPushNotifications": true,
"PushNotificationServer": "https://push-test.mattermost.com",
"PushNotificationContents": "generic",

View File

@@ -24,9 +24,6 @@ func desanitize(actual, target *model.Config) {
target.FileSettings.AmazonS3SecretAccessKey = actual.FileSettings.AmazonS3SecretAccessKey
}
if *target.EmailSettings.InviteSalt == model.FAKE_SETTING {
target.EmailSettings.InviteSalt = actual.EmailSettings.InviteSalt
}
if *target.EmailSettings.SMTPPassword == model.FAKE_SETTING {
target.EmailSettings.SMTPPassword = actual.EmailSettings.SMTPPassword
}

View File

@@ -24,7 +24,6 @@ func TestDesanitize(t *testing.T) {
actual.LdapSettings.BindPassword = sToP("bind_password")
actual.FileSettings.PublicLinkSalt = sToP("public_link_salt")
actual.FileSettings.AmazonS3SecretAccessKey = sToP("amazon_s3_secret_access_key")
actual.EmailSettings.InviteSalt = sToP("invite_salt")
actual.EmailSettings.SMTPPassword = sToP("smtp_password")
actual.GitLabSettings.Secret = sToP("secret")
actual.SqlSettings.DataSource = sToP("data_source")
@@ -46,7 +45,6 @@ func TestDesanitize(t *testing.T) {
target.LdapSettings.BindPassword = sToP(model.FAKE_SETTING)
target.FileSettings.PublicLinkSalt = sToP(model.FAKE_SETTING)
target.FileSettings.AmazonS3SecretAccessKey = sToP(model.FAKE_SETTING)
target.EmailSettings.InviteSalt = sToP(model.FAKE_SETTING)
target.EmailSettings.SMTPPassword = sToP(model.FAKE_SETTING)
target.GitLabSettings.Secret = sToP(model.FAKE_SETTING)
target.SqlSettings.DataSource = sToP(model.FAKE_SETTING)
@@ -67,7 +65,6 @@ func TestDesanitize(t *testing.T) {
assert.Equal(t, *actual.LdapSettings.BindPassword, *target.LdapSettings.BindPassword)
assert.Equal(t, *actual.FileSettings.PublicLinkSalt, *target.FileSettings.PublicLinkSalt)
assert.Equal(t, *actual.FileSettings.AmazonS3SecretAccessKey, *target.FileSettings.AmazonS3SecretAccessKey)
assert.Equal(t, *actual.EmailSettings.InviteSalt, *target.EmailSettings.InviteSalt)
assert.Equal(t, *actual.EmailSettings.SMTPPassword, *target.EmailSettings.SMTPPassword)
assert.Equal(t, *actual.GitLabSettings.Secret, *target.GitLabSettings.Secret)
assert.Equal(t, *actual.SqlSettings.DataSource, *target.SqlSettings.DataSource)