XYZ-73: Removes EnableOnlyAdminIntegrations uses. (#8245)
Этот коммит содержится в:
коммит произвёл
Jesús Espino
родитель
1edcabbc9b
Коммит
9325430859
@@ -202,13 +202,10 @@ func TestDeleteCommand(t *testing.T) {
|
|||||||
Client := th.SystemAdminClient
|
Client := th.SystemAdminClient
|
||||||
|
|
||||||
enableCommands := *th.App.Config().ServiceSettings.EnableCommands
|
enableCommands := *th.App.Config().ServiceSettings.EnableCommands
|
||||||
onlyAdminIntegration := *th.App.Config().ServiceSettings.EnableOnlyAdminIntegrations
|
|
||||||
defer func() {
|
defer func() {
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableCommands = enableCommands })
|
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableCommands = enableCommands })
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = onlyAdminIntegration })
|
|
||||||
}()
|
}()
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableCommands = true })
|
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableCommands = true })
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = false })
|
|
||||||
|
|
||||||
cmd := &model.Command{URL: "http://nowhere.com", Method: model.COMMAND_METHOD_POST, Trigger: "trigger"}
|
cmd := &model.Command{URL: "http://nowhere.com", Method: model.COMMAND_METHOD_POST, Trigger: "trigger"}
|
||||||
cmd = Client.Must(Client.CreateCommand(cmd)).Data.(*model.Command)
|
cmd = Client.Must(Client.CreateCommand(cmd)).Data.(*model.Command)
|
||||||
|
|||||||
@@ -131,17 +131,14 @@ func testCreatePostWithOutgoingHook(
|
|||||||
channel := th.BasicChannel
|
channel := th.BasicChannel
|
||||||
|
|
||||||
enableOutgoingHooks := th.App.Config().ServiceSettings.EnableOutgoingWebhooks
|
enableOutgoingHooks := th.App.Config().ServiceSettings.EnableOutgoingWebhooks
|
||||||
enableAdminOnlyHooks := th.App.Config().ServiceSettings.EnableOnlyAdminIntegrations
|
|
||||||
allowedInternalConnections := *th.App.Config().ServiceSettings.AllowedUntrustedInternalConnections
|
allowedInternalConnections := *th.App.Config().ServiceSettings.AllowedUntrustedInternalConnections
|
||||||
defer func() {
|
defer func() {
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableOutgoingWebhooks = enableOutgoingHooks })
|
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableOutgoingWebhooks = enableOutgoingHooks })
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableOnlyAdminIntegrations = enableAdminOnlyHooks })
|
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||||
cfg.ServiceSettings.AllowedUntrustedInternalConnections = &allowedInternalConnections
|
cfg.ServiceSettings.AllowedUntrustedInternalConnections = &allowedInternalConnections
|
||||||
})
|
})
|
||||||
}()
|
}()
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableOutgoingWebhooks = true })
|
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableOutgoingWebhooks = true })
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = true })
|
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||||
*cfg.ServiceSettings.AllowedUntrustedInternalConnections = "localhost 127.0.0.1"
|
*cfg.ServiceSettings.AllowedUntrustedInternalConnections = "localhost 127.0.0.1"
|
||||||
})
|
})
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user