From d10cc1978a2ffc48fc4bf51b4834ae27b11142fe Mon Sep 17 00:00:00 2001 From: Abdul Raheem Siddiqui Date: Tue, 16 Jan 2024 10:27:18 -0500 Subject: [PATCH] Remove auth from GET jobs when auth_level is 1 --- api/handlers/handlers.go | 2 +- api/main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/handlers/handlers.go b/api/handlers/handlers.go index fff9d25..313f193 100644 --- a/api/handlers/handlers.go +++ b/api/handlers/handlers.go @@ -568,7 +568,7 @@ func (rh *RESTHandler) ListJobsHandler(c echo.Context) error { } } - if rh.Config.AuthLevel > 0 { + if rh.Config.AuthLevel > 1 { // changed for hotfix, should be > 0 when clients are updated roles := strings.Split(c.Request().Header.Get("X-ProcessAPI-User-Roles"), ",") if !utils.StringInSlice(rh.Config.AdminRoleName, roles) { diff --git a/api/main.go b/api/main.go index 000bf9e..b9beede 100644 --- a/api/main.go +++ b/api/main.go @@ -300,7 +300,7 @@ func main() { // pg.Delete("processes/:processID", rh.RegisterNewProcess) // Jobs - pg.GET("/jobs", rh.ListJobsHandler) + e.GET("/jobs", rh.ListJobsHandler) // changed for hotfix, should be pg.GET when clients are updated e.GET("/jobs/:jobID", rh.JobStatusHandler) e.GET("/jobs/:jobID/results", rh.JobResultsHandler) e.GET("/jobs/:jobID/logs", rh.JobLogsHandler)