Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2020-11-06 12:13:22 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2020-11-06 12:37:27 +0300
commita15efb05bcd8b8d8d7e7aa8f4b4936093bd952ea (patch)
treeb7cbb09746d0ee19da9ba3bcbe0ecc5b8aa10f3f /internal/gitaly/service/operations/merge.go
parent18d45ceae79eac82623ef69bf2367fa1bb398390 (diff)
operations: Always set GL_PROTOCOL in hooks
When updating references via `updateReferenceWithHooks`, then we need to assemble the envvars to post to the service. But one envvar actually got lost in the conversion from Ruby to Go, which is the `GL_PROTOCOL` variable. Not setting this variable may cause GitLab to misinterpret a change's source and thus fail to correctly apply access control rules. Add the missing variable. As the function will only ever be called from other RPCs in the OperationsService, its safe to assume that it'll always we "web".
Diffstat (limited to 'internal/gitaly/service/operations/merge.go')
-rw-r--r--internal/gitaly/service/operations/merge.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/gitaly/service/operations/merge.go b/internal/gitaly/service/operations/merge.go
index 6d2f2b3e5..9b432a2ed 100644
--- a/internal/gitaly/service/operations/merge.go
+++ b/internal/gitaly/service/operations/merge.go
@@ -117,6 +117,7 @@ func (s *server) updateReferenceWithHooks(ctx context.Context, repo *gitalypb.Re
}
env := append([]string{
+ "GL_PROTOCOL=web",
fmt.Sprintf("GL_ID=%s", user.GetGlId()),
fmt.Sprintf("GL_USERNAME=%s", user.GetGlUsername()),
fmt.Sprintf("GL_REPOSITORY=%s", repo.GetGlRepository()),