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

fix: don't merge gateway's authn

Zhongwen Deng пре 3 година
родитељ
комит
6cd123e6fc
1 измењених фајлова са 4 додато и 5 уклоњено
  1. 4 5
      apps/emqx_gateway/src/emqx_gateway_conf.erl

+ 4 - 5
apps/emqx_gateway/src/emqx_gateway_conf.erl

@@ -503,9 +503,8 @@ pre_config_update(_, {update_authn, GwName, Conf}, RawConf) ->
     of
         undefined ->
             badres_authn(not_found, GwName);
-        Authn ->
-            NAuthn = maps:merge(Authn, Conf),
-            {ok, emqx_map_lib:deep_put([GwName, ?AUTHN_BIN], RawConf, NAuthn)}
+        _Authn ->
+            {ok, emqx_map_lib:deep_put([GwName, ?AUTHN_BIN], RawConf, Conf)}
     end;
 pre_config_update(_, {update_authn, GwName, {LType, LName}, Conf}, RawConf) ->
     case
@@ -521,10 +520,10 @@ pre_config_update(_, {update_authn, GwName, {LType, LName}, Conf}, RawConf) ->
             case maps:get(?AUTHN_BIN, Listener, undefined) of
                 undefined ->
                     badres_listener_authn(not_found, GwName, LType, LName);
-                Auth ->
+                _Auth ->
                     NListener = maps:put(
                         ?AUTHN_BIN,
-                        maps:merge(Auth, Conf),
+                        Conf,
                         Listener
                     ),
                     {ok,