feat(iotdb): accept wrapped secrets as passwords
This commit is contained in:
parent
7817502b8b
commit
7d6c9d2daa
|
@ -356,9 +356,10 @@ parse_confs(<<"iotdb">>, Name, Conf) ->
|
||||||
authentication :=
|
authentication :=
|
||||||
#{
|
#{
|
||||||
username := Username,
|
username := Username,
|
||||||
password := Password
|
password := Secret
|
||||||
}
|
}
|
||||||
} = Conf,
|
} = Conf,
|
||||||
|
Password = emqx_secret:unwrap(Secret),
|
||||||
BasicToken = base64:encode(<<Username/binary, ":", Password/binary>>),
|
BasicToken = base64:encode(<<Username/binary, ":", Password/binary>>),
|
||||||
%% This version atom correspond to the macro ?VSN_1_1_X in
|
%% This version atom correspond to the macro ?VSN_1_1_X in
|
||||||
%% emqx_bridge_iotdb.hrl. It would be better to use the macro directly, but
|
%% emqx_bridge_iotdb.hrl. It would be better to use the macro directly, but
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%% -*- mode: erlang -*-
|
%% -*- mode: erlang -*-
|
||||||
{application, emqx_bridge_iotdb, [
|
{application, emqx_bridge_iotdb, [
|
||||||
{description, "EMQX Enterprise Apache IoTDB Bridge"},
|
{description, "EMQX Enterprise Apache IoTDB Bridge"},
|
||||||
{vsn, "0.1.3"},
|
{vsn, "0.1.4"},
|
||||||
{modules, [
|
{modules, [
|
||||||
emqx_bridge_iotdb,
|
emqx_bridge_iotdb,
|
||||||
emqx_bridge_iotdb_impl
|
emqx_bridge_iotdb_impl
|
||||||
|
|
|
@ -51,12 +51,9 @@ fields(auth_basic) ->
|
||||||
[
|
[
|
||||||
{username, mk(binary(), #{required => true, desc => ?DESC("config_auth_basic_username")})},
|
{username, mk(binary(), #{required => true, desc => ?DESC("config_auth_basic_username")})},
|
||||||
{password,
|
{password,
|
||||||
mk(binary(), #{
|
emqx_schema_secret:mk(#{
|
||||||
required => true,
|
required => true,
|
||||||
desc => ?DESC("config_auth_basic_password"),
|
desc => ?DESC("config_auth_basic_password")
|
||||||
format => <<"password">>,
|
|
||||||
sensitive => true,
|
|
||||||
converter => fun emqx_schema:password_converter/2
|
|
||||||
})}
|
})}
|
||||||
].
|
].
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue