diff options
author | Lucas Charles <me@lucascharles.me> | 2021-02-17 13:49:46 -0800 |
---|---|---|
committer | Lucas Charles <me@lucascharles.me> | 2021-03-15 13:47:11 -0700 |
commit | d539068dc372e46d10adee89e9b96b59156a2bb6 (patch) | |
tree | 9c37f5ade4a95622b30a7a47befcb46b185b9682 /internal/gitlabnet/accessverifier/client.go | |
parent | e79f115d93a9f00f3e4f8a22ec770fdf4c3e1947 (diff) | |
download | gitlab-shell-d539068dc372e46d10adee89e9b96b59156a2bb6.tar.gz |
chore: Refactor env introspection to rely on command initialization496-move-env-introspection-to-sshenv
Refactors introspection of execution environment to rely on
per-connection state (`gitlab-shell`) or per request (`gitlab-sshd`)
Relates to https://gitlab.com/gitlab-org/gitlab-shell/-/issues/496
Diffstat (limited to 'internal/gitlabnet/accessverifier/client.go')
-rw-r--r-- | internal/gitlabnet/accessverifier/client.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/internal/gitlabnet/accessverifier/client.go b/internal/gitlabnet/accessverifier/client.go index 4a33d5b..9389257 100644 --- a/internal/gitlabnet/accessverifier/client.go +++ b/internal/gitlabnet/accessverifier/client.go @@ -10,7 +10,6 @@ import ( "gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs" "gitlab.com/gitlab-org/gitlab-shell/internal/config" "gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet" - "gitlab.com/gitlab-org/gitlab-shell/internal/sshenv" ) const ( @@ -87,11 +86,7 @@ func (c *Client) Verify(ctx context.Context, args *commandargs.Shell, action com request.KeyId = args.GitlabKeyId } - if args.RemoteAddr != nil { - request.CheckIp = args.RemoteAddr.IP.String() - } else { - request.CheckIp = sshenv.LocalAddr() - } + request.CheckIp = args.Env.RemoteAddr response, err := c.client.Post(ctx, "/allowed", request) if err != nil { |