test(mongo): add test case for w_mode option
This commit is contained in:
parent
c33eb84cb6
commit
821b50a961
|
@ -82,7 +82,8 @@ t_create_invalid(_Config) ->
|
||||||
InvalidConfigs =
|
InvalidConfigs =
|
||||||
[
|
[
|
||||||
AuthConfig#{mongo_type => <<"unknown">>},
|
AuthConfig#{mongo_type => <<"unknown">>},
|
||||||
AuthConfig#{selector => <<"{ \"username\": \"${username}\" }">>}
|
AuthConfig#{selector => <<"{ \"username\": \"${username}\" }">>},
|
||||||
|
AuthConfig#{w_mode => <<"unknown">>}
|
||||||
],
|
],
|
||||||
|
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
|
@ -247,6 +248,7 @@ raw_mongo_auth_config() ->
|
||||||
database => <<"mqtt">>,
|
database => <<"mqtt">>,
|
||||||
collection => <<"users">>,
|
collection => <<"users">>,
|
||||||
server => mongo_server(),
|
server => mongo_server(),
|
||||||
|
w_mode => <<"unsafe">>,
|
||||||
|
|
||||||
selector => #{<<"username">> => <<"${username}">>},
|
selector => #{<<"username">> => <<"${username}">>},
|
||||||
password_hash_field => <<"password_hash">>,
|
password_hash_field => <<"password_hash">>,
|
||||||
|
|
|
@ -160,6 +160,7 @@ raw_mongo_auth_config(SpecificSSLOpts) ->
|
||||||
database => <<"mqtt">>,
|
database => <<"mqtt">>,
|
||||||
collection => <<"users">>,
|
collection => <<"users">>,
|
||||||
server => mongo_server(),
|
server => mongo_server(),
|
||||||
|
w_mode => <<"unsafe">>,
|
||||||
|
|
||||||
selector => #{<<"username">> => <<"${username}">>},
|
selector => #{<<"username">> => <<"${username}">>},
|
||||||
password_hash_field => <<"password_hash">>,
|
password_hash_field => <<"password_hash">>,
|
||||||
|
|
|
@ -73,6 +73,7 @@ set_special_configs(_App) ->
|
||||||
<<"enable">> => true,
|
<<"enable">> => true,
|
||||||
<<"mongo_type">> => <<"single">>,
|
<<"mongo_type">> => <<"single">>,
|
||||||
<<"server">> => <<"127.0.0.1:27017">>,
|
<<"server">> => <<"127.0.0.1:27017">>,
|
||||||
|
<<"w_mode">> => <<"unsafe">>,
|
||||||
<<"pool_size">> => 1,
|
<<"pool_size">> => 1,
|
||||||
<<"database">> => <<"mqtt">>,
|
<<"database">> => <<"mqtt">>,
|
||||||
<<"ssl">> => #{<<"enable">> => false},
|
<<"ssl">> => #{<<"enable">> => false},
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
<<"enable">> => true,
|
<<"enable">> => true,
|
||||||
<<"mongo_type">> => <<"single">>,
|
<<"mongo_type">> => <<"single">>,
|
||||||
<<"server">> => <<?MONGO_SINGLE_HOST>>,
|
<<"server">> => <<?MONGO_SINGLE_HOST>>,
|
||||||
|
<<"w_mode">> => <<"unsafe">>,
|
||||||
<<"pool_size">> => 1,
|
<<"pool_size">> => 1,
|
||||||
<<"database">> => <<"mqtt">>,
|
<<"database">> => <<"mqtt">>,
|
||||||
<<"ssl">> => #{<<"enable">> => false},
|
<<"ssl">> => #{<<"enable">> => false},
|
||||||
|
|
Loading…
Reference in New Issue