summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2018-10-24 06:52:53 -0400
committerGeorge Goldberg <george@gberg.me>2018-10-24 11:52:53 +0100
commit159c2a44dced5d6331f5fc5e7220e561e6468ad1 (patch)
treede48ae39e63658228f76cd453ab77a2901e04492
parent7393d23261a41f00332f5f0b1e3cdf3ad3151802 (diff)
downloadchat-159c2a44dced5d6331f5fc5e7220e561e6468ad1.tar.gz
chat-159c2a44dced5d6331f5fc5e7220e561e6468ad1.tar.bz2
chat-159c2a44dced5d6331f5fc5e7220e561e6468ad1.zip
MM-10987 Turn on ExperimentalLimitClientConfig by default and remove setting (#9696)
-rw-r--r--api4/system.go2
-rw-r--r--api4/system_test.go46
-rw-r--r--app/diagnostics.go1
-rw-r--r--config/default.json1
-rw-r--r--model/config.go5
-rw-r--r--tests/test-config.json3
6 files changed, 4 insertions, 54 deletions
diff --git a/api4/system.go b/api4/system.go
index ddeac4df4..870e0058c 100644
--- a/api4/system.go
+++ b/api4/system.go
@@ -253,7 +253,7 @@ func getClientConfig(c *Context, w http.ResponseWriter, r *http.Request) {
}
var config map[string]string
- if *c.App.Config().ServiceSettings.ExperimentalLimitClientConfig && len(c.Session.UserId) == 0 {
+ if len(c.Session.UserId) == 0 {
config = c.App.LimitedClientConfigWithComputed()
} else {
config = c.App.ClientConfigWithComputed()
diff --git a/api4/system_test.go b/api4/system_test.go
index 32fadd380..fe56794aa 100644
--- a/api4/system_test.go
+++ b/api4/system_test.go
@@ -218,10 +218,9 @@ func TestGetOldClientConfig(t *testing.T) {
testKey := "supersecretkey"
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.GoogleDeveloperKey = testKey })
- t.Run("with session, without limited config", func(t *testing.T) {
+ t.Run("with session", func(t *testing.T) {
th.App.UpdateConfig(func(cfg *model.Config) {
cfg.ServiceSettings.GoogleDeveloperKey = testKey
- *cfg.ServiceSettings.ExperimentalLimitClientConfig = false
})
Client := th.Client
@@ -238,50 +237,9 @@ func TestGetOldClientConfig(t *testing.T) {
}
})
- t.Run("without session, without limited config", func(t *testing.T) {
+ t.Run("without session", func(t *testing.T) {
th.App.UpdateConfig(func(cfg *model.Config) {
cfg.ServiceSettings.GoogleDeveloperKey = testKey
- *cfg.ServiceSettings.ExperimentalLimitClientConfig = false
- })
-
- Client := th.CreateClient()
-
- config, resp := Client.GetOldClientConfig("")
- CheckNoError(t, resp)
-
- if len(config["Version"]) == 0 {
- t.Fatal("config not returned correctly")
- }
-
- if config["GoogleDeveloperKey"] != testKey {
- t.Fatal("config missing developer key")
- }
- })
-
- t.Run("with session, with limited config", func(t *testing.T) {
- th.App.UpdateConfig(func(cfg *model.Config) {
- cfg.ServiceSettings.GoogleDeveloperKey = testKey
- *cfg.ServiceSettings.ExperimentalLimitClientConfig = true
- })
-
- Client := th.Client
-
- config, resp := Client.GetOldClientConfig("")
- CheckNoError(t, resp)
-
- if len(config["Version"]) == 0 {
- t.Fatal("config not returned correctly")
- }
-
- if config["GoogleDeveloperKey"] != testKey {
- t.Fatal("config missing developer key")
- }
- })
-
- t.Run("without session, without limited config", func(t *testing.T) {
- th.App.UpdateConfig(func(cfg *model.Config) {
- cfg.ServiceSettings.GoogleDeveloperKey = testKey
- *cfg.ServiceSettings.ExperimentalLimitClientConfig = true
})
Client := th.CreateClient()
diff --git a/app/diagnostics.go b/app/diagnostics.go
index f04e6cd78..c9acc2739 100644
--- a/app/diagnostics.go
+++ b/app/diagnostics.go
@@ -259,7 +259,6 @@ func (a *App) trackConfig() {
"allow_cookies_for_subdomains": *cfg.ServiceSettings.AllowCookiesForSubdomains,
"enable_api_team_deletion": *cfg.ServiceSettings.EnableAPITeamDeletion,
"experimental_enable_hardened_mode": *cfg.ServiceSettings.ExperimentalEnableHardenedMode,
- "experimental_limit_client_config": *cfg.ServiceSettings.ExperimentalLimitClientConfig,
"enable_email_invitations": *cfg.ServiceSettings.EnableEmailInvitations,
"experimental_channel_organization": *cfg.ServiceSettings.ExperimentalChannelOrganization,
})
diff --git a/config/default.json b/config/default.json
index cbbb3fe40..3daa6a3e0 100644
--- a/config/default.json
+++ b/config/default.json
@@ -76,7 +76,6 @@
"ImageProxyURL": "",
"EnableAPITeamDeletion": false,
"ExperimentalEnableHardenedMode": false,
- "ExperimentalLimitClientConfig": false,
"EnableEmailInvitations": false
},
"TeamSettings": {
diff --git a/model/config.go b/model/config.go
index 0774ff9a6..6633c785c 100644
--- a/model/config.go
+++ b/model/config.go
@@ -274,7 +274,6 @@ type ServiceSettings struct {
ImageProxyOptions *string
EnableAPITeamDeletion *bool
ExperimentalEnableHardenedMode *bool
- ExperimentalLimitClientConfig *bool
EnableEmailInvitations *bool
}
@@ -566,10 +565,6 @@ func (s *ServiceSettings) SetDefaults() {
if s.ExperimentalEnableHardenedMode == nil {
s.ExperimentalEnableHardenedMode = NewBool(false)
}
-
- if s.ExperimentalLimitClientConfig == nil {
- s.ExperimentalLimitClientConfig = NewBool(false)
- }
}
type ClusterSettings struct {
diff --git a/tests/test-config.json b/tests/test-config.json
index 9c2d48c1e..69b784ff5 100644
--- a/tests/test-config.json
+++ b/tests/test-config.json
@@ -63,8 +63,7 @@
"ImageProxyURL": "",
"ImageProxyOptions": "",
"EnableAPITeamDeletion": false,
- "ExperimentalEnableHardenedMode": false,
- "ExperimentalLimitClientConfig": false
+ "ExperimentalEnableHardenedMode": false
},
"TeamSettings": {
"SiteName": "Mattermost",