Merge pull request #8224 from zhongwencool/gateway-authn-mismatch
fix: don't merge gateway's authn
This commit is contained in:
commit
604f0d9511
|
@ -50,7 +50,7 @@ init_per_testcase(Case, Config) when
|
||||||
Listeners -> emqx_config:put([listeners], maps:remove(quic, Listeners))
|
Listeners -> emqx_config:put([listeners], maps:remove(quic, Listeners))
|
||||||
end,
|
end,
|
||||||
|
|
||||||
PrevListeners = emqx_config:get([listeners]),
|
PrevListeners = emqx_config:get([listeners], #{}),
|
||||||
PureListeners = remove_default_limiter(PrevListeners),
|
PureListeners = remove_default_limiter(PrevListeners),
|
||||||
PureListeners2 = PureListeners#{
|
PureListeners2 = PureListeners#{
|
||||||
tcp => #{
|
tcp => #{
|
||||||
|
@ -72,7 +72,7 @@ init_per_testcase(t_wss_conn, Config) ->
|
||||||
catch emqx_config_handler:stop(),
|
catch emqx_config_handler:stop(),
|
||||||
{ok, _} = emqx_config_handler:start_link(),
|
{ok, _} = emqx_config_handler:start_link(),
|
||||||
|
|
||||||
PrevListeners = emqx_config:get([listeners]),
|
PrevListeners = emqx_config:get([listeners], #{}),
|
||||||
PureListeners = remove_default_limiter(PrevListeners),
|
PureListeners = remove_default_limiter(PrevListeners),
|
||||||
PureListeners2 = PureListeners#{
|
PureListeners2 = PureListeners#{
|
||||||
wss => #{
|
wss => #{
|
||||||
|
@ -97,7 +97,7 @@ init_per_testcase(t_wss_conn, Config) ->
|
||||||
init_per_testcase(_, Config) ->
|
init_per_testcase(_, Config) ->
|
||||||
catch emqx_config_handler:stop(),
|
catch emqx_config_handler:stop(),
|
||||||
{ok, _} = emqx_config_handler:start_link(),
|
{ok, _} = emqx_config_handler:start_link(),
|
||||||
PrevListeners = emqx_config:get([listeners]),
|
PrevListeners = emqx_config:get([listeners], #{}),
|
||||||
PureListeners = remove_default_limiter(PrevListeners),
|
PureListeners = remove_default_limiter(PrevListeners),
|
||||||
emqx_config:put([listeners], PureListeners),
|
emqx_config:put([listeners], PureListeners),
|
||||||
[
|
[
|
||||||
|
|
|
@ -503,9 +503,8 @@ pre_config_update(_, {update_authn, GwName, Conf}, RawConf) ->
|
||||||
of
|
of
|
||||||
undefined ->
|
undefined ->
|
||||||
badres_authn(not_found, GwName);
|
badres_authn(not_found, GwName);
|
||||||
Authn ->
|
_Authn ->
|
||||||
NAuthn = maps:merge(Authn, Conf),
|
{ok, emqx_map_lib:deep_put([GwName, ?AUTHN_BIN], RawConf, Conf)}
|
||||||
{ok, emqx_map_lib:deep_put([GwName, ?AUTHN_BIN], RawConf, NAuthn)}
|
|
||||||
end;
|
end;
|
||||||
pre_config_update(_, {update_authn, GwName, {LType, LName}, Conf}, RawConf) ->
|
pre_config_update(_, {update_authn, GwName, {LType, LName}, Conf}, RawConf) ->
|
||||||
case
|
case
|
||||||
|
@ -521,10 +520,10 @@ pre_config_update(_, {update_authn, GwName, {LType, LName}, Conf}, RawConf) ->
|
||||||
case maps:get(?AUTHN_BIN, Listener, undefined) of
|
case maps:get(?AUTHN_BIN, Listener, undefined) of
|
||||||
undefined ->
|
undefined ->
|
||||||
badres_listener_authn(not_found, GwName, LType, LName);
|
badres_listener_authn(not_found, GwName, LType, LName);
|
||||||
Auth ->
|
_Auth ->
|
||||||
NListener = maps:put(
|
NListener = maps:put(
|
||||||
?AUTHN_BIN,
|
?AUTHN_BIN,
|
||||||
maps:merge(Auth, Conf),
|
Conf,
|
||||||
Listener
|
Listener
|
||||||
),
|
),
|
||||||
{ok,
|
{ok,
|
||||||
|
|
Loading…
Reference in New Issue