fix: Revert "refactor: return `204` instead of `200` for `PUT /authenticator/:id`"
This reverts commit 3bda905e92
.
This commit is contained in:
parent
546addccc5
commit
0be5c8e84b
|
@ -1006,10 +1006,11 @@ update_authenticator(ConfKeyPath, ChainName, AuthenticatorID, Config) ->
|
||||||
)
|
)
|
||||||
of
|
of
|
||||||
{ok, #{
|
{ok, #{
|
||||||
post_config_update := #{emqx_authentication := #{id := _ID}},
|
post_config_update := #{emqx_authentication := #{id := ID}},
|
||||||
raw_config := _AuthenticatorsConfig
|
raw_config := AuthenticatorsConfig
|
||||||
}} ->
|
}} ->
|
||||||
{204};
|
{ok, AuthenticatorConfig} = find_config(ID, AuthenticatorsConfig),
|
||||||
|
{200, maps:put(id, ID, convert_certs(fill_defaults(AuthenticatorConfig)))};
|
||||||
{error, {_PrePostConfigUpdate, emqx_authentication, Reason}} ->
|
{error, {_PrePostConfigUpdate, emqx_authentication, Reason}} ->
|
||||||
serialize_error(Reason);
|
serialize_error(Reason);
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
-include("emqx_authn.hrl").
|
-include("emqx_authn.hrl").
|
||||||
-include_lib("eunit/include/eunit.hrl").
|
-include_lib("eunit/include/eunit.hrl").
|
||||||
|
-include_lib("common_test/include/ct.hrl").
|
||||||
|
|
||||||
-define(TCP_DEFAULT, 'tcp:default').
|
-define(TCP_DEFAULT, 'tcp:default').
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@ groups() ->
|
||||||
init_per_testcase(t_authenticator_fail, Config) ->
|
init_per_testcase(t_authenticator_fail, Config) ->
|
||||||
meck:expect(emqx_authn_proto_v1, lookup_from_all_nodes, 3, [{error, {exception, badarg}}]),
|
meck:expect(emqx_authn_proto_v1, lookup_from_all_nodes, 3, [{error, {exception, badarg}}]),
|
||||||
init_per_testcase(default, Config);
|
init_per_testcase(default, Config);
|
||||||
init_per_testcase(_Case, Config) ->
|
init_per_testcase(_, Config) ->
|
||||||
{ok, _} = emqx_cluster_rpc:start_link(node(), emqx_cluster_rpc, 1000),
|
{ok, _} = emqx_cluster_rpc:start_link(node(), emqx_cluster_rpc, 1000),
|
||||||
emqx_authn_test_lib:delete_authenticators(
|
emqx_authn_test_lib:delete_authenticators(
|
||||||
[?CONF_NS_ATOM],
|
[?CONF_NS_ATOM],
|
||||||
|
@ -212,7 +213,7 @@ test_authenticators(PathPrefix) ->
|
||||||
method => <<"get">>,
|
method => <<"get">>,
|
||||||
headers => #{<<"content-type">> => <<"application/json">>}
|
headers => #{<<"content-type">> => <<"application/json">>}
|
||||||
},
|
},
|
||||||
{ok, 204, _} = request(
|
{ok, 200, _} = request(
|
||||||
put,
|
put,
|
||||||
uri(PathPrefix ++ [?CONF_NS, "password_based:http"]),
|
uri(PathPrefix ++ [?CONF_NS, "password_based:http"]),
|
||||||
ValidConfig1
|
ValidConfig1
|
||||||
|
@ -301,14 +302,14 @@ test_authenticator(PathPrefix) ->
|
||||||
method => <<"get">>,
|
method => <<"get">>,
|
||||||
headers => #{<<"content-type">> => <<"application/json">>}
|
headers => #{<<"content-type">> => <<"application/json">>}
|
||||||
},
|
},
|
||||||
{ok, 204, _} = request(
|
{ok, 200, _} = request(
|
||||||
put,
|
put,
|
||||||
uri(PathPrefix ++ [?CONF_NS, "password_based:http"]),
|
uri(PathPrefix ++ [?CONF_NS, "password_based:http"]),
|
||||||
ValidConfig1
|
ValidConfig1
|
||||||
),
|
),
|
||||||
|
|
||||||
ValidConfig2 = ValidConfig0#{pool_size => 9},
|
ValidConfig2 = ValidConfig0#{pool_size => 9},
|
||||||
{ok, 204, _} = request(
|
{ok, 200, _} = request(
|
||||||
put,
|
put,
|
||||||
uri(PathPrefix ++ [?CONF_NS, "password_based:http"]),
|
uri(PathPrefix ++ [?CONF_NS, "password_based:http"]),
|
||||||
ValidConfig2
|
ValidConfig2
|
||||||
|
|
|
@ -448,7 +448,7 @@ t_jwt_not_allow_empty_claim_name(_) ->
|
||||||
),
|
),
|
||||||
|
|
||||||
?assertMatch(
|
?assertMatch(
|
||||||
{204},
|
{200, _},
|
||||||
emqx_authn_api:authenticator(
|
emqx_authn_api:authenticator(
|
||||||
put, #{
|
put, #{
|
||||||
bindings => #{id => <<"jwt">>},
|
bindings => #{id => <<"jwt">>},
|
||||||
|
|
|
@ -14,8 +14,6 @@
|
||||||
- Refactor authn API by replacing `POST /authentication/{id}/move` with `PUT /authentication/{id}/position/{position}`. [#9419](https://github.com/emqx/emqx/pull/9419).
|
- Refactor authn API by replacing `POST /authentication/{id}/move` with `PUT /authentication/{id}/position/{position}`. [#9419](https://github.com/emqx/emqx/pull/9419).
|
||||||
Same is done for `/listeners/{listener_id}/authentication/id/...`.
|
Same is done for `/listeners/{listener_id}/authentication/id/...`.
|
||||||
|
|
||||||
- Return `204` instead of `200` for `PUT /authenticator/:id` [#9434](https://github.com/emqx/emqx/pull/9434/).
|
|
||||||
|
|
||||||
## Bug fixes
|
## Bug fixes
|
||||||
|
|
||||||
- Fix that the obsolete SSL files aren't deleted after the ExHook config update [#9432](https://github.com/emqx/emqx/pull/9432).
|
- Fix that the obsolete SSL files aren't deleted after the ExHook config update [#9432](https://github.com/emqx/emqx/pull/9432).
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
|
|
||||||
- 通过 `node.global_gc_interval = disabled` 来禁用全局垃圾回收 [#9418](https://github.com/emqx/emqx/pull/9418)。
|
- 通过 `node.global_gc_interval = disabled` 来禁用全局垃圾回收 [#9418](https://github.com/emqx/emqx/pull/9418)。
|
||||||
|
|
||||||
- 现在,`PUT /authenticator/:id` 将会返回 204 而不再是 200 [#9434](https://github.com/emqx/emqx/pull/9434/)。
|
|
||||||
|
|
||||||
- 优化命令行实现, 避免输入错误指令时, 产生不必要的原子表消耗 [#9416](https://github.com/emqx/emqx/pull/9416)。
|
- 优化命令行实现, 避免输入错误指令时, 产生不必要的原子表消耗 [#9416](https://github.com/emqx/emqx/pull/9416)。
|
||||||
|
|
||||||
- 支持在 Apple Silicon 架构下编译苹果系统的发行版本 [#9423](https://github.com/emqx/emqx/pull/9423)。
|
- 支持在 Apple Silicon 架构下编译苹果系统的发行版本 [#9423](https://github.com/emqx/emqx/pull/9423)。
|
||||||
|
|
Loading…
Reference in New Issue