refactor(auth_redis): delete backward-compatible code in config schema
This commit is contained in:
parent
5d45325cb8
commit
7bb590f1c7
|
@ -43,7 +43,6 @@
|
|||
{datatype, string}
|
||||
]}.
|
||||
|
||||
%% FIXME: compatible with 4.0-4.2 version format, plan to delete in 5.0
|
||||
{mapping, "auth.redis.ssl.certfile", "emqx_auth_redis.options", [
|
||||
{default, ""},
|
||||
{datatype, string}
|
||||
|
@ -54,40 +53,17 @@
|
|||
{datatype, string}
|
||||
]}.
|
||||
|
||||
%% FIXME: compatible with 4.0-4.2 version format, plan to delete in 5.0
|
||||
{mapping, "auth.redis.cafile", "emqx_auth_redis.options", [
|
||||
{default, ""},
|
||||
{datatype, string}
|
||||
]}.
|
||||
|
||||
%% FIXME: compatible with 4.0-4.2 version format, plan to delete in 5.0
|
||||
{mapping, "auth.redis.certfile", "emqx_auth_redis.options", [
|
||||
{default, ""},
|
||||
{datatype, string}
|
||||
]}.
|
||||
|
||||
%% FIXME: compatible with 4.0-4.2 version format, plan to delete in 5.0
|
||||
{mapping, "auth.redis.keyfile", "emqx_auth_redis.options", [
|
||||
{default, ""},
|
||||
{datatype, string}
|
||||
]}.
|
||||
|
||||
{translation, "emqx_auth_redis.options", fun(Conf) ->
|
||||
Ssl = cuttlefish:conf_get("auth.redis.ssl.enable", Conf, false),
|
||||
case Ssl of
|
||||
case cuttlefish:conf_get("auth.redis.ssl.enable", Conf, false) of
|
||||
true ->
|
||||
%% FIXME: compatible with 4.0-4.2 version format, plan to delete in 5.0
|
||||
Prefix = case cuttlefish:conf_get("auth.redis.ssl.cacertfile", Conf, undefined) of
|
||||
undefined -> "auth.redis";
|
||||
_ -> "auth.redis.ssl"
|
||||
end,
|
||||
CA = cuttlefish:conf_get(Prefix ++ ".cacertfile", Conf),
|
||||
Cert = cuttlefish:conf_get(Prefix ++ ".certfile", Conf),
|
||||
Key = cuttlefish:conf_get(Prefix ++ ".keyfile", Conf),
|
||||
CA = cuttlefish:conf_get("auth.redis.ssl.cacertfile", Conf),
|
||||
Cert = cuttlefish:conf_get("auth.redis.ssl.certfile", Conf),
|
||||
Key = cuttlefish:conf_get("auth.redis.ssl.keyfile", Conf),
|
||||
[{options, [{ssl_options, [{cacertfile, CA},
|
||||
{certfile, Cert},
|
||||
{keyfile, Key}]}]}];
|
||||
_ -> [{options, []}]
|
||||
false ->
|
||||
[{options, []}]
|
||||
end
|
||||
end}.
|
||||
|
||||
|
|
Loading…
Reference in New Issue