diff --git a/cmd/omegaup-gitserver/auth.go b/cmd/omegaup-gitserver/auth.go index 987b16a..c10a64b 100644 --- a/cmd/omegaup-gitserver/auth.go +++ b/cmd/omegaup-gitserver/auth.go @@ -304,7 +304,7 @@ func (a *omegaupAuthorization) authorize( } requestContext := request.FromContext(ctx) - if username == "omegaup:system" { + if username == "omegaup:system" || *insecureSkipAuthorization { // This is the frontend, and we trust it completely. requestContext.IsAdmin = true requestContext.CanView = true diff --git a/cmd/omegaup-gitserver/main.go b/cmd/omegaup-gitserver/main.go index 4b2465f..60f1508 100644 --- a/cmd/omegaup-gitserver/main.go +++ b/cmd/omegaup-gitserver/main.go @@ -27,6 +27,11 @@ var ( "/etc/omegaup/gitserver/config.json", "gitserver configuration file", ) + insecureSkipAuthorization = flag.Bool( + "insecure-skip-authorization", + false, + "grant all privileges to all users", + ) version = flag.Bool("version", false, "Print the version and exit") log log15.Logger