|
|
@@ -137,7 +137,7 @@ create(Type, Name, Conf0, Opts) ->
|
|
|
msg => "create connector",
|
|
|
type => Type,
|
|
|
name => Name,
|
|
|
- config => emqx_utils:redact(Conf0)
|
|
|
+ config => redact(Conf0, Type)
|
|
|
}),
|
|
|
TypeBin = bin(Type),
|
|
|
ResourceId = resource_id(Type, Name),
|
|
|
@@ -174,7 +174,7 @@ update(Type, Name, {OldConf, Conf}, Opts) ->
|
|
|
msg => "update connector",
|
|
|
type => Type,
|
|
|
name => Name,
|
|
|
- config => emqx_utils:redact(Conf)
|
|
|
+ config => redact(Conf, Type)
|
|
|
}),
|
|
|
case recreate(Type, Name, Conf, Opts) of
|
|
|
{ok, _} ->
|
|
|
@@ -184,7 +184,7 @@ update(Type, Name, {OldConf, Conf}, Opts) ->
|
|
|
msg => "updating_a_non_existing_connector",
|
|
|
type => Type,
|
|
|
name => Name,
|
|
|
- config => emqx_utils:redact(Conf)
|
|
|
+ config => redact(Conf, Type)
|
|
|
}),
|
|
|
create(Type, Name, Conf, Opts);
|
|
|
{error, Reason} ->
|
|
|
@@ -378,3 +378,13 @@ override_start_after_created(Config, Opts) ->
|
|
|
|
|
|
set_no_buffer_workers(Opts) ->
|
|
|
Opts#{spawn_buffer_workers => false}.
|
|
|
+
|
|
|
+%% TODO: introduce a formal callback?
|
|
|
+redact(Conf, Type) when
|
|
|
+ Type =:= http;
|
|
|
+ Type =:= <<"http">>
|
|
|
+->
|
|
|
+ %% CE bridge
|
|
|
+ emqx_utils:redact(Conf, fun emqx_bridge_http_connector:is_sensitive_key/1);
|
|
|
+redact(Conf, _Type) ->
|
|
|
+ emqx_utils:redact(Conf).
|