fix(connector): fix mongo connector auth failed

This commit is contained in:
Rory Z 2021-07-07 14:02:58 +08:00 committed by Rory Z
parent dc98cff27b
commit 6d7424b445
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@
{mysql, {git, "https://github.com/emqx/mysql-otp", {tag, "1.7.1"}}},
{epgsql, {git, "https://github.com/epgsql/epgsql", {tag, "4.4.0"}}},
%% NOTE: mind poolboy version when updating mongodb-erlang version
{mongodb, {git,"https://github.com/emqx/mongodb-erlang", {tag, "v3.0.7"}}},
{mongodb, {git,"https://github.com/emqx/mongodb-erlang", {tag, "v3.0.8"}}},
%% NOTE: mind poolboy version when updating eredis_cluster version
{eredis_cluster, {git, "https://github.com/emqx/eredis_cluster", {tag, "0.6.7"}}},
%% mongodb-erlang uses a special fork https://github.com/comtihon/poolboy.git

View File

@ -78,8 +78,8 @@ mongo_fields() ->
[ {pool_size, fun emqx_connector_schema_lib:pool_size/1}
, {username, fun emqx_connector_schema_lib:username/1}
, {password, fun emqx_connector_schema_lib:password/1}
, {authentication_database, #{type => binary(),
nullable => true}}
, {auth_source, #{type => binary(),
nullable => true}}
, {database, fun emqx_connector_schema_lib:database/1}
] ++
emqx_connector_schema_lib:ssl_fields().
@ -218,7 +218,7 @@ init_topology_options([], Acc) ->
init_worker_options([{database, V} | R], Acc) ->
init_worker_options(R, [{database, V} | Acc]);
init_worker_options([{authentication_database, V} | R], Acc) ->
init_worker_options([{auth_source, V} | R], Acc) ->
init_worker_options(R, [{auth_source, V} | Acc]);
init_worker_options([{username, V} | R], Acc) ->
init_worker_options(R, [{login, V} | Acc]);