diff --git a/apps/emqx/rebar.config b/apps/emqx/rebar.config index 4ea0b06be..61d5717d9 100644 --- a/apps/emqx/rebar.config +++ b/apps/emqx/rebar.config @@ -17,7 +17,7 @@ , {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.9.0"}}} , {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.11.1"}}} , {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.5.1"}}} - , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.20.3"}}} + , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.20.5"}}} , {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {tag, "2.0.4"}}} , {recon, {git, "https://github.com/ferd/recon", {tag, "2.5.1"}}} , {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "0.14.1"}}} diff --git a/apps/emqx/src/emqx_schema.erl b/apps/emqx/src/emqx_schema.erl index 118cea5df..2d71a1d69 100644 --- a/apps/emqx/src/emqx_schema.erl +++ b/apps/emqx/src/emqx_schema.erl @@ -331,10 +331,7 @@ fields("mqtt") -> ]; fields("zone") -> - Fields = ["mqtt", "stats", "flapping_detect", "force_shutdown", - "conn_congestion", "rate_limit", "quota", "force_gc", - "overload_protection" - ], + Fields = emqx_zone_schema:roots(), [{F, ref(emqx_zone_schema, F)} || F <- Fields]; fields("rate_limit") -> @@ -1358,9 +1355,9 @@ authentication(Desc) -> #{ type => hoconsc:lazy(hoconsc:union([typerefl:map(), hoconsc:array(typerefl:map())])) , desc => iolist_to_binary([Desc, "
", """ Authentication can be one single authenticator instance or a chain of authenticators as an array. -The when authenticating a login (username, client ID, etc.) the authenticators are checked +When authenticating a login (username, client ID, etc.) the authenticators are checked in the configured order.
EMQ X comes with a set of pre-built autenticators, for more details, see -authenticator_config. +autenticator_config """]) }. diff --git a/apps/emqx/src/emqx_zone_schema.erl b/apps/emqx/src/emqx_zone_schema.erl index 013ffb22f..1d24f9481 100644 --- a/apps/emqx/src/emqx_zone_schema.erl +++ b/apps/emqx/src/emqx_zone_schema.erl @@ -20,7 +20,12 @@ namespace() -> zone. -roots() -> []. +%% this shcema module is not used at root level. +%% roots are added only for document generation. +roots() -> ["mqtt", "stats", "flapping_detect", "force_shutdown", + "conn_congestion", "rate_limit", "quota", "force_gc", + "overload_protection" + ]. %% zone schemas are clones from the same name from root level %% only not allowed to have default values. diff --git a/apps/emqx/test/emqx_config_SUITE.erl b/apps/emqx/test/emqx_config_SUITE.erl index 88585492b..6b3022cae 100644 --- a/apps/emqx/test/emqx_config_SUITE.erl +++ b/apps/emqx/test/emqx_config_SUITE.erl @@ -36,6 +36,7 @@ t_fill_default_values(_) -> <<"perf">> => #{}, <<"route_batch_clean">> => false} }, + WithDefaults = emqx_config:fill_defaults(Conf), ?assertMatch(#{<<"broker">> := #{<<"enable_session_registry">> := true, <<"perf">> := @@ -45,6 +46,8 @@ t_fill_default_values(_) -> <<"session_locking_strategy">> := quorum, <<"shared_dispatch_ack_enabled">> := false, <<"shared_subscription_strategy">> := round_robin, - <<"sys_heartbeat_interval">> := "30s", - <<"sys_msg_interval">> := "1m"}}, - emqx_config:fill_defaults(Conf)). + <<"sys_heartbeat_interval">> := <<"30s">>, + <<"sys_msg_interval">> := <<"1m">>}}, WithDefaults), + %% ensure JSON compatible + _ = emqx_json:encode(WithDefaults), + ok. diff --git a/rebar.config b/rebar.config index 72a75a4b3..410b0701b 100644 --- a/rebar.config +++ b/rebar.config @@ -63,7 +63,7 @@ , {observer_cli, "1.7.1"} % NOTE: depends on recon 2.5.x , {getopt, "1.0.2"} , {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "0.14.1"}}} - , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.20.3"}}} + , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.20.5"}}} , {emqx_http_lib, {git, "https://github.com/emqx/emqx_http_lib.git", {tag, "0.4.1"}}} , {esasl, {git, "https://github.com/emqx/esasl", {tag, "0.2.0"}}} , {jose, {git, "https://github.com/potatosalad/erlang-jose", {tag, "1.11.1"}}}