feat: remove zone from /clients api

This commit is contained in:
zhongwencool 2023-06-14 16:55:19 +08:00
parent 121cd9124a
commit bd33dcb049
3 changed files with 3 additions and 16 deletions

View File

@ -75,7 +75,6 @@ listener_mqtt_tcp_conf(Port, EnableAuthn) ->
PortS = integer_to_binary(Port), PortS = integer_to_binary(Port),
#{ #{
<<"acceptors">> => 16, <<"acceptors">> => 16,
<<"zone">> => <<"default">>,
<<"access_rules">> => ["allow all"], <<"access_rules">> => ["allow all"],
<<"bind">> => <<"0.0.0.0:", PortS/binary>>, <<"bind">> => <<"0.0.0.0:", PortS/binary>>,
<<"max_connections">> => 1024000, <<"max_connections">> => 1024000,

View File

@ -170,7 +170,7 @@ drop_hidden_roots(Conf) ->
lists:foldl(fun(K, Acc) -> maps:remove(K, Acc) end, Conf, hidden_roots()). lists:foldl(fun(K, Acc) -> maps:remove(K, Acc) end, Conf, hidden_roots()).
hidden_roots() -> hidden_roots() ->
[<<"trace">>, <<"stats">>, <<"broker">>]. [<<"trace">>, <<"stats">>, <<"broker">>, <<"persistent_session_store">>].
get_config(Key) -> get_config(Key) ->
case emqx:get_raw_config([Key], undefined) of case emqx:get_raw_config([Key], undefined) of

View File

@ -63,7 +63,6 @@
-define(CLIENT_QSCHEMA, [ -define(CLIENT_QSCHEMA, [
{<<"node">>, atom}, {<<"node">>, atom},
{<<"username">>, binary}, {<<"username">>, binary},
{<<"zone">>, atom},
{<<"ip_address">>, ip}, {<<"ip_address">>, ip},
{<<"conn_state">>, atom}, {<<"conn_state">>, atom},
{<<"clean_start">>, atom}, {<<"clean_start">>, atom},
@ -122,11 +121,6 @@ schema("/clients") ->
required => false, required => false,
desc => <<"User name">> desc => <<"User name">>
})}, })},
{zone,
hoconsc:mk(binary(), #{
in => query,
required => false
})},
{ip_address, {ip_address,
hoconsc:mk(binary(), #{ hoconsc:mk(binary(), #{
in => query, in => query,
@ -549,12 +543,7 @@ fields(client) ->
" Maximum number of subscriptions allowed by this client">> " Maximum number of subscriptions allowed by this client">>
})}, })},
{username, hoconsc:mk(binary(), #{desc => <<"User name of client when connecting">>})}, {username, hoconsc:mk(binary(), #{desc => <<"User name of client when connecting">>})},
{mountpoint, hoconsc:mk(binary(), #{desc => <<"Topic mountpoint">>})}, {mountpoint, hoconsc:mk(binary(), #{desc => <<"Topic mountpoint">>})}
{zone,
hoconsc:mk(binary(), #{
desc =>
<<"Indicate the configuration group used by the client">>
})}
]; ];
fields(authz_cache) -> fields(authz_cache) ->
[ [
@ -848,8 +837,6 @@ ms(clientid, X) ->
#{clientinfo => #{clientid => X}}; #{clientinfo => #{clientid => X}};
ms(username, X) -> ms(username, X) ->
#{clientinfo => #{username => X}}; #{clientinfo => #{username => X}};
ms(zone, X) ->
#{clientinfo => #{zone => X}};
ms(conn_state, X) -> ms(conn_state, X) ->
#{conn_state => X}; #{conn_state => X};
ms(ip_address, X) -> ms(ip_address, X) ->
@ -930,6 +917,7 @@ format_channel_info(WhichNode, {_, ClientInfo0, ClientStats}) ->
sockname, sockname,
retry_interval, retry_interval,
upgrade_qos, upgrade_qos,
zone,
%% sessionID, defined in emqx_session.erl %% sessionID, defined in emqx_session.erl
id id
], ],