Skip to content

Commit

Permalink
Merge pull request #87 from Dewberry/hotfix/get-jobs
Browse files Browse the repository at this point in the history
Remove auth from GET jobs when auth_level is 1
  • Loading branch information
ar-siddiqui authored Jan 16, 2024
2 parents 1787292 + d10cc19 commit 09b181f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 09b181f

Please sign in to comment.