From 7b537dc0fefcfa0aa13629ee33c84769c9a3973b Mon Sep 17 00:00:00 2001 From: mpw Date: Wed, 23 Aug 2023 11:59:36 -0300 Subject: [PATCH 1/2] custom unauthorized error based on failed relation checks --- charts/hub-gateway/plugins/authz.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/charts/hub-gateway/plugins/authz.lua b/charts/hub-gateway/plugins/authz.lua index 8cf140f..a93864c 100644 --- a/charts/hub-gateway/plugins/authz.lua +++ b/charts/hub-gateway/plugins/authz.lua @@ -122,13 +122,14 @@ function _M.access(conf, ctx) end local req_id = core.request.header(ctx, "X-Request-Id") - local reason = json.encode({ + local invalid = table.concat(result.invalid, ", ") + local response = json.encode({ code = status_code, - message = "Unauthorized", + message = "Unauthorized. Unable to access " .. invalid, request_id = req_id }) - return status_code, reason + return status_code, response end end From 7afa99c52a7ea0c75eb50900a642e6548d2e33f7 Mon Sep 17 00:00:00 2001 From: mpw Date: Wed, 23 Aug 2023 12:04:04 -0300 Subject: [PATCH 2/2] bump chart version --- charts/hub-gateway/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/hub-gateway/Chart.yaml b/charts/hub-gateway/Chart.yaml index 37b9b5f..d1dba3c 100644 --- a/charts/hub-gateway/Chart.yaml +++ b/charts/hub-gateway/Chart.yaml @@ -18,7 +18,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.23.6 +version: 0.23.7 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to