summaryrefslogtreecommitdiff
path: root/go/internal/gitlabnet/accessverifier/client.go
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-10-08 11:08:01 +0000
committerNick Thomas <nick@gitlab.com>2019-10-08 11:08:01 +0000
commit9ba79e43395cf09e3c5904c541a011ea25b620f1 (patch)
tree77a047170356f252407b872a4b84bb8338868565 /go/internal/gitlabnet/accessverifier/client.go
parenta29b48ed8e36677c42acde1756e84982b580bc58 (diff)
parent4190843952861b9db7cc786a140be3aeb7632cbc (diff)
downloadgitlab-shell-9ba79e43395cf09e3c5904c541a011ea25b620f1.tar.gz
Merge branch 'add-ip-address-to-call-to-rails-api' into 'master'
Extend group IP restriction to Git activity See merge request gitlab-org/gitlab-shell!335
Diffstat (limited to 'go/internal/gitlabnet/accessverifier/client.go')
-rw-r--r--go/internal/gitlabnet/accessverifier/client.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/go/internal/gitlabnet/accessverifier/client.go b/go/internal/gitlabnet/accessverifier/client.go
index 92a7434..880fff5 100644
--- a/go/internal/gitlabnet/accessverifier/client.go
+++ b/go/internal/gitlabnet/accessverifier/client.go
@@ -8,6 +8,7 @@ import (
"gitlab.com/gitlab-org/gitlab-shell/go/internal/command/commandargs"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/gitlabnet"
+ "gitlab.com/gitlab-org/gitlab-shell/go/internal/sshenv"
)
const (
@@ -26,6 +27,7 @@ type Request struct {
Protocol string `json:"protocol"`
KeyId string `json:"key_id,omitempty"`
Username string `json:"username,omitempty"`
+ CheckIp string `json:"check_ip,omitempty"`
}
type Gitaly struct {
@@ -80,6 +82,8 @@ func (c *Client) Verify(args *commandargs.Shell, action commandargs.CommandType,
request.KeyId = args.GitlabKeyId
}
+ request.CheckIp = sshenv.LocalAddr()
+
response, err := c.client.Post("/allowed", request)
if err != nil {
return nil, err