fix(bridge): remove clientid config from MQTT bridges
Don't allow the user provide the clientid for connecting the remote broker. We generate the clientid using the bridge id and node name.
This commit is contained in:
parent
bff41296aa
commit
ea1aaa9806
|
@ -431,8 +431,8 @@ rpc_multicall(Func, Args) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
filter_out_request_body(Conf) ->
|
filter_out_request_body(Conf) ->
|
||||||
ExtraConfs = [<<"id">>, <<"status">>, <<"node_status">>, <<"node_metrics">>,
|
ExtraConfs = [<<"id">>, <<"status">>, <<"node_status">>,
|
||||||
<<"metrics">>, <<"node">>],
|
<<"node_metrics">>, <<"metrics">>, <<"node">>],
|
||||||
maps:without(ExtraConfs, Conf).
|
maps:without(ExtraConfs, Conf).
|
||||||
|
|
||||||
rpc_call(Node, Fun, Args) ->
|
rpc_call(Node, Fun, Args) ->
|
||||||
|
|
|
@ -218,7 +218,7 @@ schema("/connectors/:id") ->
|
||||||
{400, error_msg('ALREADY_EXISTS', <<"connector already exists">>)};
|
{400, error_msg('ALREADY_EXISTS', <<"connector already exists">>)};
|
||||||
{error, not_found} ->
|
{error, not_found} ->
|
||||||
case emqx_connector:update(ConnType, ConnName,
|
case emqx_connector:update(ConnType, ConnName,
|
||||||
maps:without([<<"type">>, <<"name">>], Params)) of
|
filter_out_request_body(Params)) of
|
||||||
{ok, #{raw_config := RawConf}} ->
|
{ok, #{raw_config := RawConf}} ->
|
||||||
Id = emqx_connector:connector_id(ConnType, ConnName),
|
Id = emqx_connector:connector_id(ConnType, ConnName),
|
||||||
{201, format_resp(Id, RawConf)};
|
{201, format_resp(Id, RawConf)};
|
||||||
|
@ -279,7 +279,7 @@ format_resp(ConnId, RawConf) ->
|
||||||
}.
|
}.
|
||||||
|
|
||||||
filter_out_request_body(Conf) ->
|
filter_out_request_body(Conf) ->
|
||||||
ExtraConfs = [<<"num_of_bridges">>, <<"type">>, <<"name">>],
|
ExtraConfs = [<<"clientid">>, <<"num_of_bridges">>, <<"type">>, <<"name">>],
|
||||||
maps:without(ExtraConfs, Conf).
|
maps:without(ExtraConfs, Conf).
|
||||||
|
|
||||||
bin(S) when is_list(S) ->
|
bin(S) when is_list(S) ->
|
||||||
|
|
|
@ -39,7 +39,7 @@ fields("config") ->
|
||||||
|
|
||||||
fields("connector") ->
|
fields("connector") ->
|
||||||
[ {mode,
|
[ {mode,
|
||||||
sc(hoconsc:enum([cluster_singleton, cluster_shareload]),
|
sc(hoconsc:enum([cluster_shareload]),
|
||||||
#{ default => cluster_shareload
|
#{ default => cluster_shareload
|
||||||
, desc => """
|
, desc => """
|
||||||
The mode of the MQTT Bridge. Can be one of 'cluster_singleton' or 'cluster_shareload'<br>
|
The mode of the MQTT Bridge. Can be one of 'cluster_singleton' or 'cluster_shareload'<br>
|
||||||
|
@ -76,10 +76,6 @@ topic filters for 'remote_topic' of ingress connections.
|
||||||
#{ default => "emqx"
|
#{ default => "emqx"
|
||||||
, desc => "The password of the MQTT protocol"
|
, desc => "The password of the MQTT protocol"
|
||||||
})}
|
})}
|
||||||
, {clientid,
|
|
||||||
sc(binary(),
|
|
||||||
#{ desc => "The clientid of the MQTT protocol"
|
|
||||||
})}
|
|
||||||
, {clean_start,
|
, {clean_start,
|
||||||
sc(boolean(),
|
sc(boolean(),
|
||||||
#{ default => true
|
#{ default => true
|
||||||
|
|
Loading…
Reference in New Issue