fix(bridges): handle secrets more consistently
Co-authored-by: Thales Macedo Garitezi <thalesmg@gmail.com>
This commit is contained in:
parent
11c7024d9d
commit
d1c3b1c659
|
@ -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(_) ->
|
||||||
[].
|
[].
|
||||||
|
|
||||||
|
|
|
@ -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}
|
||||||
|
|
|
@ -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}
|
||||||
|
|
Loading…
Reference in New Issue