As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Commit 747000de authored by Igor Drozdov's avatar Igor Drozdov
Browse files

Merge branch 'sh-log-ssh-key-details' into 'master'

Log SSH key details

See merge request gitlab-org/gitlab-shell!398
parents b8b75477 6555cb81
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -54,4 +54,6 @@ func TestReceivePack(t *testing.T) {
require.Contains(t, entries[1].Message, "executing git command")
require.Contains(t, entries[1].Message, "command=git-receive-pack")
require.Contains(t, entries[1].Message, "remote_ip=127.0.0.1")
require.Contains(t, entries[1].Message, "gl_key_type=key")
require.Contains(t, entries[1].Message, "gl_key_id=123")
}
Loading
Loading
@@ -49,4 +49,6 @@ func TestUploadPack(t *testing.T) {
require.Equal(t, logrus.InfoLevel, entries[1].Level)
require.Contains(t, entries[1].Message, "executing git command")
require.Contains(t, entries[1].Message, "command=git-upload-archive")
require.Contains(t, entries[1].Message, "gl_key_type=key")
require.Contains(t, entries[1].Message, "gl_key_id=123")
}
Loading
Loading
@@ -45,6 +45,8 @@ func TestUploadPack(t *testing.T) {
assert.Equal(t, 2, len(entries))
require.Contains(t, entries[1].Message, "executing git command")
require.Contains(t, entries[1].Message, "command=git-upload-pack")
require.Contains(t, entries[1].Message, "gl_key_type=key")
require.Contains(t, entries[1].Message, "gl_key_id=123")
for k, v := range map[string]string{
"gitaly-feature-cache_invalidator": "true",
Loading
Loading
Loading
Loading
@@ -55,6 +55,8 @@ type Response struct {
Message string `json:"message"`
Repo string `json:"gl_repository"`
UserId string `json:"gl_id"`
KeyType string `json:"gl_key_type"`
KeyId int `json:"gl_key_id"`
Username string `json:"gl_username"`
GitConfigOptions []string `json:"git_config_options"`
Gitaly Gitaly `json:"gitaly"`
Loading
Loading
Loading
Loading
@@ -66,6 +66,8 @@ func (gc *GitalyCommand) LogExecution(repository *pb.Repository, response *acces
"username": response.Username,
"git_protocol": protocol,
"remote_ip": sshenv.LocalAddr(),
"gl_key_type": response.KeyType,
"gl_key_id": response.KeyId,
}
log.WithFields(fields).Info("executing git command")
Loading
Loading
Loading
Loading
@@ -34,8 +34,10 @@ func BuildAllowedWithGitalyHandlers(t *testing.T, gitalyAddress string) []testse
Path: "/api/v4/internal/allowed",
Handler: func(w http.ResponseWriter, r *http.Request) {
body := map[string]interface{}{
"status": true,
"gl_id": "1",
"status": true,
"gl_id": "1",
"gl_key_type": "key",
"gl_key_id": 123,
"gitaly": map[string]interface{}{
"repository": map[string]interface{}{
"storage_name": "storage_name",
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment