diff --git a/apps/emqx_management/src/emqx_management.app.src b/apps/emqx_management/src/emqx_management.app.src index a1b812de6..90fde54ac 100644 --- a/apps/emqx_management/src/emqx_management.app.src +++ b/apps/emqx_management/src/emqx_management.app.src @@ -1,6 +1,6 @@ {application, emqx_management, [{description, "EMQ X Management API and CLI"}, - {vsn, "4.3.4"}, % strict semver, bump manually! + {vsn, "4.3.5"}, % strict semver, bump manually! {modules, []}, {registered, [emqx_management_sup]}, {applications, [kernel,stdlib,minirest]}, diff --git a/apps/emqx_management/src/emqx_management.appup.src b/apps/emqx_management/src/emqx_management.appup.src index 727658caa..09406c1c3 100644 --- a/apps/emqx_management/src/emqx_management.appup.src +++ b/apps/emqx_management/src/emqx_management.appup.src @@ -1,12 +1,16 @@ %% -*- mode: erlang -*- {VSN, - [ {<<"4.3.[0-3]">>, - [ {restart_application, emqx_management} + [ {<<"4.3.[0-4]">>, + [ {apply,{minirest,stop_http,['http:management']}}, + {apply,{minirest,stop_http,['https:management']}}, + {restart_application, emqx_management} ]}, {<<".*">>, []} ], - [ {<<"4.3.[0-3]">>, - [ {restart_application, emqx_management} + [ {<<"4.3.[0-4]">>, + [ {apply,{minirest,stop_http,['http:management']}}, + {apply,{minirest,stop_http,['https:management']}}, + {restart_application, emqx_management} ]}, {<<".*">>, []} ] diff --git a/apps/emqx_management/src/emqx_mgmt_http.erl b/apps/emqx_management/src/emqx_mgmt_http.erl index da5a75027..8e92b7371 100644 --- a/apps/emqx_management/src/emqx_mgmt_http.erl +++ b/apps/emqx_management/src/emqx_mgmt_http.erl @@ -25,6 +25,10 @@ -export([init/2]). +-export([ filter/1 + , authorize_appid/1 + ]). + -include_lib("emqx/include/emqx.hrl"). -define(APP, emqx_management). @@ -87,8 +91,8 @@ http_handlers() -> Plugins = lists:map(fun(Plugin) -> Plugin#plugin.name end, emqx_plugins:list()), [{"/api/v4", minirest:handler(#{apps => Plugins ++ [emqx_modules] -- ?EXCEPT_PLUGIN, except => ?EXCEPT, - filter => fun filter/1}), - [{authorization, fun authorize_appid/1}]}]. + filter => fun ?MODULE:filter/1}), + [{authorization, fun ?MODULE:authorize_appid/1}]}]. %%-------------------------------------------------------------------- %% Handle 'status' request