Merge pull request #9347 from thalesmg/crl-rename-cfg-rv44

refactor(crl): rename `s/enable_crl_cache/enable_crl_check/g`
This commit is contained in:
Thales Macedo Garitezi 2022-11-11 10:49:51 -03:00 committed by GitHub
commit 6d27e24bb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 9 deletions

View File

@ -1554,7 +1554,7 @@ listener.ssl.external.cacertfile = {{ platform_etc_dir }}/certs/cacert.pem
## ##
## Value: boolean ## Value: boolean
## Default: false ## Default: false
## listener.ssl.external.enable_crl_cache = true ## listener.ssl.external.enable_crl_check = true
## Comma-separated URL list for CRL servers to fetch and cache CRLs ## Comma-separated URL list for CRL servers to fetch and cache CRLs
## from. Must include the path to the CRL file(s). ## from. Must include the path to the CRL file(s).

View File

@ -1702,7 +1702,7 @@ end}.
{datatype, {duration, ms}} {datatype, {duration, ms}}
]}. ]}.
{mapping, "listener.ssl.$name.enable_crl_cache", "emqx.listeners", [ {mapping, "listener.ssl.$name.enable_crl_check", "emqx.listeners", [
{default, false}, {default, false},
{datatype, {enum, [true, false]}} {datatype, {enum, [true, false]}}
]}. ]}.
@ -2337,7 +2337,7 @@ end}.
undefined -> undefined; undefined -> undefined;
_ -> {fun emqx_psk:lookup/3, <<>>} _ -> {fun emqx_psk:lookup/3, <<>>}
end, end,
CRLCheck = case cuttlefish:conf_get(Prefix ++ ".enable_crl_cache", Conf, false) of CRLCheck = case cuttlefish:conf_get(Prefix ++ ".enable_crl_check", Conf, false) of
true -> true ->
HTTPTimeout = cuttlefish:conf_get(Prefix ++ ".crl_cache_http_timeout", Conf, timer:seconds(15)), HTTPTimeout = cuttlefish:conf_get(Prefix ++ ".crl_cache_http_timeout", Conf, timer:seconds(15)),
%% {crl_check, true} doesn't work %% {crl_check, true} doesn't work
@ -2374,7 +2374,7 @@ end}.
undefined -> undefined; undefined -> undefined;
URLs -> string:tokens(URLs, ", ") URLs -> string:tokens(URLs, ", ")
end, end,
Filter([ {crl_cache_enabled, cuttlefish:conf_get(Prefix ++ ".enable_crl_cache", Conf, false)} Filter([ {crl_check_enabled, cuttlefish:conf_get(Prefix ++ ".enable_crl_check", Conf, false)}
, {crl_cache_urls, CRLURLs} , {crl_cache_urls, CRLURLs}
]) ])
end, end,

View File

@ -187,7 +187,7 @@ collect_urls(Listeners) ->
CRLOpts1 = CRLOpts1 =
lists:filter( lists:filter(
fun(CRLOpts) -> fun(CRLOpts) ->
proplists:get_bool(crl_cache_enabled, CRLOpts) proplists:get_bool(crl_check_enabled, CRLOpts)
end, end,
CRLOpts0), CRLOpts0),
CRLURLs = CRLURLs =

View File

@ -306,7 +306,7 @@ find_by_id(Id, [L | Rest]) ->
-spec maybe_register_crl_urls([esockd:option()]) -> ok. -spec maybe_register_crl_urls([esockd:option()]) -> ok.
maybe_register_crl_urls(Options) -> maybe_register_crl_urls(Options) ->
CRLOptions = proplists:get_value(crl_options, Options, []), CRLOptions = proplists:get_value(crl_options, Options, []),
case proplists:get_bool(crl_cache_enabled, CRLOptions) of case proplists:get_bool(crl_check_enabled, CRLOptions) of
false -> false ->
ok; ok;
true -> true ->

View File

@ -80,7 +80,7 @@ end_per_testcase(TestCase, Config)
emqx_crl_cache_http_server:stop(ServerPid), emqx_crl_cache_http_server:stop(ServerPid),
emqx_ct_helpers:stop_apps([]), emqx_ct_helpers:stop_apps([]),
emqx_ct_helpers:change_emqx_opts( emqx_ct_helpers:change_emqx_opts(
ssl_twoway, [ {crl_options, [ {crl_cache_enabled, false} ssl_twoway, [ {crl_options, [ {crl_check_enabled, false}
, {crl_cache_urls, []} , {crl_cache_urls, []}
]} ]}
]), ]),
@ -90,7 +90,7 @@ end_per_testcase(TestCase, Config)
end_per_testcase(t_not_cached_and_unreachable, _Config) -> end_per_testcase(t_not_cached_and_unreachable, _Config) ->
emqx_ct_helpers:stop_apps([]), emqx_ct_helpers:stop_apps([]),
emqx_ct_helpers:change_emqx_opts( emqx_ct_helpers:change_emqx_opts(
ssl_twoway, [ {crl_options, [ {crl_cache_enabled, false} ssl_twoway, [ {crl_options, [ {crl_check_enabled, false}
, {crl_cache_urls, []} , {crl_cache_urls, []}
]} ]}
]), ]),
@ -194,7 +194,7 @@ setup_crl_options(Config, #{is_cached := IsCached}) ->
, {crl_cache, , {crl_cache,
{ssl_crl_cache, {internal, [{http, timer:seconds(15)}]}}} {ssl_crl_cache, {internal, [{http, timer:seconds(15)}]}}}
]} ]}
, {crl_options, [ {crl_cache_enabled, true} , {crl_options, [ {crl_check_enabled, true}
, {crl_cache_urls, URLs} , {crl_cache_urls, URLs}
]} ]}
]), ]),