summaryrefslogtreecommitdiff
path: root/internal/gitlabnet/accessverifier/client.go
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2020-07-31 12:58:42 +0000
committerIgor Drozdov <idrozdov@gitlab.com>2020-07-31 12:58:42 +0000
commit87402ed127d9855b8123e5e08a4c89d373cc79e8 (patch)
tree6a28feda2a62ec88e889593d7fbf3ae950659e35 /internal/gitlabnet/accessverifier/client.go
parent701ebca0b5d4a8451afe677c3bdb19cc92a5a2f0 (diff)
downloadgitlab-shell-87402ed127d9855b8123e5e08a4c89d373cc79e8.tar.gz
Generate and log correlation IDs
This will make it easier to tie an SSH access request to Rails API and Gitaly requests.
Diffstat (limited to 'internal/gitlabnet/accessverifier/client.go')
-rw-r--r--internal/gitlabnet/accessverifier/client.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/gitlabnet/accessverifier/client.go b/internal/gitlabnet/accessverifier/client.go
index 234e854..00b9d76 100644
--- a/internal/gitlabnet/accessverifier/client.go
+++ b/internal/gitlabnet/accessverifier/client.go
@@ -65,6 +65,7 @@ type Response struct {
ConsoleMessages []string `json:"gl_console_messages"`
Who string
StatusCode int
+ CorrelationID string
}
func NewClient(config *config.Config) (*Client, error) {
@@ -109,6 +110,8 @@ func parse(hr *http.Response, args *commandargs.Shell) (*Response, error) {
}
response.StatusCode = hr.StatusCode
+ // We expect the same correlation ID that we sent
+ response.CorrelationID = hr.Header.Get("X-Request-Id")
return response, nil
}