chore: fix typos in code and suite
This commit is contained in:
parent
a35ed4dacb
commit
a3f33cc8bc
|
@ -585,7 +585,7 @@ t_connack_max_qos_allowed(Config) ->
|
||||||
|
|
||||||
process_flag(trap_exit, false).
|
process_flag(trap_exit, false).
|
||||||
|
|
||||||
t_connack_assigned_clienid(Config) ->
|
t_connack_assigned_clientid(Config) ->
|
||||||
ConnFun = ?config(conn_fun, Config),
|
ConnFun = ?config(conn_fun, Config),
|
||||||
{ok, Client1} = emqtt:start_link([{proto_ver, v5} | Config]),
|
{ok, Client1} = emqtt:start_link([{proto_ver, v5} | Config]),
|
||||||
{ok, _} = emqtt:ConnFun(Client1),
|
{ok, _} = emqtt:ConnFun(Client1),
|
||||||
|
|
|
@ -509,7 +509,7 @@ codestr(400) -> 'BAD_REQUEST';
|
||||||
codestr(404) -> 'RESOURCE_NOT_FOUND';
|
codestr(404) -> 'RESOURCE_NOT_FOUND';
|
||||||
codestr(405) -> 'METHOD_NOT_ALLOWED';
|
codestr(405) -> 'METHOD_NOT_ALLOWED';
|
||||||
codestr(409) -> 'NOT_SUPPORT';
|
codestr(409) -> 'NOT_SUPPORT';
|
||||||
codestr(500) -> 'UNKNOW_ERROR';
|
codestr(500) -> 'UNKNOWN_ERROR';
|
||||||
codestr(501) -> 'NOT_IMPLEMENTED'.
|
codestr(501) -> 'NOT_IMPLEMENTED'.
|
||||||
|
|
||||||
fmtstr(Fmt, Args) ->
|
fmtstr(Fmt, Args) ->
|
||||||
|
|
|
@ -797,7 +797,7 @@ test_frame_error(Frame, AssertFun) ->
|
||||||
AssertFun(Sock)
|
AssertFun(Sock)
|
||||||
end).
|
end).
|
||||||
|
|
||||||
t_rest_clienit_info(_) ->
|
t_rest_clientid_info(_) ->
|
||||||
with_connection(fun(Sock) ->
|
with_connection(fun(Sock) ->
|
||||||
send_connection_frame(Sock, <<"guest">>, <<"guest">>),
|
send_connection_frame(Sock, <<"guest">>, <<"guest">>),
|
||||||
?assertMatch({ok, #stomp_frame{command = <<"CONNECTED">>}}, recv_a_frame(Sock)),
|
?assertMatch({ok, #stomp_frame{command = <<"CONNECTED">>}}, recv_a_frame(Sock)),
|
||||||
|
|
|
@ -221,7 +221,7 @@ schema("/clients/kickout/bulk") ->
|
||||||
tags => ?TAGS,
|
tags => ?TAGS,
|
||||||
'requestBody' => emqx_dashboard_swagger:schema_with_example(
|
'requestBody' => emqx_dashboard_swagger:schema_with_example(
|
||||||
hoconsc:array(binary()),
|
hoconsc:array(binary()),
|
||||||
["emqx_clienid_985bb09d", "emqx_clientid_211cc01c"]
|
["emqx_clientid_985bb09d", "emqx_clientid_211cc01c"]
|
||||||
),
|
),
|
||||||
responses => #{
|
responses => #{
|
||||||
204 => <<"Kick out clients successfully">>
|
204 => <<"Kick out clients successfully">>
|
||||||
|
@ -452,7 +452,7 @@ fields(client) ->
|
||||||
{is_bridge,
|
{is_bridge,
|
||||||
hoconsc:mk(boolean(), #{
|
hoconsc:mk(boolean(), #{
|
||||||
desc =>
|
desc =>
|
||||||
<<"Indicates whether the client is connectedvia bridge">>
|
<<"Indicates whether the client is connected via bridge">>
|
||||||
})},
|
})},
|
||||||
{keepalive,
|
{keepalive,
|
||||||
hoconsc:mk(integer(), #{
|
hoconsc:mk(integer(), #{
|
||||||
|
@ -605,7 +605,7 @@ kickout_clients(post, #{body := ClientIDs}) ->
|
||||||
{204};
|
{204};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
Message = list_to_binary(io_lib:format("~p", [Reason])),
|
Message = list_to_binary(io_lib:format("~p", [Reason])),
|
||||||
{500, #{code => <<"UNKNOW_ERROR">>, message => Message}}
|
{500, #{code => <<"UNKNOWN_ERROR">>, message => Message}}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
client(get, #{bindings := Bindings}) ->
|
client(get, #{bindings := Bindings}) ->
|
||||||
|
@ -660,7 +660,7 @@ set_keepalive(put, #{bindings := #{clientid := ClientID}, body := Body}) ->
|
||||||
case emqx_mgmt:set_keepalive(ClientID, Interval) of
|
case emqx_mgmt:set_keepalive(ClientID, Interval) of
|
||||||
ok -> lookup(#{clientid => ClientID});
|
ok -> lookup(#{clientid => ClientID});
|
||||||
{error, not_found} -> {404, ?CLIENTID_NOT_FOUND};
|
{error, not_found} -> {404, ?CLIENTID_NOT_FOUND};
|
||||||
{error, Reason} -> {400, #{code => 'PARAMS_ERROR', message => Reason}}
|
{error, Reason} -> {400, #{code => 'PARAM_ERROR', message => Reason}}
|
||||||
end
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -728,7 +728,7 @@ get_authz_cache(#{clientid := ClientID}) ->
|
||||||
{404, ?CLIENTID_NOT_FOUND};
|
{404, ?CLIENTID_NOT_FOUND};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
Message = list_to_binary(io_lib:format("~p", [Reason])),
|
Message = list_to_binary(io_lib:format("~p", [Reason])),
|
||||||
{500, #{code => <<"UNKNOW_ERROR">>, message => Message}};
|
{500, #{code => <<"UNKNOWN_ERROR">>, message => Message}};
|
||||||
Caches ->
|
Caches ->
|
||||||
Response = [format_authz_cache(Cache) || Cache <- Caches],
|
Response = [format_authz_cache(Cache) || Cache <- Caches],
|
||||||
{200, Response}
|
{200, Response}
|
||||||
|
@ -742,7 +742,7 @@ clean_authz_cache(#{clientid := ClientID}) ->
|
||||||
{404, ?CLIENTID_NOT_FOUND};
|
{404, ?CLIENTID_NOT_FOUND};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
Message = list_to_binary(io_lib:format("~p", [Reason])),
|
Message = list_to_binary(io_lib:format("~p", [Reason])),
|
||||||
{500, #{code => <<"UNKNOW_ERROR">>, message => Message}}
|
{500, #{code => <<"UNKNOWN_ERROR">>, message => Message}}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
subscribe(#{clientid := ClientID, topic := Topic} = Sub) ->
|
subscribe(#{clientid := ClientID, topic := Topic} = Sub) ->
|
||||||
|
@ -752,7 +752,7 @@ subscribe(#{clientid := ClientID, topic := Topic} = Sub) ->
|
||||||
{404, ?CLIENTID_NOT_FOUND};
|
{404, ?CLIENTID_NOT_FOUND};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
Message = list_to_binary(io_lib:format("~p", [Reason])),
|
Message = list_to_binary(io_lib:format("~p", [Reason])),
|
||||||
{500, #{code => <<"UNKNOW_ERROR">>, message => Message}};
|
{500, #{code => <<"UNKNOWN_ERROR">>, message => Message}};
|
||||||
{ok, SubInfo} ->
|
{ok, SubInfo} ->
|
||||||
{200, SubInfo}
|
{200, SubInfo}
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -419,7 +419,7 @@ do_publish(Key = {Ts, _Id}, Now, Acc) when Ts =< Now ->
|
||||||
ignore_delayed_message_publish,
|
ignore_delayed_message_publish,
|
||||||
#{
|
#{
|
||||||
reason => "client is banned",
|
reason => "client is banned",
|
||||||
clienid => Msg#message.from
|
clientid => Msg#message.from
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
ok
|
ok
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%% -*- mode: erlang -*-
|
%% -*- mode: erlang -*-
|
||||||
{application, emqx_modules, [
|
{application, emqx_modules, [
|
||||||
{description, "EMQX Modules"},
|
{description, "EMQX Modules"},
|
||||||
{vsn, "5.0.24"},
|
{vsn, "5.0.25"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{applications, [kernel, stdlib, emqx, emqx_ctl, observer_cli]},
|
{applications, [kernel, stdlib, emqx, emqx_ctl, observer_cli]},
|
||||||
{mod, {emqx_modules_app, []}},
|
{mod, {emqx_modules_app, []}},
|
||||||
|
|
Loading…
Reference in New Issue