chore(authz): mongo connector support ssl
This commit is contained in:
parent
45ee504dc5
commit
fd0a211629
|
@ -8,11 +8,16 @@ services:
|
||||||
environment:
|
environment:
|
||||||
MONGO_INITDB_DATABASE: mqtt
|
MONGO_INITDB_DATABASE: mqtt
|
||||||
volumes:
|
volumes:
|
||||||
- ../../apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/mongodb.pem/:/etc/certs/mongodb.pem
|
- ../../apps/emqx/etc/certs/cert.pem:/etc/certs/cert.pem
|
||||||
|
- ../../apps/emqx/etc/certs/key.pem:/etc/certs/key.pem
|
||||||
networks:
|
networks:
|
||||||
- emqx_bridge
|
- emqx_bridge
|
||||||
|
ports:
|
||||||
|
- "27017:27017"
|
||||||
command:
|
command:
|
||||||
--ipv6
|
- /bin/bash
|
||||||
--bind_ip_all
|
- -c
|
||||||
--sslMode requireSSL
|
- |
|
||||||
--sslPEMKeyFile /etc/certs/mongodb.pem
|
cat /etc/certs/key.pem /etc/certs/cert.pem > /etc/certs/mongodb.pem
|
||||||
|
mongod --ipv6 --bind_ip_all --sslMode requireSSL --sslPEMKeyFile /etc/certs/mongodb.pem
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,7 @@ rules() ->
|
||||||
[ hoconsc:ref(?MODULE, simple_rule)
|
[ hoconsc:ref(?MODULE, simple_rule)
|
||||||
, hoconsc:ref(?MODULE, sql_connector)
|
, hoconsc:ref(?MODULE, sql_connector)
|
||||||
, hoconsc:ref(?MODULE, redis_connector)
|
, hoconsc:ref(?MODULE, redis_connector)
|
||||||
|
, hoconsc:ref(?MODULE, mongo_connector)
|
||||||
])
|
])
|
||||||
}.
|
}.
|
||||||
|
|
||||||
|
|
|
@ -36,10 +36,28 @@
|
||||||
structs() -> [""].
|
structs() -> [""].
|
||||||
|
|
||||||
fields("") ->
|
fields("") ->
|
||||||
mongodb_fields() ++
|
[ {mongo_type, fun mongo_type/1}
|
||||||
mongodb_topology_fields() ++
|
, {servers, fun servers/1}
|
||||||
|
, {pool_size, fun emqx_connector_schema_lib:pool_size/1}
|
||||||
|
, {login, fun emqx_connector_schema_lib:username/1}
|
||||||
|
, {password, fun emqx_connector_schema_lib:password/1}
|
||||||
|
, {auth_source, fun auth_source/1}
|
||||||
|
, {database, fun emqx_connector_schema_lib:database/1}
|
||||||
|
] ++
|
||||||
% mongodb_rs_set_name_fields() ++
|
% mongodb_rs_set_name_fields() ++
|
||||||
emqx_connector_schema_lib:ssl_fields().
|
emqx_connector_schema_lib:ssl_fields();
|
||||||
|
fields(topology) ->
|
||||||
|
[ {max_overflow, fun emqx_connector_schema_lib:pool_size/1}
|
||||||
|
, {overflow_ttl, fun duration/1}
|
||||||
|
, {overflow_check_period, fun duration/1}
|
||||||
|
, {local_threshold_ms, fun duration/1}
|
||||||
|
, {connect_timeout_ms, fun duration/1}
|
||||||
|
, {socket_timeout_ms, fun duration/1}
|
||||||
|
, {server_selection_timeout_ms, fun duration/1}
|
||||||
|
, {wait_queue_timeout_ms, fun duration/1}
|
||||||
|
, {heartbeat_frequency_ms, fun duration/1}
|
||||||
|
, {min_heartbeat_frequency_ms, fun duration/1}
|
||||||
|
].
|
||||||
|
|
||||||
on_jsonify(Config) ->
|
on_jsonify(Config) ->
|
||||||
Config.
|
Config.
|
||||||
|
@ -178,29 +196,6 @@ host_port(HostPort) ->
|
||||||
[{host, Host1}]
|
[{host, Host1}]
|
||||||
end.
|
end.
|
||||||
|
|
||||||
mongodb_fields() ->
|
|
||||||
[ {mongo_type, fun mongo_type/1}
|
|
||||||
, {servers, fun servers/1}
|
|
||||||
, {pool_size, fun emqx_connector_schema_lib:pool_size/1}
|
|
||||||
, {login, fun emqx_connector_schema_lib:username/1}
|
|
||||||
, {password, fun emqx_connector_schema_lib:password/1}
|
|
||||||
, {auth_source, fun auth_source/1}
|
|
||||||
, {database, fun emqx_connector_schema_lib:database/1}
|
|
||||||
].
|
|
||||||
|
|
||||||
mongodb_topology_fields() ->
|
|
||||||
[ {max_overflow, fun emqx_connector_schema_lib:pool_size/1}
|
|
||||||
, {overflow_ttl, fun duration/1}
|
|
||||||
, {overflow_check_period, fun duration/1}
|
|
||||||
, {local_threshold_ms, fun duration/1}
|
|
||||||
, {connect_timeout_ms, fun duration/1}
|
|
||||||
, {socket_timeout_ms, fun duration/1}
|
|
||||||
, {server_selection_timeout_ms, fun duration/1}
|
|
||||||
, {wait_queue_timeout_ms, fun duration/1}
|
|
||||||
, {heartbeat_frequency_ms, fun duration/1}
|
|
||||||
, {min_heartbeat_frequency_ms, fun duration/1}
|
|
||||||
].
|
|
||||||
|
|
||||||
% mongodb_rs_set_name_fields() ->
|
% mongodb_rs_set_name_fields() ->
|
||||||
% [ {rs_set_name, fun emqx_connector_schema_lib:database/1}
|
% [ {rs_set_name, fun emqx_connector_schema_lib:database/1}
|
||||||
% ].
|
% ].
|
||||||
|
|
Loading…
Reference in New Issue