chore(emqx_modules): add emqx_modules api path
This commit is contained in:
parent
8e5cfaf0cc
commit
db92f79713
|
@ -85,7 +85,7 @@ listener_name(Proto) ->
|
|||
|
||||
http_handlers() ->
|
||||
Plugins = lists:map(fun(Plugin) -> Plugin#plugin.name end, emqx_plugins:list()),
|
||||
[{"/api/v4", minirest:handler(#{apps => Plugins -- ?EXCEPT_PLUGIN,
|
||||
[{"/api/v4", minirest:handler(#{apps => Plugins ++ [emqx_modules] -- ?EXCEPT_PLUGIN,
|
||||
except => ?EXCEPT,
|
||||
filter => fun filter/1}),
|
||||
[{authorization, fun authorize_appid/1}]}].
|
||||
|
@ -119,15 +119,12 @@ authorize_appid(Req) ->
|
|||
_ -> false
|
||||
end.
|
||||
|
||||
-ifdef(EMQX_ENTERPRISE).
|
||||
filter(_) -> true.
|
||||
-else.
|
||||
filter(#{app := emqx_modules}) -> true;
|
||||
filter(#{app := App}) ->
|
||||
case emqx_plugins:find_plugin(App) of
|
||||
false -> false;
|
||||
Plugin -> Plugin#plugin.active
|
||||
end.
|
||||
-endif.
|
||||
|
||||
format(Port) when is_integer(Port) ->
|
||||
io_lib:format("0.0.0.0:~w", [Port]);
|
||||
|
|
Loading…
Reference in New Issue