MM-54181 : Clean up code around deprecated Gfycat (#24343)

* first pass of removal

* first pass of removal

* Update admin_console.js

* rev beta

* remove more

* Update initial_state.ts

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
M-ZubairAhmed
2023-09-06 02:10:37 +05:30
коммит произвёл GitHub
родитель 77fa1c5824
Коммит bac317dfe5
69 изменённых файлов: 0 добавлений и 2740 удалений

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

@@ -79,8 +79,6 @@ func GenerateClientConfig(c *model.Config, telemetryID string, license *model.Li
props["EnableEmojiPicker"] = strconv.FormatBool(*c.ServiceSettings.EnableEmojiPicker)
props["EnableGifPicker"] = strconv.FormatBool(*c.ServiceSettings.EnableGifPicker)
props["GfycatApiKey"] = *c.ServiceSettings.GfycatAPIKey
props["GfycatApiSecret"] = *c.ServiceSettings.GfycatAPISecret
props["GiphySdkKey"] = getGiphySdkKey(c.ServiceSettings)
props["MaxFileSize"] = strconv.FormatInt(*c.FileSettings.MaxFileSize, 10)

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

@@ -53,7 +53,6 @@ var configSensitivePaths = map[string]bool{
"MessageExportSettings.GlobalRelaySettings.SMTPUsername": true,
"MessageExportSettings.GlobalRelaySettings.SMTPPassword": true,
"MessageExportSettings.GlobalRelaySettings.EmailAddress": true,
"ServiceSettings.GfycatAPISecret": true,
"ServiceSettings.SplitKey": true,
"PluginSettings.Plugins": true,
}

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

@@ -464,27 +464,6 @@ func TestDiffSanitized(t *testing.T) {
},
"",
},
{
"sensitive ServiceSettings.GfycatAPISecret",
func() *model.Config {
cfg := defaultConfigGen()
cfg.ServiceSettings.GfycatAPISecret = model.NewString("base")
return cfg
}(),
func() *model.Config {
cfg := defaultConfigGen()
cfg.ServiceSettings.GfycatAPISecret = model.NewString("actual")
return cfg
}(),
ConfigDiffs{
{
Path: "ServiceSettings.GfycatAPISecret",
BaseVal: model.FakeSetting,
ActualVal: model.FakeSetting,
},
},
"",
},
{
"sensitive ServiceSettings.SplitKey",
func() *model.Config {

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

@@ -85,10 +85,6 @@ func desanitize(actual, target *model.Config) {
*target.MessageExportSettings.GlobalRelaySettings.SMTPPassword = *actual.MessageExportSettings.GlobalRelaySettings.SMTPPassword
}
if target.ServiceSettings.GfycatAPISecret != nil && *target.ServiceSettings.GfycatAPISecret == model.FakeSetting {
*target.ServiceSettings.GfycatAPISecret = *actual.ServiceSettings.GfycatAPISecret
}
if *target.ServiceSettings.SplitKey == model.FakeSetting {
*target.ServiceSettings.SplitKey = *actual.ServiceSettings.SplitKey
}

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

@@ -419,8 +419,6 @@ func (ts *TelemetryService) trackConfig() {
"enable_custom_emoji": *cfg.ServiceSettings.EnableCustomEmoji,
"enable_emoji_picker": *cfg.ServiceSettings.EnableEmojiPicker,
"enable_gif_picker": *cfg.ServiceSettings.EnableGifPicker,
"gfycat_api_key": isDefault(*cfg.ServiceSettings.GfycatAPIKey, model.ServiceSettingsDefaultGfycatAPIKey),
"gfycat_api_secret": isDefault(*cfg.ServiceSettings.GfycatAPISecret, model.ServiceSettingsDefaultGfycatAPISecret),
"experimental_enable_authentication_transfer": *cfg.ServiceSettings.ExperimentalEnableAuthenticationTransfer,
"enable_testing": cfg.ServiceSettings.EnableTesting,
"enable_developer": *cfg.ServiceSettings.EnableDeveloper,

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

@@ -109,8 +109,6 @@ const (
ServiceSettingsDefaultMaxLoginAttempts = 10
ServiceSettingsDefaultAllowCorsFrom = ""
ServiceSettingsDefaultListenAndAddress = ":8065"
ServiceSettingsDefaultGfycatAPIKey = "2_KtH_W5"
ServiceSettingsDefaultGfycatAPISecret = "3wLVZPiswc3DnaiaFoLkDvB4X0IV6CpMkj4tf2inJRsBY6-FnkT08zGmppWFgeof"
ServiceSettingsDefaultGiphySdkKeyTest = "s0glxvzVg9azvPipKxcPLpXV0q1x1fVP"
ServiceSettingsDefaultDeveloperFlags = ""
@@ -347,8 +345,6 @@ type ServiceSettings struct {
WebsocketPort *int `access:"write_restrictable,cloud_restrictable"` // telemetry: none
WebserverMode *string `access:"environment_web_server,write_restrictable,cloud_restrictable"`
EnableGifPicker *bool `access:"integrations_gif"`
GfycatAPIKey *string `access:"integrations_gif"`
GfycatAPISecret *string `access:"integrations_gif"`
GiphySdkKey *string `access:"integrations_gif"`
EnableCustomEmoji *bool `access:"site_emoji"`
EnableEmojiPicker *bool `access:"site_emoji"`
@@ -736,14 +732,6 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) {
s.EnableGifPicker = NewBool(true)
}
if s.GfycatAPIKey == nil || *s.GfycatAPIKey == "" {
s.GfycatAPIKey = NewString(ServiceSettingsDefaultGfycatAPIKey)
}
if s.GfycatAPISecret == nil || *s.GfycatAPISecret == "" {
s.GfycatAPISecret = NewString(ServiceSettingsDefaultGfycatAPISecret)
}
if s.GiphySdkKey == nil || *s.GiphySdkKey == "" {
s.GiphySdkKey = NewString("")
}
@@ -4202,10 +4190,6 @@ func (o *Config) Sanitize() {
*o.MessageExportSettings.GlobalRelaySettings.SMTPPassword = FakeSetting
}
if o.ServiceSettings.GfycatAPISecret != nil && *o.ServiceSettings.GfycatAPISecret != "" {
*o.ServiceSettings.GfycatAPISecret = FakeSetting
}
if o.ServiceSettings.SplitKey != nil {
*o.ServiceSettings.SplitKey = FakeSetting
}