Rory Z 4 лет назад
Родитель
Сommit
f733293a8b

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

@@ -1,6 +1,6 @@
 {application, emqx_authz,
  [{description, "An OTP application"},
-  {vsn, "0.1.0"},
+  {vsn, "0.1.1"},
   {registered, []},
   {mod, {emqx_authz_app, []}},
   {applications,

+ 1 - 2
apps/emqx_authz/src/emqx_authz_mongo.erl

@@ -50,8 +50,7 @@ authorize(Client, PubSub, Topic,
 do_authorize(_Client, _PubSub, _Topic, []) ->
     nomatch;
 do_authorize(Client, PubSub, Topic, [Rule | Tail]) ->
-    case match(Client, PubSub, Topic, Rule)
-    of
+    case match(Client, PubSub, Topic, Rule) of
         {matched, Permission} -> {matched, Permission};
         nomatch -> do_authorize(Client, PubSub, Topic, Tail)
     end.

+ 5 - 8
apps/emqx_authz/test/emqx_authz_mysql_SUITE.erl

@@ -47,9 +47,9 @@ set_special_configs(emqx) ->
                         emqx_ct_helpers:deps_path(emqx, "test/loaded_plguins")),
     ok;
 set_special_configs(emqx_authz) ->
-    Rules = [#{config =>#{<<"meck">> => <<"fake">>},
+    Rules = [#{config =>#{},
                principal => all,
-               sql => <<"fake sql">>,
+               sql => <<"fake">>,
                type => mysql}
             ],
     emqx_config:put([emqx_authz], #{rules => Rules}),
@@ -76,18 +76,15 @@ set_special_configs(_App) ->
 t_authz(_) ->
     ClientInfo1 = #{clientid => <<"test">>,
                     username => <<"test">>,
-                    peerhost => {127,0,0,1},
-                    zone => zone
+                    peerhost => {127,0,0,1}
                    },
     ClientInfo2 = #{clientid => <<"test_clientid">>,
                     username => <<"test_username">>,
-                    peerhost => {192,168,0,10},
-                    zone => zone
+                    peerhost => {192,168,0,10}
                    },
     ClientInfo3 = #{clientid => <<"test_clientid">>,
                     username => <<"fake_username">>,
-                    peerhost => {127,0,0,1},
-                    zone => zone
+                    peerhost => {127,0,0,1}
                    },
 
     meck:expect(emqx_resource, query, fun(_, _) -> {ok, ?COLUMNS, []} end),

+ 5 - 8
apps/emqx_authz/test/emqx_authz_pgsql_SUITE.erl

@@ -47,9 +47,9 @@ set_special_configs(emqx) ->
                         emqx_ct_helpers:deps_path(emqx, "test/loaded_plguins")),
     ok;
 set_special_configs(emqx_authz) ->
-    Rules = [#{config =>#{<<"meck">> => <<"fake">>},
+    Rules = [#{config =>#{},
                principal => all,
-               sql => <<"fake sql">>,
+               sql => <<"fake">>,
                type => pgsql}
             ],
     emqx_config:put([emqx_authz], #{rules => Rules}),
@@ -76,18 +76,15 @@ set_special_configs(_App) ->
 t_authz(_) ->
     ClientInfo1 = #{clientid => <<"test">>,
                     username => <<"test">>,
-                    peerhost => {127,0,0,1},
-                    zone => zone
+                    peerhost => {127,0,0,1}
                    },
     ClientInfo2 = #{clientid => <<"test_clientid">>,
                     username => <<"test_username">>,
-                    peerhost => {192,168,0,10},
-                    zone => zone
+                    peerhost => {192,168,0,10}
                    },
     ClientInfo3 = #{clientid => <<"test_clientid">>,
                     username => <<"fake_username">>,
-                    peerhost => {127,0,0,1},
-                    zone => zone
+                    peerhost => {127,0,0,1}
                    },
 
     meck:expect(emqx_resource, query, fun(_, _) -> {ok, ?COLUMNS, []} end),

+ 3 - 4
apps/emqx_authz/test/emqx_authz_redis_SUITE.erl

@@ -47,9 +47,9 @@ set_special_configs(emqx) ->
                         emqx_ct_helpers:deps_path(emqx, "test/loaded_plguins")),
     ok;
 set_special_configs(emqx_authz) ->
-    Rules = [#{config =>#{<<"meck">> => <<"fake">>},
+    Rules = [#{config =>#{},
                principal => all,
-               cmd => <<"fake cmd">>,
+               cmd => <<"fake">>,
                type => redis}
             ],
     emqx_config:put([emqx_authz], #{rules => Rules}),
@@ -68,8 +68,7 @@ set_special_configs(_App) ->
 t_authz(_) ->
     ClientInfo = #{clientid => <<"clientid">>,
                    username => <<"username">>,
-                   peerhost => {127,0,0,1},
-                   zone => zone
+                   peerhost => {127,0,0,1}
                    },
 
     meck:expect(emqx_resource, query, fun(_, _) -> {ok, []} end),

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

@@ -1,6 +1,6 @@
 {application, emqx_connector,
  [{description, "An OTP application"},
-  {vsn, "0.1.0"},
+  {vsn, "0.1.1"},
   {registered, []},
   {mod, {emqx_connector_app, []}},
   {applications,