diff --git a/server/channels/api4/ldap.go b/server/channels/api4/ldap.go index ebce88333c..67beb67cce 100644 --- a/server/channels/api4/ldap.go +++ b/server/channels/api4/ldap.go @@ -34,8 +34,8 @@ func (api *API) InitLdap() { // DELETE /api/v4/ldap/groups/:remote_id/link api.BaseRoutes.LDAP.Handle(`/groups/{remote_id}/link`, api.APISessionRequired(unlinkLdapGroup)).Methods("DELETE") - api.BaseRoutes.LDAP.Handle("/certificate/public", api.APISessionRequired(addLdapPublicCertificate)).Methods("POST") - api.BaseRoutes.LDAP.Handle("/certificate/private", api.APISessionRequired(addLdapPrivateCertificate)).Methods("POST") + api.BaseRoutes.LDAP.Handle("/certificate/public", api.APISessionRequired(addLdapPublicCertificate, handlerParamFileAPI)).Methods("POST") + api.BaseRoutes.LDAP.Handle("/certificate/private", api.APISessionRequired(addLdapPrivateCertificate, handlerParamFileAPI)).Methods("POST") api.BaseRoutes.LDAP.Handle("/certificate/public", api.APISessionRequired(removeLdapPublicCertificate)).Methods("DELETE") api.BaseRoutes.LDAP.Handle("/certificate/private", api.APISessionRequired(removeLdapPrivateCertificate)).Methods("DELETE") diff --git a/server/channels/api4/license.go b/server/channels/api4/license.go index f08c5ad6a7..2d7d5893c0 100644 --- a/server/channels/api4/license.go +++ b/server/channels/api4/license.go @@ -21,7 +21,7 @@ import ( func (api *API) InitLicense() { api.BaseRoutes.APIRoot.Handle("/trial-license", api.APISessionRequired(requestTrialLicense)).Methods("POST") api.BaseRoutes.APIRoot.Handle("/trial-license/prev", api.APISessionRequired(getPrevTrialLicense)).Methods("GET") - api.BaseRoutes.APIRoot.Handle("/license", api.APISessionRequired(addLicense)).Methods("POST") + api.BaseRoutes.APIRoot.Handle("/license", api.APISessionRequired(addLicense, handlerParamFileAPI)).Methods("POST") api.BaseRoutes.APIRoot.Handle("/license", api.APISessionRequired(removeLicense)).Methods("DELETE") api.BaseRoutes.APIRoot.Handle("/license/renewal", api.APISessionRequired(requestRenewalLink)).Methods("GET") api.BaseRoutes.APIRoot.Handle("/license/client", api.APIHandler(getClientLicense)).Methods("GET") diff --git a/server/channels/api4/license_local.go b/server/channels/api4/license_local.go index 5145e9eb40..debc84409e 100644 --- a/server/channels/api4/license_local.go +++ b/server/channels/api4/license_local.go @@ -15,7 +15,7 @@ import ( ) func (api *API) InitLicenseLocal() { - api.BaseRoutes.APIRoot.Handle("/license", api.APILocal(localAddLicense)).Methods("POST") + api.BaseRoutes.APIRoot.Handle("/license", api.APILocal(localAddLicense, handlerParamFileAPI)).Methods("POST") api.BaseRoutes.APIRoot.Handle("/license", api.APILocal(localRemoveLicense)).Methods("DELETE") } diff --git a/server/channels/api4/plugin.go b/server/channels/api4/plugin.go index 4068e24218..e037ba0b49 100644 --- a/server/channels/api4/plugin.go +++ b/server/channels/api4/plugin.go @@ -24,7 +24,7 @@ const ( ) func (api *API) InitPlugin() { - api.BaseRoutes.Plugins.Handle("", api.APISessionRequired(uploadPlugin)).Methods("POST") + api.BaseRoutes.Plugins.Handle("", api.APISessionRequired(uploadPlugin, handlerParamFileAPI)).Methods("POST") api.BaseRoutes.Plugins.Handle("", api.APISessionRequired(getPlugins)).Methods("GET") api.BaseRoutes.Plugin.Handle("", api.APISessionRequired(removePlugin)).Methods("DELETE") api.BaseRoutes.Plugins.Handle("/install_from_url", api.APISessionRequired(installPluginFromURL)).Methods("POST") diff --git a/server/channels/api4/plugin_local.go b/server/channels/api4/plugin_local.go index 32aca6969a..1aee887062 100644 --- a/server/channels/api4/plugin_local.go +++ b/server/channels/api4/plugin_local.go @@ -4,7 +4,7 @@ package api4 func (api *API) InitPluginLocal() { - api.BaseRoutes.Plugins.Handle("", api.APILocal(uploadPlugin)).Methods("POST") + api.BaseRoutes.Plugins.Handle("", api.APILocal(uploadPlugin, handlerParamFileAPI)).Methods("POST") api.BaseRoutes.Plugins.Handle("", api.APILocal(getPlugins)).Methods("GET") api.BaseRoutes.Plugins.Handle("/install_from_url", api.APILocal(installPluginFromURL)).Methods("POST") api.BaseRoutes.Plugin.Handle("", api.APILocal(removePlugin)).Methods("DELETE") diff --git a/server/channels/api4/remote_cluster.go b/server/channels/api4/remote_cluster.go index 729aeb9e55..9935eaff1e 100644 --- a/server/channels/api4/remote_cluster.go +++ b/server/channels/api4/remote_cluster.go @@ -20,8 +20,8 @@ func (api *API) InitRemoteCluster() { api.BaseRoutes.RemoteCluster.Handle("/ping", api.RemoteClusterTokenRequired(remoteClusterPing)).Methods("POST") api.BaseRoutes.RemoteCluster.Handle("/msg", api.RemoteClusterTokenRequired(remoteClusterAcceptMessage)).Methods("POST") api.BaseRoutes.RemoteCluster.Handle("/confirm_invite", api.RemoteClusterTokenRequired(remoteClusterConfirmInvite)).Methods("POST") - api.BaseRoutes.RemoteCluster.Handle("/upload/{upload_id:[A-Za-z0-9]+}", api.RemoteClusterTokenRequired(uploadRemoteData)).Methods("POST") - api.BaseRoutes.RemoteCluster.Handle("/{user_id:[A-Za-z0-9]+}/image", api.RemoteClusterTokenRequired(remoteSetProfileImage)).Methods("POST") + api.BaseRoutes.RemoteCluster.Handle("/upload/{upload_id:[A-Za-z0-9]+}", api.RemoteClusterTokenRequired(uploadRemoteData, handlerParamFileAPI)).Methods("POST") + api.BaseRoutes.RemoteCluster.Handle("/{user_id:[A-Za-z0-9]+}/image", api.RemoteClusterTokenRequired(remoteSetProfileImage, handlerParamFileAPI)).Methods("POST") } func remoteClusterPing(c *Context, w http.ResponseWriter, r *http.Request) {