fix(prometheus): Disable auth for prometheus endpoint

This commit is contained in:
ieQu1 2022-09-13 19:06:53 +02:00
parent 9a184642cf
commit eee1869981
2 changed files with 3 additions and 0 deletions

View File

@ -26,6 +26,7 @@ File format:
should return false if match it to a topic. should return false if match it to a topic.
- Added a test to prevent a last will testament message to be - Added a test to prevent a last will testament message to be
published when a client is denied connection. [#8894](https://github.com/emqx/emqx/pull/8894) published when a client is denied connection. [#8894](https://github.com/emqx/emqx/pull/8894)
- Disable authorization for `api/v4/emqx_prometheus` endpoint. [8955](https://github.com/emqx/emqx/pull/8955)
## v4.3.19 ## v4.3.19

View File

@ -109,6 +109,8 @@ http_handlers() ->
is_authorized(Req) -> is_authorized(Req) ->
is_authorized(binary_to_list(cowboy_req:path(Req)), Req). is_authorized(binary_to_list(cowboy_req:path(Req)), Req).
is_authorized("/api/v4/emqx_prometheus", _Req) ->
true;
is_authorized("/api/v4/auth", _Req) -> is_authorized("/api/v4/auth", _Req) ->
true; true;
is_authorized(_Path, Req) -> is_authorized(_Path, Req) ->