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
Unverified Commit ec516663 authored by Ash McKenzie's avatar Ash McKenzie
Browse files

Rename Http to HTTP and comment

parent 5e3b490c
No related branches found
No related tags found
No related merge requests found
Showing
with 32 additions and 30 deletions
Loading
Loading
@@ -24,7 +24,7 @@ func TestUploadArchive(t *testing.T) {
t.Log(fmt.Sprintf("Server address: %s", gitalyAddress))
requests := requesthandlers.BuildAllowedWithGitalyHandlers(t, gitalyAddress)
url := testserver.StartHttpServer(t, requests)
url := testserver.StartHTTPServer(t, requests)
output := &bytes.Buffer{}
input := &bytes.Buffer{}
Loading
Loading
Loading
Loading
@@ -44,7 +44,7 @@ func TestForbiddenAccess(t *testing.T) {
}
func setup(t *testing.T, keyID string, requests []testserver.TestRequestHandler) *Command {
url := testserver.StartHttpServer(t, requests)
url := testserver.StartHTTPServer(t, requests)
output := &bytes.Buffer{}
input := bytes.NewBufferString("input")
Loading
Loading
Loading
Loading
@@ -24,7 +24,7 @@ func TestUploadPack(t *testing.T) {
t.Logf("Server address: %s", gitalyAddress)
requests := requesthandlers.BuildAllowedWithGitalyHandlers(t, gitalyAddress)
url := testserver.StartHttpServer(t, requests)
url := testserver.StartHTTPServer(t, requests)
output := &bytes.Buffer{}
input := &bytes.Buffer{}
Loading
Loading
Loading
Loading
@@ -40,7 +40,7 @@ func TestForbiddenAccess(t *testing.T) {
}
func setup(t *testing.T, keyID string, requests []testserver.TestRequestHandler) *Command {
url := testserver.StartHttpServer(t, requests)
url := testserver.StartHTTPServer(t, requests)
output := &bytes.Buffer{}
input := bytes.NewBufferString("input")
Loading
Loading
Loading
Loading
@@ -52,7 +52,8 @@ type ServerConfig struct {
GSSAPI GSSAPIConfig `yaml:"gssapi,omitempty"`
}
type HttpSettingsConfig struct {
// HTTPSettingsConfig are HTTP related settings
type HTTPSettingsConfig struct {
User string `yaml:"user"`
Password string `yaml:"password"`
ReadTimeoutSeconds uint64 `yaml:"read_timeout"`
Loading
Loading
@@ -82,7 +83,7 @@ type Config struct {
SecretFilePath string `yaml:"secret_file"`
Secret string `yaml:"secret"`
SslCertDir string `yaml:"ssl_cert_dir"`
HttpSettings HttpSettingsConfig `yaml:"http_settings"`
HTTPSettings HTTPSettingsConfig `yaml:"http_settings"`
Server ServerConfig `yaml:"sshd"`
LFSConfig LFSConfig `yaml:"lfs"`
PATConfig PATConfig `yaml:"pat"`
Loading
Loading
@@ -144,14 +145,15 @@ func (c *Config) ApplyGlobalState() {
}
}
// HTTPClient creates a new instance of *client.HTTPClient
func (c *Config) HTTPClient() (*client.HTTPClient, error) {
c.httpClientOnce.Do(func() {
client, err := client.NewHTTPClientWithOpts(
c.GitlabUrl,
c.GitlabRelativeURLRoot,
c.HttpSettings.CaFile,
c.HttpSettings.CaPath,
c.HttpSettings.ReadTimeoutSeconds,
c.HTTPSettings.CaFile,
c.HTTPSettings.CaPath,
c.HTTPSettings.ReadTimeoutSeconds,
nil,
)
if err != nil {
Loading
Loading
Loading
Loading
@@ -34,7 +34,7 @@ func TestConfigApplyGlobalState(t *testing.T) {
}
func TestCustomPrometheusMetrics(t *testing.T) {
url := testserver.StartHttpServer(t, []testserver.TestRequestHandler{})
url := testserver.StartHTTPServer(t, []testserver.TestRequestHandler{})
config := &Config{GitlabUrl: url}
client, err := config.HTTPClient()
Loading
Loading
Loading
Loading
@@ -283,7 +283,7 @@ func setup(t *testing.T, userResponses, keyResponses map[string]testResponse) *C
},
}
url := testserver.StartSocketHttpServer(t, requests)
url := testserver.StartSocketHTTPServer(t, requests)
client, err := NewClient(&config.Config{GitlabUrl: url})
require.NoError(t, err)
Loading
Loading
@@ -309,7 +309,7 @@ func setupWithAPIInspector(t *testing.T, inspector func(*Request)) *Client {
},
}
url := testserver.StartSocketHttpServer(t, requests)
url := testserver.StartSocketHTTPServer(t, requests)
client, err := NewClient(&config.Config{GitlabUrl: url})
require.NoError(t, err)
Loading
Loading
Loading
Loading
@@ -95,7 +95,7 @@ func TestGetByKeyErrorResponses(t *testing.T) {
}
func setup(t *testing.T) *Client {
url := testserver.StartSocketHttpServer(t, requests)
url := testserver.StartSocketHTTPServer(t, requests)
client, err := NewClient(&config.Config{GitlabUrl: url})
require.NoError(t, err)
Loading
Loading
Loading
Loading
@@ -95,7 +95,7 @@ func TestGetByKeyErrorResponses(t *testing.T) {
}
func setup(t *testing.T) *Client {
url := testserver.StartSocketHttpServer(t, requests)
url := testserver.StartSocketHTTPServer(t, requests)
client, err := NewClient(&config.Config{GitlabUrl: url})
require.NoError(t, err)
Loading
Loading
Loading
Loading
@@ -25,7 +25,7 @@ func GetClient(config *config.Config) (*client.GitlabNetClient, error) {
return nil, fmt.Errorf("Unsupported protocol")
}
return client.NewGitlabNetClient(config.HttpSettings.User, config.HttpSettings.Password, config.Secret, httpClient)
return client.NewGitlabNetClient(config.HTTPSettings.User, config.HTTPSettings.Password, config.Secret, httpClient)
}
func ParseJSON(hr *http.Response, response interface{}) error {
Loading
Loading
Loading
Loading
@@ -142,7 +142,7 @@ func TestErrorResponses(t *testing.T) {
}
func setup(t *testing.T) *Client {
url := testserver.StartSocketHttpServer(t, requests)
url := testserver.StartSocketHTTPServer(t, requests)
client, err := NewClient(&config.Config{GitlabUrl: url})
require.NoError(t, err)
Loading
Loading
Loading
Loading
@@ -104,7 +104,7 @@ func TestFailedHTTPRequest(t *testing.T) {
}
client := &Client{
URL: testserver.StartHttpServer(t, requests),
URL: testserver.StartHTTPServer(t, requests),
Headers: customHeaders,
}
Loading
Loading
@@ -135,7 +135,7 @@ func TestFailedErrorReadRequest(t *testing.T) {
}
client := &Client{
URL: testserver.StartHttpServer(t, requests),
URL: testserver.StartHTTPServer(t, requests),
Headers: customHeaders,
}
Loading
Loading
@@ -223,7 +223,7 @@ func setup(t *testing.T) *Client {
}
client := &Client{
URL: testserver.StartHttpServer(t, requests),
URL: testserver.StartHTTPServer(t, requests),
Headers: customHeaders,
}
Loading
Loading
Loading
Loading
@@ -65,7 +65,7 @@ func setup(t *testing.T, responseStatus int) *Client {
},
}
url := testserver.StartSocketHttpServer(t, requests)
url := testserver.StartSocketHTTPServer(t, requests)
client, err := NewClient(&config.Config{GitlabUrl: url})
require.NoError(t, err)
Loading
Loading
Loading
Loading
@@ -39,7 +39,7 @@ func TestCheck(t *testing.T) {
}
func setup(t *testing.T) *Client {
url := testserver.StartSocketHttpServer(t, requests)
url := testserver.StartSocketHTTPServer(t, requests)
client, err := NewClient(&config.Config{GitlabUrl: url})
require.NoError(t, err)
Loading
Loading
Loading
Loading
@@ -54,7 +54,7 @@ func setup(t *testing.T) []testserver.TestRequestHandler {
func TestFailedRequests(t *testing.T) {
requests := setup(t)
url := testserver.StartHttpServer(t, requests)
url := testserver.StartHTTPServer(t, requests)
testCases := []struct {
desc string
Loading
Loading
@@ -95,7 +95,7 @@ func TestFailedRequests(t *testing.T) {
func TestSuccessfulRequests(t *testing.T) {
requests := setup(t)
url := testserver.StartHttpServer(t, requests)
url := testserver.StartHTTPServer(t, requests)
testCases := []struct {
desc string
Loading
Loading
Loading
Loading
@@ -164,7 +164,7 @@ func TestErrorResponses(t *testing.T) {
func setup(t *testing.T) *Client {
initialize(t)
url := testserver.StartSocketHttpServer(t, requests)
url := testserver.StartSocketHTTPServer(t, requests)
client, err := NewClient(&config.Config{GitlabUrl: url})
require.NoError(t, err)
Loading
Loading
Loading
Loading
@@ -144,7 +144,7 @@ func TestErrorResponses(t *testing.T) {
func setup(t *testing.T) *Client {
initialize(t)
url := testserver.StartSocketHttpServer(t, requests)
url := testserver.StartSocketHTTPServer(t, requests)
client, err := NewClient(&config.Config{GitlabUrl: url})
require.NoError(t, err)
Loading
Loading
Loading
Loading
@@ -199,7 +199,7 @@ func TestErrorResponsesPush(t *testing.T) {
func setup(t *testing.T) *Client {
requests := initialize(t)
url := testserver.StartSocketHttpServer(t, requests)
url := testserver.StartSocketHTTPServer(t, requests)
client, err := NewClient(&config.Config{GitlabUrl: url})
require.NoError(t, err)
Loading
Loading
Loading
Loading
@@ -95,7 +95,7 @@ func TestUserKeyHandling(t *testing.T) {
},
}
url := testserver.StartSocketHttpServer(t, requests)
url := testserver.StartSocketHTTPServer(t, requests)
srvCfg := config.ServerConfig{
Listen: "127.0.0.1",
Loading
Loading
@@ -172,7 +172,7 @@ func TestUserCertificateHandling(t *testing.T) {
},
}
url := testserver.StartSocketHttpServer(t, requests)
url := testserver.StartSocketHTTPServer(t, requests)
srvCfg := config.ServerConfig{
Listen: "127.0.0.1",
Loading
Loading
Loading
Loading
@@ -127,7 +127,7 @@ func TestHandleExec(t *testing.T) {
},
}
url := testserver.StartHttpServer(t, requests)
url := testserver.StartHTTPServer(t, requests)
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
Loading
Loading
@@ -211,7 +211,7 @@ func TestHandleShell(t *testing.T) {
},
}
url := testserver.StartHttpServer(t, requests)
url := testserver.StartHTTPServer(t, requests)
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
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