From 4f638b8242f93116c5deb163b6818cab02f021ae Mon Sep 17 00:00:00 2001 From: Zaiming Shi Date: Wed, 22 Sep 2021 15:09:46 +0200 Subject: [PATCH] fix(schema): upgrade to hocon 0.19.5 renamed no_conversion option to only_fill_defaults --- apps/emqx/rebar.config | 4 ++-- apps/emqx/src/emqx_config.erl | 3 ++- apps/emqx_authn/src/emqx_authn_api.erl | 7 ++++--- rebar.config | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/apps/emqx/rebar.config b/apps/emqx/rebar.config index da55f3fd0..cf86338f9 100644 --- a/apps/emqx/rebar.config +++ b/apps/emqx/rebar.config @@ -10,13 +10,13 @@ %% `git_subdir` dependency in other projects. {deps, [ {gproc, {git, "https://github.com/uwiger/gproc", {tag, "0.8.0"}}} - , {typerefl, {git, "https://github.com/k32/typerefl", {tag, "0.8.4"}}} + , {typerefl, {git, "https://github.com/k32/typerefl", {tag, "0.8.5"}}} , {jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.5"}}} , {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.8.3"}}} , {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.8.2"}}} , {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.10.8"}}} , {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.5.1"}}} - , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.19.3"}}} + , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.19.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_config.erl b/apps/emqx/src/emqx_config.erl index 98466d3df..67af08eba 100644 --- a/apps/emqx/src/emqx_config.erl +++ b/apps/emqx/src/emqx_config.erl @@ -294,7 +294,8 @@ fill_defaults(RawConf) -> -spec fill_defaults(module(), raw_config()) -> map(). fill_defaults(SchemaMod, RawConf) -> hocon_schema:check_plain(SchemaMod, RawConf, - #{nullable => true, no_conversion => true}, root_names_from_conf(RawConf)). + #{nullable => true, only_fill_defaults => true}, + root_names_from_conf(RawConf)). -spec read_override_conf() -> raw_config(). read_override_conf() -> diff --git a/apps/emqx_authn/src/emqx_authn_api.erl b/apps/emqx_authn/src/emqx_authn_api.erl index 540cf86e3..d115131a5 100644 --- a/apps/emqx_authn/src/emqx_authn_api.erl +++ b/apps/emqx_authn/src/emqx_authn_api.erl @@ -1970,8 +1970,9 @@ find_config(AuthenticatorID, AuthenticatorsConfig) -> end. fill_defaults(Config) -> - #{<<"authentication">> := CheckedConfig} = hocon_schema:check_plain( - ?AUTHN, #{<<"authentication">> => Config}, #{no_conversion => true}), + #{<<"authentication">> := CheckedConfig} = + hocon_schema:check_plain(?AUTHN, #{<<"authentication">> => Config}, + #{only_fill_defaults => true}), CheckedConfig. convert_certs(#{<<"ssl">> := SSLOpts} = Config) -> @@ -2070,4 +2071,4 @@ to_list(L) when is_list(L) -> to_atom(B) when is_binary(B) -> binary_to_atom(B); to_atom(A) when is_atom(A) -> - A. \ No newline at end of file + A. diff --git a/rebar.config b/rebar.config index 35774298b..9b374d107 100644 --- a/rebar.config +++ b/rebar.config @@ -44,7 +44,7 @@ {deps, [ {gpb, "4.11.2"} %% gpb only used to build, but not for release, pin it here to avoid fetching a wrong version due to rebar plugins scattered in all the deps - , {typerefl, {git, "https://github.com/k32/typerefl", {tag, "0.8.4"}}} + , {typerefl, {git, "https://github.com/k32/typerefl", {tag, "0.8.5"}}} , {ehttpc, {git, "https://github.com/emqx/ehttpc", {tag, "0.1.9"}}} , {gproc, {git, "https://github.com/uwiger/gproc", {tag, "0.8.0"}}} , {jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.5"}}} @@ -61,7 +61,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.19.3"}}} + , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.19.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"}}}