Commit bf29fd87 authored by James Addison's avatar James Addison
Browse files

Include Phabricator settings in configuration desanitization

parent b142e432
Pipeline #28354 failed with stage
in 9 minutes and 57 seconds
......@@ -42,6 +42,10 @@ func desanitize(actual, target *model.Config) {
target.GitLabSettings.Secret = actual.GitLabSettings.Secret
}
if *target.PhabricatorSettings.Secret == model.FAKE_SETTING {
target.PhabricatorSettings.Secret = actual.PhabricatorSettings.Secret
}
if target.GoogleSettings.Secret != nil && *target.GoogleSettings.Secret == model.FAKE_SETTING {
target.GoogleSettings.Secret = actual.GoogleSettings.Secret
}
......
......@@ -27,6 +27,7 @@ func TestDesanitize(t *testing.T) {
actual.FileSettings.AmazonS3SecretAccessKey = model.NewString("amazon_s3_secret_access_key")
actual.EmailSettings.SMTPPassword = model.NewString("smtp_password")
actual.GitLabSettings.Secret = model.NewString("secret")
actual.PhabricatorSettings.Secret = model.NewString("secret")
actual.OpenIdSettings.Secret = model.NewString("secret")
actual.SqlSettings.DataSource = model.NewString("data_source")
actual.SqlSettings.AtRestEncryptKey = model.NewString("at_rest_encrypt_key")
......@@ -49,6 +50,7 @@ func TestDesanitize(t *testing.T) {
target.FileSettings.AmazonS3SecretAccessKey = model.NewString(model.FAKE_SETTING)
target.EmailSettings.SMTPPassword = model.NewString(model.FAKE_SETTING)
target.GitLabSettings.Secret = model.NewString(model.FAKE_SETTING)
target.PhabricatorSettings.Secret = model.NewString(model.FAKE_SETTING)
target.OpenIdSettings.Secret = model.NewString(model.FAKE_SETTING)
target.SqlSettings.DataSource = model.NewString(model.FAKE_SETTING)
target.SqlSettings.AtRestEncryptKey = model.NewString(model.FAKE_SETTING)
......@@ -70,6 +72,7 @@ func TestDesanitize(t *testing.T) {
assert.Equal(t, *actual.FileSettings.AmazonS3SecretAccessKey, *target.FileSettings.AmazonS3SecretAccessKey)
assert.Equal(t, *actual.EmailSettings.SMTPPassword, *target.EmailSettings.SMTPPassword)
assert.Equal(t, *actual.GitLabSettings.Secret, *target.GitLabSettings.Secret)
assert.Equal(t, *actual.PhabricatorSettings.Secret, *target.PhabricatorSettings.Secret)
assert.Equal(t, *actual.OpenIdSettings.Secret, *target.OpenIdSettings.Secret)
assert.Equal(t, *actual.SqlSettings.DataSource, *target.SqlSettings.DataSource)
assert.Equal(t, *actual.SqlSettings.AtRestEncryptKey, *target.SqlSettings.AtRestEncryptKey)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment