summaryrefslogtreecommitdiff
path: root/go/internal/gitlabnet/accessverifier/client.go
diff options
context:
space:
mode:
authorMałgorzata Ksionek <mksionek@gitlab.com>2019-10-03 11:10:39 +0200
committerMałgorzata Ksionek <mksionek@gitlab.com>2019-10-03 11:10:39 +0200
commitf00c577dec60798f10b6e8809d78a2895cfa6b04 (patch)
treef532b9e68bf773d28650b63a4bf9d6c9498555ed /go/internal/gitlabnet/accessverifier/client.go
parenteff3b3c0e48e9ffc213108965f16e96f10bcda3e (diff)
downloadgitlab-shell-f00c577dec60798f10b6e8809d78a2895cfa6b04.tar.gz
Introduce changes from code review
Diffstat (limited to 'go/internal/gitlabnet/accessverifier/client.go')
-rw-r--r--go/internal/gitlabnet/accessverifier/client.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/go/internal/gitlabnet/accessverifier/client.go b/go/internal/gitlabnet/accessverifier/client.go
index f0dea7d..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,7 +82,9 @@ func (c *Client) Verify(args *commandargs.Shell, action commandargs.CommandType,
request.KeyId = args.GitlabKeyId
}
- response, err := c.client.Post("/allowed/secure", request)
+ request.CheckIp = sshenv.LocalAddr()
+
+ response, err := c.client.Post("/allowed", request)
if err != nil {
return nil, err
}