From bcef6ec0ee8683c05ae2f4244b9137c23e6307a9 Mon Sep 17 00:00:00 2001 From: lhchavez Date: Sun, 18 Sep 2022 16:30:43 -0700 Subject: [PATCH] Fix the `-insecure-skip-authorization` permissions (#41) This should grant system, not grader, permissions. --- cmd/omegaup-gitserver/auth.go | 2 +- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cmd/omegaup-gitserver/auth.go b/cmd/omegaup-gitserver/auth.go index 454c5c2..5bfa078 100644 --- a/cmd/omegaup-gitserver/auth.go +++ b/cmd/omegaup-gitserver/auth.go @@ -391,7 +391,7 @@ func (a *omegaupAuthorization) authorize( requestContext.Request.CanView = true requestContext.Request.CanEdit = true requestContext.Request.CanViewAllRefs = true - } else if username == "omegaup:grader" || *insecureSkipAuthorization { + } else if username == "omegaup:grader" { // This is the grader, it has read-only privileges for all problems. requestContext.Request.CanView = true requestContext.Request.CanViewAllRefs = true diff --git a/go.mod b/go.mod index 48e84fb..ccc4e7d 100644 --- a/go.mod +++ b/go.mod @@ -9,11 +9,11 @@ require ( github.com/mattn/go-sqlite3 v1.14.8 github.com/newrelic/go-agent/v3 v3.15.2 github.com/o1egl/paseto v1.0.0 - github.com/omegaup/githttp/v2 v2.4.13 - github.com/omegaup/go-base/logging/log15/v3 v3.3.6 - github.com/omegaup/go-base/tracing/newrelic/v3 v3.3.6 - github.com/omegaup/go-base/v3 v3.3.6 - github.com/omegaup/quark v1.9.33 + github.com/omegaup/githttp/v2 v2.4.14 + github.com/omegaup/go-base/logging/log15/v3 v3.3.7 + github.com/omegaup/go-base/tracing/newrelic/v3 v3.3.7 + github.com/omegaup/go-base/v3 v3.3.7 + github.com/omegaup/quark v1.9.35 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.8.0 github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca diff --git a/go.sum b/go.sum index e9d8c78..806fe5a 100644 --- a/go.sum +++ b/go.sum @@ -232,18 +232,18 @@ github.com/o1egl/paseto v1.0.0/go.mod h1:5HxsZPmw/3RI2pAwGo1HhOOwSdvBpcuVzO7uDkm github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/omegaup/githttp/v2 v2.4.13 h1:KGiSet8Xvy6yAo2UaoXKRD6BBAyRryheYva8E25aky8= -github.com/omegaup/githttp/v2 v2.4.13/go.mod h1:CS+l7OI46d3JAnPEzqg6dJ5dYbIDuIxxb/mHDXNNFTQ= +github.com/omegaup/githttp/v2 v2.4.14 h1:el+B1egtRrVMgCdZD1KDIS/7WiMf7RkFCRdTbS+IEPc= +github.com/omegaup/githttp/v2 v2.4.14/go.mod h1:AT/HZamMpw0BdKFuN4PyWDIvysi0yIAkB9jQyOjJWhQ= github.com/omegaup/go-base/logging/log15 v0.0.0-20211215145412-f1de9d5c6aee h1:pTkTShwDP49l9AAOXGCiyKb7kfwORzs1U4x4ocDCycU= github.com/omegaup/go-base/logging/log15 v0.0.0-20211215145412-f1de9d5c6aee/go.mod h1:CdmQRQaKuNhQU7HwaLgalgAUeXwnEoCEhhXN7Ipcyvw= -github.com/omegaup/go-base/logging/log15/v3 v3.3.6 h1:smpRGjp923p+kf9tN+769ikOGY4DeriVJLX+u9o8hts= -github.com/omegaup/go-base/logging/log15/v3 v3.3.6/go.mod h1:1CpXEwIp/z14h5lOR7+O1KKM2EMjUwIA0/kyB4LtYkk= -github.com/omegaup/go-base/tracing/newrelic/v3 v3.3.6 h1:wQ4hdc+H2wH2whIvn2/DDhhmQzFFGkTVHbIh9xUoSHM= -github.com/omegaup/go-base/tracing/newrelic/v3 v3.3.6/go.mod h1:k8vryoCY2vbnSuC/lkuXQCts6o+0PxSvSS15f0dXoEw= -github.com/omegaup/go-base/v3 v3.3.6 h1:3FybK1RM4rFPQQpMIFbO/cz3/EA9TWhOuzLhoxvG2w4= -github.com/omegaup/go-base/v3 v3.3.6/go.mod h1:+N7tcCbx3AUEEwmUpsAzJktPCviwL57M8BTJ5m8GX9w= -github.com/omegaup/quark v1.9.33 h1:w7RUdUjc0vUhmN0+c6sXiCXSv3fRShVSpKBpr3vIToU= -github.com/omegaup/quark v1.9.33/go.mod h1:kcOkBMBTHgz3/M3vxIAmpuD78Sbg6rLyB7Hui8CPGc8= +github.com/omegaup/go-base/logging/log15/v3 v3.3.7 h1:5CrQc6AWNApSV2YHrn8moZq3cF2E6e0tXXoC95BtNG4= +github.com/omegaup/go-base/logging/log15/v3 v3.3.7/go.mod h1:1CpXEwIp/z14h5lOR7+O1KKM2EMjUwIA0/kyB4LtYkk= +github.com/omegaup/go-base/tracing/newrelic/v3 v3.3.7 h1:xXdR5vs3cVbZI4nn71yfNrvma5V2pnr3Yp43iYbCBEU= +github.com/omegaup/go-base/tracing/newrelic/v3 v3.3.7/go.mod h1:k8vryoCY2vbnSuC/lkuXQCts6o+0PxSvSS15f0dXoEw= +github.com/omegaup/go-base/v3 v3.3.7 h1:qq2pyfTzBsnzXZeYekJJe3HdEJgUMGlxmSwne0FPWEk= +github.com/omegaup/go-base/v3 v3.3.7/go.mod h1:+N7tcCbx3AUEEwmUpsAzJktPCviwL57M8BTJ5m8GX9w= +github.com/omegaup/quark v1.9.35 h1:4gOLnszxyNEpS0wc1e/QXfNL+cVF0j/usGTH/Pfo4QU= +github.com/omegaup/quark v1.9.35/go.mod h1:aZDm9GA2SX02LUnEJAWAFmPr6y6kalXlOd0crbLZPKk= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=