Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOsman İlge Ünaldı <o.unaldi@etu.edu.tr>2022-03-15 02:22:02 +0300
committerJaime Martinez <jmartinez@gitlab.com>2022-03-15 02:22:02 +0300
commit0a2122d4960ebdca71a21cdb6038696f1746c3f1 (patch)
tree71e5a6dd68c4b7b75a76f6dac89ea1a6bafe06bf /internal/config
parentfa999c136de21d230f1f7b2f92ce281825ceacb3 (diff)
feat: allow auth http.Client timeout to be configurable
Changelog: added
Diffstat (limited to 'internal/config')
-rw-r--r--internal/config/config.go2
-rw-r--r--internal/config/flags.go1
2 files changed, 3 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index cef23be8..7644e5ad 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -85,6 +85,7 @@ type Auth struct {
ClientSecret string
RedirectURI string
Scope string
+ Timeout time.Duration
}
// Cache configuration for GitLab API
@@ -219,6 +220,7 @@ func loadConfig() (*Config, error) {
ClientSecret: *clientSecret,
RedirectURI: *redirectURI,
Scope: *authScope,
+ Timeout: *authTimeout,
},
Log: Log{
Format: *logFormat,
diff --git a/internal/config/flags.go b/internal/config/flags.go
index 5ddc7df6..091e07e3 100644
--- a/internal/config/flags.go
+++ b/internal/config/flags.go
@@ -70,6 +70,7 @@ var (
clientSecret = flag.String("auth-client-secret", "", "GitLab application Client Secret")
redirectURI = flag.String("auth-redirect-uri", "", "GitLab application redirect URI")
authScope = flag.String("auth-scope", "api", "Scope to be used for authentication (must match GitLab Pages OAuth application settings)")
+ authTimeout = flag.Duration("auth-timeout", 5*time.Second, "GitLab application client timeout for authentication")
maxConns = flag.Int("max-conns", 0, "Limit on the number of concurrent connections to the HTTP, HTTPS or proxy listeners, 0 for no limit")
maxURILength = flag.Int("max-uri-length", 1024, "Limit the length of URI, 0 for unlimited.")
insecureCiphers = flag.Bool("insecure-ciphers", false, "Use default list of cipher suites, may contain insecure ones like 3DES and RC4")