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 cb01327a authored by Nick Thomas's avatar Nick Thomas
Browse files

Merge branch 'jc-refactor-gitlabnet-client' into 'master'

Move gitlabnet client to client package

Closes #451

See merge request gitlab-org/gitlab-shell!377
parents f62a4b2f 91f45342
No related branches found
No related tags found
No related merge requests found
Showing
with 325 additions and 76 deletions
package gitlabnet
package client
import (
"encoding/base64"
Loading
Loading
@@ -11,12 +11,9 @@ import (
"testing"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver"
"gitlab.com/gitlab-org/gitlab-shell/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/testhelper"
)
Loading
Loading
@@ -74,24 +71,20 @@ func TestClients(t *testing.T) {
testCases := []struct {
desc string
config *config.Config
caFile string
server func(*testing.T, []testserver.TestRequestHandler) (string, func())
}{
{
desc: "Socket client",
config: &config.Config{},
server: testserver.StartSocketHttpServer,
},
{
desc: "Http client",
config: &config.Config{},
server: testserver.StartHttpServer,
},
{
desc: "Https client",
config: &config.Config{
HttpSettings: config.HttpSettingsConfig{CaFile: path.Join(testhelper.TestRoot, "certs/valid/server.crt")},
},
desc: "Https client",
caFile: path.Join(testhelper.TestRoot, "certs/valid/server.crt"),
server: testserver.StartHttpsServer,
},
}
Loading
Loading
@@ -101,10 +94,11 @@ func TestClients(t *testing.T) {
url, cleanup := tc.server(t, requests)
defer cleanup()
tc.config.GitlabUrl = url
tc.config.Secret = "sssh, it's a secret"
secret := "sssh, it's a secret"
httpClient := NewHTTPClient(url, tc.caFile, "", false, 1)
client, err := GetClient(tc.config)
client, err := NewGitlabNetClient("", "", secret, httpClient)
require.NoError(t, err)
testBrokenRequest(t, client)
Loading
Loading
@@ -117,7 +111,7 @@ func TestClients(t *testing.T) {
}
}
func testSuccessfulGet(t *testing.T, client *GitlabClient) {
func testSuccessfulGet(t *testing.T, client *GitlabNetClient) {
t.Run("Successful get", func(t *testing.T) {
hook := testhelper.SetupLogger()
response, err := client.Get("/hello")
Loading
Loading
@@ -137,7 +131,7 @@ func testSuccessfulGet(t *testing.T, client *GitlabClient) {
})
}
func testSuccessfulPost(t *testing.T, client *GitlabClient) {
func testSuccessfulPost(t *testing.T, client *GitlabNetClient) {
t.Run("Successful Post", func(t *testing.T) {
hook := testhelper.SetupLogger()
data := map[string]string{"key": "value"}
Loading
Loading
@@ -159,7 +153,7 @@ func testSuccessfulPost(t *testing.T, client *GitlabClient) {
})
}
func testMissing(t *testing.T, client *GitlabClient) {
func testMissing(t *testing.T, client *GitlabNetClient) {
t.Run("Missing error for GET", func(t *testing.T) {
hook := testhelper.SetupLogger()
response, err := client.Get("/missing")
Loading
Loading
@@ -185,7 +179,7 @@ func testMissing(t *testing.T, client *GitlabClient) {
})
}
func testErrorMessage(t *testing.T, client *GitlabClient) {
func testErrorMessage(t *testing.T, client *GitlabNetClient) {
t.Run("Error with message for GET", func(t *testing.T) {
response, err := client.Get("/error")
assert.EqualError(t, err, "Don't do that")
Loading
Loading
@@ -199,7 +193,7 @@ func testErrorMessage(t *testing.T, client *GitlabClient) {
})
}
func testBrokenRequest(t *testing.T, client *GitlabClient) {
func testBrokenRequest(t *testing.T, client *GitlabNetClient) {
t.Run("Broken request for GET", func(t *testing.T) {
response, err := client.Get("/broken")
assert.EqualError(t, err, "Internal API unreachable")
Loading
Loading
@@ -213,7 +207,7 @@ func testBrokenRequest(t *testing.T, client *GitlabClient) {
})
}
func testAuthenticationHeader(t *testing.T, client *GitlabClient) {
func testAuthenticationHeader(t *testing.T, client *GitlabNetClient) {
t.Run("Authentication headers for GET", func(t *testing.T) {
response, err := client.Get("/auth")
require.NoError(t, err)
Loading
Loading
package client
import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"net/http"
"strings"
"time"
log "github.com/sirupsen/logrus"
)
const (
internalApiPath = "/api/v4/internal"
secretHeaderName = "Gitlab-Shared-Secret"
)
type ErrorResponse struct {
Message string `json:"message"`
}
type GitlabNetClient struct {
httpClient *HttpClient
user, password, secret string
}
func NewGitlabNetClient(
user,
password,
secret string,
httpClient *HttpClient,
) (*GitlabNetClient, error) {
if httpClient == nil {
return nil, fmt.Errorf("Unsupported protocol")
}
return &GitlabNetClient{
httpClient: httpClient,
user: user,
password: password,
secret: secret,
}, nil
}
func normalizePath(path string) string {
if !strings.HasPrefix(path, "/") {
path = "/" + path
}
if !strings.HasPrefix(path, internalApiPath) {
path = internalApiPath + path
}
return path
}
func newRequest(method, host, path string, data interface{}) (*http.Request, error) {
var jsonReader io.Reader
if data != nil {
jsonData, err := json.Marshal(data)
if err != nil {
return nil, err
}
jsonReader = bytes.NewReader(jsonData)
}
request, err := http.NewRequest(method, host+path, jsonReader)
if err != nil {
return nil, err
}
return request, nil
}
func parseError(resp *http.Response) error {
if resp.StatusCode >= 200 && resp.StatusCode <= 399 {
return nil
}
defer resp.Body.Close()
parsedResponse := &ErrorResponse{}
if err := json.NewDecoder(resp.Body).Decode(parsedResponse); err != nil {
return fmt.Errorf("Internal API error (%v)", resp.StatusCode)
} else {
return fmt.Errorf(parsedResponse.Message)
}
}
func (c *GitlabNetClient) Get(path string) (*http.Response, error) {
return c.DoRequest(http.MethodGet, normalizePath(path), nil)
}
func (c *GitlabNetClient) Post(path string, data interface{}) (*http.Response, error) {
return c.DoRequest(http.MethodPost, normalizePath(path), data)
}
func (c *GitlabNetClient) DoRequest(method, path string, data interface{}) (*http.Response, error) {
request, err := newRequest(method, c.httpClient.Host, path, data)
if err != nil {
return nil, err
}
user, password := c.user, c.password
if user != "" && password != "" {
request.SetBasicAuth(user, password)
}
encodedSecret := base64.StdEncoding.EncodeToString([]byte(c.secret))
request.Header.Set(secretHeaderName, encodedSecret)
request.Header.Add("Content-Type", "application/json")
request.Close = true
start := time.Now()
response, err := c.httpClient.Do(request)
fields := log.Fields{
"method": method,
"url": request.URL.String(),
"duration_ms": time.Since(start) / time.Millisecond,
}
if err != nil {
log.WithError(err).WithFields(fields).Error("Internal API unreachable")
return nil, fmt.Errorf("Internal API unreachable")
}
if err := parseError(response); err != nil {
log.WithError(err).WithFields(fields).Error("Internal API error")
return nil, err
}
log.WithFields(fields).Info("Finished HTTP request")
return response, nil
}
package config
package client
import (
"context"
Loading
Loading
@@ -21,41 +21,36 @@ const (
)
type HttpClient struct {
HttpClient *http.Client
Host string
*http.Client
Host string
}
func (c *Config) GetHttpClient() *HttpClient {
if c.HttpClient != nil {
return c.HttpClient
}
func NewHTTPClient(gitlabURL, caFile, caPath string, selfSignedCert bool, readTimeoutSeconds uint64) *HttpClient {
var transport *http.Transport
var host string
if strings.HasPrefix(c.GitlabUrl, unixSocketProtocol) {
transport, host = c.buildSocketTransport()
} else if strings.HasPrefix(c.GitlabUrl, httpProtocol) {
transport, host = c.buildHttpTransport()
} else if strings.HasPrefix(c.GitlabUrl, httpsProtocol) {
transport, host = c.buildHttpsTransport()
if strings.HasPrefix(gitlabURL, unixSocketProtocol) {
transport, host = buildSocketTransport(gitlabURL)
} else if strings.HasPrefix(gitlabURL, httpProtocol) {
transport, host = buildHttpTransport(gitlabURL)
} else if strings.HasPrefix(gitlabURL, httpsProtocol) {
transport, host = buildHttpsTransport(caFile, caPath, selfSignedCert, gitlabURL)
} else {
return nil
}
httpClient := &http.Client{
c := &http.Client{
Transport: transport,
Timeout: c.readTimeout(),
Timeout: readTimeout(readTimeoutSeconds),
}
client := &HttpClient{HttpClient: httpClient, Host: host}
c.HttpClient = client
client := &HttpClient{Client: c, Host: host}
return client
}
func (c *Config) buildSocketTransport() (*http.Transport, string) {
socketPath := strings.TrimPrefix(c.GitlabUrl, unixSocketProtocol)
func buildSocketTransport(gitlabURL string) (*http.Transport, string) {
socketPath := strings.TrimPrefix(gitlabURL, unixSocketProtocol)
transport := &http.Transport{
DialContext: func(ctx context.Context, _, _ string) (net.Conn, error) {
dialer := net.Dialer{}
Loading
Loading
@@ -66,19 +61,17 @@ func (c *Config) buildSocketTransport() (*http.Transport, string) {
return transport, socketBaseUrl
}
func (c *Config) buildHttpsTransport() (*http.Transport, string) {
func buildHttpsTransport(caFile, caPath string, selfSignedCert bool, gitlabURL string) (*http.Transport, string) {
certPool, err := x509.SystemCertPool()
if err != nil {
certPool = x509.NewCertPool()
}
caFile := c.HttpSettings.CaFile
if caFile != "" {
addCertToPool(certPool, caFile)
}
caPath := c.HttpSettings.CaPath
if caPath != "" {
fis, _ := ioutil.ReadDir(caPath)
for _, fi := range fis {
Loading
Loading
@@ -93,11 +86,11 @@ func (c *Config) buildHttpsTransport() (*http.Transport, string) {
transport := &http.Transport{
TLSClientConfig: &tls.Config{
RootCAs: certPool,
InsecureSkipVerify: c.HttpSettings.SelfSignedCert,
InsecureSkipVerify: selfSignedCert,
},
}
return transport, c.GitlabUrl
return transport, gitlabURL
}
func addCertToPool(certPool *x509.CertPool, fileName string) {
Loading
Loading
@@ -107,13 +100,11 @@ func addCertToPool(certPool *x509.CertPool, fileName string) {
}
}
func (c *Config) buildHttpTransport() (*http.Transport, string) {
return &http.Transport{}, c.GitlabUrl
func buildHttpTransport(gitlabURL string) (*http.Transport, string) {
return &http.Transport{}, gitlabURL
}
func (c *Config) readTimeout() time.Duration {
timeoutSeconds := c.HttpSettings.ReadTimeoutSeconds
func readTimeout(timeoutSeconds uint64) time.Duration {
if timeoutSeconds == 0 {
timeoutSeconds = defaultReadTimeoutSeconds
}
Loading
Loading
package gitlabnet
package client
import (
"encoding/base64"
Loading
Loading
@@ -7,13 +7,22 @@ import (
"net/http"
"strings"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver"
"gitlab.com/gitlab-org/gitlab-shell/client/testserver"
)
func TestReadTimeout(t *testing.T) {
expectedSeconds := uint64(300)
client := NewHTTPClient("http://localhost:3000", "", "", false, expectedSeconds)
require.NotNil(t, client)
assert.Equal(t, time.Duration(expectedSeconds)*time.Second, client.Client.Timeout)
}
const (
username = "basic_auth_user"
password = "basic_auth_password"
Loading
Loading
@@ -38,9 +47,8 @@ func TestBasicAuthSettings(t *testing.T) {
},
},
}
config := &config.Config{HttpSettings: config.HttpSettingsConfig{User: username, Password: password}}
client, cleanup := setup(t, config, requests)
client, cleanup := setup(t, username, password, requests)
defer cleanup()
response, err := client.Get("/get_endpoint")
Loading
Loading
@@ -78,18 +86,19 @@ func TestEmptyBasicAuthSettings(t *testing.T) {
},
}
client, cleanup := setup(t, &config.Config{}, requests)
client, cleanup := setup(t, "", "", requests)
defer cleanup()
_, err := client.Get("/empty_basic_auth")
require.NoError(t, err)
}
func setup(t *testing.T, config *config.Config, requests []testserver.TestRequestHandler) (*GitlabClient, func()) {
func setup(t *testing.T, username, password string, requests []testserver.TestRequestHandler) (*GitlabNetClient, func()) {
url, cleanup := testserver.StartHttpServer(t, requests)
config.GitlabUrl = url
client, err := GetClient(config)
httpClient := NewHTTPClient(url, "", "", false, 1)
client, err := NewGitlabNetClient(username, password, "", httpClient)
require.NoError(t, err)
return client, cleanup
Loading
Loading
package gitlabnet
package client
import (
"fmt"
Loading
Loading
@@ -9,45 +9,38 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver"
"gitlab.com/gitlab-org/gitlab-shell/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/testhelper"
)
func TestSuccessfulRequests(t *testing.T) {
testCases := []struct {
desc string
config *config.Config
desc string
caFile, caPath string
selfSigned bool
}{
{
desc: "Valid CaFile",
config: &config.Config{
HttpSettings: config.HttpSettingsConfig{CaFile: path.Join(testhelper.TestRoot, "certs/valid/server.crt")},
},
desc: "Valid CaFile",
caFile: path.Join(testhelper.TestRoot, "certs/valid/server.crt"),
},
{
desc: "Valid CaPath",
config: &config.Config{
HttpSettings: config.HttpSettingsConfig{CaPath: path.Join(testhelper.TestRoot, "certs/valid")},
},
desc: "Valid CaPath",
caPath: path.Join(testhelper.TestRoot, "certs/valid"),
},
{
desc: "Self signed cert option enabled",
config: &config.Config{
HttpSettings: config.HttpSettingsConfig{SelfSignedCert: true},
},
desc: "Self signed cert option enabled",
selfSigned: true,
},
{
desc: "Invalid cert with self signed cert option enabled",
config: &config.Config{
HttpSettings: config.HttpSettingsConfig{SelfSignedCert: true, CaFile: path.Join(testhelper.TestRoot, "certs/valid/server.crt")},
},
desc: "Invalid cert with self signed cert option enabled",
caFile: path.Join(testhelper.TestRoot, "certs/valid/server.crt"),
selfSigned: true,
},
}
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
client, cleanup := setupWithRequests(t, tc.config)
client, cleanup := setupWithRequests(t, tc.caFile, tc.caPath, tc.selfSigned)
defer cleanup()
response, err := client.Get("/hello")
Loading
Loading
@@ -66,29 +59,25 @@ func TestSuccessfulRequests(t *testing.T) {
func TestFailedRequests(t *testing.T) {
testCases := []struct {
desc string
config *config.Config
caFile string
caPath string
}{
{
desc: "Invalid CaFile",
config: &config.Config{
HttpSettings: config.HttpSettingsConfig{CaFile: path.Join(testhelper.TestRoot, "certs/invalid/server.crt")},
},
desc: "Invalid CaFile",
caFile: path.Join(testhelper.TestRoot, "certs/invalid/server.crt"),
},
{
desc: "Invalid CaPath",
config: &config.Config{
HttpSettings: config.HttpSettingsConfig{CaPath: path.Join(testhelper.TestRoot, "certs/invalid")},
},
desc: "Invalid CaPath",
caPath: path.Join(testhelper.TestRoot, "certs/invalid"),
},
{
desc: "Empty config",
config: &config.Config{},
desc: "Empty config",
},
}
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
client, cleanup := setupWithRequests(t, tc.config)
client, cleanup := setupWithRequests(t, tc.caFile, tc.caPath, false)
defer cleanup()
_, err := client.Get("/hello")
Loading
Loading
@@ -99,7 +88,7 @@ func TestFailedRequests(t *testing.T) {
}
}
func setupWithRequests(t *testing.T, config *config.Config) (*GitlabClient, func()) {
func setupWithRequests(t *testing.T, caFile, caPath string, selfSigned bool) (*GitlabNetClient, func()) {
testDirCleanup, err := testhelper.PrepareTestRootDir()
require.NoError(t, err)
defer testDirCleanup()
Loading
Loading
@@ -117,8 +106,9 @@ func setupWithRequests(t *testing.T, config *config.Config) (*GitlabClient, func
url, cleanup := testserver.StartHttpsServer(t, requests)
config.GitlabUrl = url
client, err := GetClient(config)
httpClient := NewHTTPClient(url, caFile, caPath, selfSigned, 1)
client, err := NewGitlabNetClient("", "", "", httpClient)
require.NoError(t, err)
return client, cleanup
Loading
Loading
Loading
Loading
@@ -9,10 +9,9 @@ import (
"testing"
"github.com/stretchr/testify/require"
pb "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
pb "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
)
type TestGitalyServer struct{ ReceivedMD metadata.MD }
Loading
Loading
Loading
Loading
@@ -13,7 +13,6 @@ import (
"testing"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/internal/testhelper"
)
Loading
Loading
Loading
Loading
@@ -8,10 +8,10 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver"
)
var (
Loading
Loading
Loading
Loading
@@ -9,10 +9,10 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver"
)
var (
Loading
Loading
Loading
Loading
@@ -8,10 +8,10 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/healthcheck"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver"
)
var (
Loading
Loading
Loading
Loading
@@ -9,12 +9,12 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/accessverifier"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/lfsauthenticate"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/testhelper/requesthandlers"
)
Loading
Loading
Loading
Loading
@@ -9,10 +9,10 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/testhelper"
"gitlab.com/gitlab-org/gitlab-shell/internal/testhelper/requesthandlers"
)
Loading
Loading
Loading
Loading
@@ -6,10 +6,10 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/testhelper/requesthandlers"
)
Loading
Loading
Loading
Loading
@@ -9,11 +9,11 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/accessverifier"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver"
)
var (
Loading
Loading
Loading
Loading
@@ -4,6 +4,8 @@ import (
"bytes"
"errors"
"gitlab.com/gitlab-org/gitlab-shell/client"
"io"
"net/http"
Loading
Loading
@@ -93,7 +95,7 @@ func (c *Command) processApiEndpoints(response *accessverifier.Response) error {
return nil
}
func (c *Command) performRequest(client *gitlabnet.GitlabClient, endpoint string, request *Request) (*Response, error) {
func (c *Command) performRequest(client *client.GitlabNetClient, endpoint string, request *Request) (*Response, error) {
response, err := client.DoRequest(http.MethodPost, endpoint, request)
if err != nil {
return nil, err
Loading
Loading
Loading
Loading
@@ -9,10 +9,10 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/accessverifier"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver"
)
func TestExecuteEOFSent(t *testing.T) {
Loading
Loading
Loading
Loading
@@ -10,10 +10,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/twofactorrecover"
)
Loading
Loading
Loading
Loading
@@ -9,10 +9,10 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/testhelper"
"gitlab.com/gitlab-org/gitlab-shell/internal/testhelper/requesthandlers"
)
Loading
Loading
Loading
Loading
@@ -6,10 +6,10 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/testhelper/requesthandlers"
)
Loading
Loading
Loading
Loading
@@ -10,10 +10,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/client/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver"
"gitlab.com/gitlab-org/gitlab-shell/internal/testhelper"
"gitlab.com/gitlab-org/gitlab-shell/internal/testhelper/requesthandlers"
)
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