feat(redis): accept wrapped secrets as passwords

This commit is contained in:
Andrew Mayorov 2023-11-07 15:36:57 +07:00
parent 4385b2f020
commit ad72ab7a8c
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 2 additions and 2 deletions

View File

@ -147,7 +147,7 @@ on_start(
[ [
{pool_size, PoolSize}, {pool_size, PoolSize},
{username, maps:get(username, Config, undefined)}, {username, maps:get(username, Config, undefined)},
{password, eredis_secret:wrap(maps:get(password, Config, ""))}, {password, maps:get(password, Config, "")},
{auto_reconnect, ?AUTO_RECONNECT_INTERVAL} {auto_reconnect, ?AUTO_RECONNECT_INTERVAL}
] ++ Database ++ Servers, ] ++ Database ++ Servers,
Options = Options =
@ -296,7 +296,7 @@ redis_fields() ->
[ [
{pool_size, fun emqx_connector_schema_lib:pool_size/1}, {pool_size, fun emqx_connector_schema_lib:pool_size/1},
{username, fun emqx_connector_schema_lib:username/1}, {username, fun emqx_connector_schema_lib:username/1},
{password, fun emqx_connector_schema_lib:password/1}, {password, emqx_connector_schema_lib:password_field()},
{database, #{ {database, #{
type => non_neg_integer(), type => non_neg_integer(),
default => 0, default => 0,