Преглед изворни кода

feat(iotdb): accept wrapped secrets as passwords

Andrew Mayorov пре 2 година
родитељ
комит
7d6c9d2daa

+ 2 - 1
apps/emqx_bridge/src/emqx_bridge_resource.erl

@@ -356,9 +356,10 @@ parse_confs(<<"iotdb">>, Name, Conf) ->
         authentication :=
             #{
                 username := Username,
-                password := Password
+                password := Secret
             }
     } = Conf,
+    Password = emqx_secret:unwrap(Secret),
     BasicToken = base64:encode(<<Username/binary, ":", Password/binary>>),
     %% 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

+ 1 - 1
apps/emqx_bridge_iotdb/src/emqx_bridge_iotdb.app.src

@@ -1,7 +1,7 @@
 %% -*- mode: erlang -*-
 {application, emqx_bridge_iotdb, [
     {description, "EMQX Enterprise Apache IoTDB Bridge"},
-    {vsn, "0.1.3"},
+    {vsn, "0.1.4"},
     {modules, [
         emqx_bridge_iotdb,
         emqx_bridge_iotdb_impl

+ 2 - 5
apps/emqx_bridge_iotdb/src/emqx_bridge_iotdb.erl

@@ -51,12 +51,9 @@ fields(auth_basic) ->
     [
         {username, mk(binary(), #{required => true, desc => ?DESC("config_auth_basic_username")})},
         {password,
-            mk(binary(), #{
+            emqx_schema_secret:mk(#{
                 required => true,
-                desc => ?DESC("config_auth_basic_password"),
-                format => <<"password">>,
-                sensitive => true,
-                converter => fun emqx_schema:password_converter/2
+                desc => ?DESC("config_auth_basic_password")
             })}
     ].