fix(bridges): handle secrets more consistently

Co-authored-by: Thales Macedo Garitezi <thalesmg@gmail.com>
This commit is contained in:
Andrew Mayorov 2023-11-14 16:03:48 +07:00
parent 11c7024d9d
commit d1c3b1c659
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
3 changed files with 3 additions and 3 deletions

View File

@ -379,7 +379,7 @@ username(_) ->
password(#{password := Password}) -> password(#{password := Password}) ->
%% TODO: teach `influxdb` to accept 0-arity closures as passwords. %% TODO: teach `influxdb` to accept 0-arity closures as passwords.
[{password, emqx_secret:unwrap(Password)}]; [{password, str(emqx_secret:unwrap(Password))}];
password(_) -> password(_) ->
[]. [].

View File

@ -199,7 +199,7 @@ on_start(
Options = [ Options = [
{server, to_bin(Server)}, {server, to_bin(Server)},
{username, Username}, {username, Username},
{password, maps:get(password, Config, "")}, {password, maps:get(password, Config, emqx_secret:wrap(""))},
{driver, Driver}, {driver, Driver},
{database, Database}, {database, Database},
{pool_size, PoolSize} {pool_size, PoolSize}

View File

@ -131,7 +131,7 @@ on_start(
{host, Host}, {host, Host},
{port, Port}, {port, Port},
{username, User}, {username, User},
{password, maps:get(password, Config, "")}, {password, maps:get(password, Config, emqx_secret:wrap(""))},
{database, DB}, {database, DB},
{auto_reconnect, ?AUTO_RECONNECT_INTERVAL}, {auto_reconnect, ?AUTO_RECONNECT_INTERVAL},
{pool_size, PoolSize} {pool_size, PoolSize}