diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/admin.go | 4 | ||||
-rw-r--r-- | api/api.go | 1 | ||||
-rw-r--r-- | api/apitestlib.go | 2 | ||||
-rw-r--r-- | api/channel.go | 2 | ||||
-rw-r--r-- | api/command.go | 5 | ||||
-rw-r--r-- | api/deprecated.go | 15 | ||||
-rw-r--r-- | api/emoji.go | 4 | ||||
-rw-r--r-- | api/file.go | 3 | ||||
-rw-r--r-- | api/general.go | 4 | ||||
-rw-r--r-- | api/general_test.go | 3 | ||||
-rw-r--r-- | api/license.go | 3 | ||||
-rw-r--r-- | api/oauth.go | 4 | ||||
-rw-r--r-- | api/post.go | 3 | ||||
-rw-r--r-- | api/preference.go | 4 | ||||
-rw-r--r-- | api/reaction.go | 4 | ||||
-rw-r--r-- | api/status.go | 5 | ||||
-rw-r--r-- | api/team.go | 3 | ||||
-rw-r--r-- | api/user.go | 2 | ||||
-rw-r--r-- | api/webhook.go | 4 | ||||
-rw-r--r-- | api/webrtc.go | 5 | ||||
-rw-r--r-- | api/websocket.go | 1 |
21 files changed, 2 insertions, 79 deletions
diff --git a/api/admin.go b/api/admin.go index 63f27d64e..b3b74d5ea 100644 --- a/api/admin.go +++ b/api/admin.go @@ -7,17 +7,13 @@ import ( "net/http" "strconv" - l4g "github.com/alecthomas/log4go" "github.com/gorilla/mux" "github.com/mattermost/mattermost-server/app" "github.com/mattermost/mattermost-server/model" - "github.com/mattermost/mattermost-server/utils" "github.com/mssola/user_agent" ) func (api *API) InitAdmin() { - l4g.Debug(utils.T("api.admin.init.debug")) - api.BaseRoutes.Admin.Handle("/logs", api.ApiAdminSystemRequired(getLogs)).Methods("GET") api.BaseRoutes.Admin.Handle("/audits", api.ApiAdminSystemRequired(getAllAudits)).Methods("GET") api.BaseRoutes.Admin.Handle("/config", api.ApiAdminSystemRequired(getConfig)).Methods("GET") diff --git a/api/api.go b/api/api.go index 44651b1fa..2d65bb216 100644 --- a/api/api.go +++ b/api/api.go @@ -107,7 +107,6 @@ func Init(a *app.App, root *mux.Router) *API { api.InitStatus() api.InitWebrtc() api.InitReaction() - api.InitDeprecated() // 404 on any api route before web.go has a chance to serve it root.Handle("/api/{anything:.*}", http.HandlerFunc(Handle404)) diff --git a/api/apitestlib.go b/api/apitestlib.go index a2b7e8741..547071e93 100644 --- a/api/apitestlib.go +++ b/api/apitestlib.go @@ -79,7 +79,6 @@ func setupTestHelper(enterprise bool) *TestHelper { *cfg.RateLimitSettings.Enable = false cfg.EmailSettings.SendEmailNotifications = true }) - utils.DisableDebugLogForTest() prevListenAddress := *th.App.Config().ServiceSettings.ListenAddress if testStore != nil { th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.ListenAddress = ":0" }) @@ -89,7 +88,6 @@ func setupTestHelper(enterprise bool) *TestHelper { api4.Init(th.App, th.App.Srv.Router, false) Init(th.App, th.App.Srv.Router) wsapi.Init(th.App, th.App.Srv.WebSocketRouter) - utils.EnableDebugLogForTest() th.App.Srv.Store.MarkSystemRanUnitTests() th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.EnableOpenServer = true }) diff --git a/api/channel.go b/api/channel.go index 2782f9636..976007725 100644 --- a/api/channel.go +++ b/api/channel.go @@ -14,8 +14,6 @@ import ( ) func (api *API) InitChannel() { - l4g.Debug(utils.T("api.channel.init.debug")) - api.BaseRoutes.Channels.Handle("/", api.ApiUserRequired(getChannels)).Methods("GET") api.BaseRoutes.Channels.Handle("/more/{offset:[0-9]+}/{limit:[0-9]+}", api.ApiUserRequired(getMoreChannelsPage)).Methods("GET") api.BaseRoutes.Channels.Handle("/more/search", api.ApiUserRequired(searchMoreChannels)).Methods("POST") diff --git a/api/command.go b/api/command.go index 321a67dfc..bbc7fbebd 100644 --- a/api/command.go +++ b/api/command.go @@ -8,15 +8,10 @@ import ( "net/http" "strings" - l4g "github.com/alecthomas/log4go" - "github.com/mattermost/mattermost-server/model" - "github.com/mattermost/mattermost-server/utils" ) func (api *API) InitCommand() { - l4g.Debug(utils.T("api.command.init.debug")) - api.BaseRoutes.Commands.Handle("/execute", api.ApiUserRequired(executeCommand)).Methods("POST") api.BaseRoutes.Commands.Handle("/list", api.ApiUserRequired(listCommands)).Methods("GET") diff --git a/api/deprecated.go b/api/deprecated.go deleted file mode 100644 index f62af84de..000000000 --- a/api/deprecated.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package api - -import ( - l4g "github.com/alecthomas/log4go" - "github.com/mattermost/mattermost-server/utils" -) - -// ONLY FOR APIs SCHEDULED TO BE DEPRECATED - -func (api *API) InitDeprecated() { - l4g.Debug(utils.T("api.deprecated.init.debug")) -} diff --git a/api/emoji.go b/api/emoji.go index cbe7b07bf..ed21e2192 100644 --- a/api/emoji.go +++ b/api/emoji.go @@ -12,17 +12,13 @@ import ( "image/color/palette" - l4g "github.com/alecthomas/log4go" "github.com/disintegration/imaging" "github.com/gorilla/mux" "github.com/mattermost/mattermost-server/app" "github.com/mattermost/mattermost-server/model" - "github.com/mattermost/mattermost-server/utils" ) func (api *API) InitEmoji() { - l4g.Debug(utils.T("api.emoji.init.debug")) - api.BaseRoutes.Emoji.Handle("/list", api.ApiUserRequired(getEmoji)).Methods("GET") api.BaseRoutes.Emoji.Handle("/create", api.ApiUserRequired(createEmoji)).Methods("POST") api.BaseRoutes.Emoji.Handle("/delete", api.ApiUserRequired(deleteEmoji)).Methods("POST") diff --git a/api/file.go b/api/file.go index 75739486c..2d626304e 100644 --- a/api/file.go +++ b/api/file.go @@ -9,7 +9,6 @@ import ( "strconv" "strings" - l4g "github.com/alecthomas/log4go" "github.com/gorilla/mux" "github.com/mattermost/mattermost-server/app" "github.com/mattermost/mattermost-server/model" @@ -31,8 +30,6 @@ var UNSAFE_CONTENT_TYPES = [...]string{ } func (api *API) InitFile() { - l4g.Debug(utils.T("api.file.init.debug")) - api.BaseRoutes.TeamFiles.Handle("/upload", api.ApiUserRequired(uploadFile)).Methods("POST") api.BaseRoutes.NeedFile.Handle("/get", api.ApiUserRequiredTrustRequester(getFile)).Methods("GET") diff --git a/api/general.go b/api/general.go index 3091c1169..0fd289ffb 100644 --- a/api/general.go +++ b/api/general.go @@ -8,15 +8,11 @@ import ( "net/http" "strings" - l4g "github.com/alecthomas/log4go" - "github.com/mattermost/mattermost-server/model" "github.com/mattermost/mattermost-server/utils" ) func (api *API) InitGeneral() { - l4g.Debug(utils.T("api.general.init.debug")) - api.BaseRoutes.General.Handle("/client_props", api.ApiAppHandler(getClientConfig)).Methods("GET") api.BaseRoutes.General.Handle("/log_client", api.ApiAppHandler(logClient)).Methods("POST") api.BaseRoutes.General.Handle("/ping", api.ApiAppHandler(ping)).Methods("GET") diff --git a/api/general_test.go b/api/general_test.go index 3f61d9d32..5b0a2630f 100644 --- a/api/general_test.go +++ b/api/general_test.go @@ -4,8 +4,9 @@ package api import ( - "github.com/mattermost/mattermost-server/model" "testing" + + "github.com/mattermost/mattermost-server/model" ) func TestGetClientProperties(t *testing.T) { diff --git a/api/license.go b/api/license.go index a6a167cac..8eb7803e1 100644 --- a/api/license.go +++ b/api/license.go @@ -8,14 +8,11 @@ import ( "io" "net/http" - l4g "github.com/alecthomas/log4go" "github.com/mattermost/mattermost-server/model" "github.com/mattermost/mattermost-server/utils" ) func (api *API) InitLicense() { - l4g.Debug(utils.T("api.license.init.debug")) - api.BaseRoutes.License.Handle("/add", api.ApiAdminSystemRequired(addLicense)).Methods("POST") api.BaseRoutes.License.Handle("/remove", api.ApiAdminSystemRequired(removeLicense)).Methods("POST") api.BaseRoutes.License.Handle("/client_config", api.ApiAppHandler(getClientLicenceConfig)).Methods("GET") diff --git a/api/oauth.go b/api/oauth.go index c8a228a7b..2fc83d122 100644 --- a/api/oauth.go +++ b/api/oauth.go @@ -6,15 +6,11 @@ package api import ( "net/http" - l4g "github.com/alecthomas/log4go" "github.com/gorilla/mux" "github.com/mattermost/mattermost-server/model" - "github.com/mattermost/mattermost-server/utils" ) func (api *API) InitOAuth() { - l4g.Debug(utils.T("api.oauth.init.debug")) - api.BaseRoutes.OAuth.Handle("/register", api.ApiUserRequired(registerOAuthApp)).Methods("POST") api.BaseRoutes.OAuth.Handle("/list", api.ApiUserRequired(getOAuthApps)).Methods("GET") api.BaseRoutes.OAuth.Handle("/app/{client_id}", api.ApiUserRequired(getOAuthAppInfo)).Methods("GET") diff --git a/api/post.go b/api/post.go index 1e09971b6..e0cfb720c 100644 --- a/api/post.go +++ b/api/post.go @@ -8,7 +8,6 @@ import ( "strconv" "time" - l4g "github.com/alecthomas/log4go" "github.com/gorilla/mux" "github.com/mattermost/mattermost-server/model" @@ -20,8 +19,6 @@ const OPEN_GRAPH_METADATA_CACHE_SIZE = 10000 var openGraphDataCache = utils.NewLru(OPEN_GRAPH_METADATA_CACHE_SIZE) func (api *API) InitPost() { - l4g.Debug(utils.T("api.post.init.debug")) - api.BaseRoutes.ApiRoot.Handle("/get_opengraph_metadata", api.ApiUserRequired(getOpenGraphMetadata)).Methods("POST") api.BaseRoutes.NeedTeam.Handle("/posts/search", api.ApiUserRequiredActivity(searchPosts, true)).Methods("POST") diff --git a/api/preference.go b/api/preference.go index f4d7d2842..8de1ea453 100644 --- a/api/preference.go +++ b/api/preference.go @@ -6,15 +6,11 @@ package api import ( "net/http" - l4g "github.com/alecthomas/log4go" "github.com/gorilla/mux" "github.com/mattermost/mattermost-server/model" - "github.com/mattermost/mattermost-server/utils" ) func (api *API) InitPreference() { - l4g.Debug(utils.T("api.preference.init.debug")) - api.BaseRoutes.Preferences.Handle("/", api.ApiUserRequired(getAllPreferences)).Methods("GET") api.BaseRoutes.Preferences.Handle("/save", api.ApiUserRequired(savePreferences)).Methods("POST") api.BaseRoutes.Preferences.Handle("/delete", api.ApiUserRequired(deletePreferences)).Methods("POST") diff --git a/api/reaction.go b/api/reaction.go index aada8cdd4..991044cda 100644 --- a/api/reaction.go +++ b/api/reaction.go @@ -6,15 +6,11 @@ package api import ( "net/http" - l4g "github.com/alecthomas/log4go" "github.com/gorilla/mux" "github.com/mattermost/mattermost-server/model" - "github.com/mattermost/mattermost-server/utils" ) func (api *API) InitReaction() { - l4g.Debug(utils.T("api.reaction.init.debug")) - api.BaseRoutes.NeedPost.Handle("/reactions/save", api.ApiUserRequired(saveReaction)).Methods("POST") api.BaseRoutes.NeedPost.Handle("/reactions/delete", api.ApiUserRequired(deleteReaction)).Methods("POST") api.BaseRoutes.NeedPost.Handle("/reactions", api.ApiUserRequired(listReactions)).Methods("GET") diff --git a/api/status.go b/api/status.go index a86d80f98..e1e4de522 100644 --- a/api/status.go +++ b/api/status.go @@ -6,15 +6,10 @@ package api import ( "net/http" - l4g "github.com/alecthomas/log4go" - "github.com/mattermost/mattermost-server/model" - "github.com/mattermost/mattermost-server/utils" ) func (api *API) InitStatus() { - l4g.Debug(utils.T("api.status.init.debug")) - api.BaseRoutes.Users.Handle("/status", api.ApiUserRequired(getStatusesHttp)).Methods("GET") api.BaseRoutes.Users.Handle("/status/ids", api.ApiUserRequired(getStatusesByIdsHttp)).Methods("POST") } diff --git a/api/team.go b/api/team.go index ce58aaaa5..48377f970 100644 --- a/api/team.go +++ b/api/team.go @@ -10,7 +10,6 @@ import ( "strconv" "strings" - l4g "github.com/alecthomas/log4go" "github.com/gorilla/mux" "github.com/mattermost/mattermost-server/model" @@ -18,8 +17,6 @@ import ( ) func (api *API) InitTeam() { - l4g.Debug(utils.T("api.team.init.debug")) - api.BaseRoutes.Teams.Handle("/create", api.ApiUserRequired(createTeam)).Methods("POST") api.BaseRoutes.Teams.Handle("/all", api.ApiUserRequired(getAll)).Methods("GET") api.BaseRoutes.Teams.Handle("/all_team_listings", api.ApiUserRequired(GetAllTeamListings)).Methods("GET") diff --git a/api/user.go b/api/user.go index 5aba61e38..f9b0af469 100644 --- a/api/user.go +++ b/api/user.go @@ -20,8 +20,6 @@ import ( ) func (api *API) InitUser() { - l4g.Debug(utils.T("api.user.init.debug")) - api.BaseRoutes.Users.Handle("/create", api.ApiAppHandler(createUser)).Methods("POST") api.BaseRoutes.Users.Handle("/update", api.ApiUserRequired(updateUser)).Methods("POST") api.BaseRoutes.Users.Handle("/update_active", api.ApiUserRequired(updateActive)).Methods("POST") diff --git a/api/webhook.go b/api/webhook.go index dce5ddc1e..e3e12816a 100644 --- a/api/webhook.go +++ b/api/webhook.go @@ -6,14 +6,10 @@ package api import ( "net/http" - l4g "github.com/alecthomas/log4go" "github.com/mattermost/mattermost-server/model" - "github.com/mattermost/mattermost-server/utils" ) func (api *API) InitWebhook() { - l4g.Debug(utils.T("api.webhook.init.debug")) - api.BaseRoutes.Hooks.Handle("/incoming/create", api.ApiUserRequired(createIncomingHook)).Methods("POST") api.BaseRoutes.Hooks.Handle("/incoming/update", api.ApiUserRequired(updateIncomingHook)).Methods("POST") api.BaseRoutes.Hooks.Handle("/incoming/delete", api.ApiUserRequired(deleteIncomingHook)).Methods("POST") diff --git a/api/webrtc.go b/api/webrtc.go index 92c44159f..cd37c0ad8 100644 --- a/api/webrtc.go +++ b/api/webrtc.go @@ -5,14 +5,9 @@ package api import ( "net/http" - - l4g "github.com/alecthomas/log4go" - "github.com/mattermost/mattermost-server/utils" ) func (api *API) InitWebrtc() { - l4g.Debug(utils.T("api.webrtc.init.debug")) - api.BaseRoutes.Webrtc.Handle("/token", api.ApiUserRequired(webrtcToken)).Methods("POST") } diff --git a/api/websocket.go b/api/websocket.go index 518f81d58..0da18d896 100644 --- a/api/websocket.go +++ b/api/websocket.go @@ -13,7 +13,6 @@ import ( ) func (api *API) InitWebSocket() { - l4g.Debug(utils.T("api.web_socket.init.debug")) api.BaseRoutes.Users.Handle("/websocket", api.ApiAppHandlerTrustRequester(connect)).Methods("GET") } |