From eee18699816dd926fa9bdb00432fc4a3488737a6 Mon Sep 17 00:00:00 2001 From: ieQu1 <99872536+ieQu1@users.noreply.github.com> Date: Tue, 13 Sep 2022 19:06:53 +0200 Subject: [PATCH] fix(prometheus): Disable auth for prometheus endpoint --- CHANGES-4.3.md | 1 + lib-ce/emqx_dashboard/src/emqx_dashboard.erl | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGES-4.3.md b/CHANGES-4.3.md index c6a6e9465..247e15dd7 100644 --- a/CHANGES-4.3.md +++ b/CHANGES-4.3.md @@ -26,6 +26,7 @@ File format: should return false if match it to a topic. - 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) +- Disable authorization for `api/v4/emqx_prometheus` endpoint. [8955](https://github.com/emqx/emqx/pull/8955) ## v4.3.19 diff --git a/lib-ce/emqx_dashboard/src/emqx_dashboard.erl b/lib-ce/emqx_dashboard/src/emqx_dashboard.erl index d88bd0da9..517211607 100644 --- a/lib-ce/emqx_dashboard/src/emqx_dashboard.erl +++ b/lib-ce/emqx_dashboard/src/emqx_dashboard.erl @@ -109,6 +109,8 @@ http_handlers() -> is_authorized(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) -> true; is_authorized(_Path, Req) ->