diff options
author | Osman İlge Ünaldı <o.unaldi@etu.edu.tr> | 2022-03-15 02:22:02 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2022-03-15 02:22:02 +0300 |
commit | 0a2122d4960ebdca71a21cdb6038696f1746c3f1 (patch) | |
tree | 71e5a6dd68c4b7b75a76f6dac89ea1a6bafe06bf /internal/auth/auth.go | |
parent | fa999c136de21d230f1f7b2f92ce281825ceacb3 (diff) |
feat: allow auth http.Client timeout to be configurable
Changelog: added
Diffstat (limited to 'internal/auth/auth.go')
-rw-r--r-- | internal/auth/auth.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/auth/auth.go b/internal/auth/auth.go index 45b77b4f..a6e1f7e7 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -660,7 +660,7 @@ func generateKeys(secret string, count int) ([][]byte, error) { } // New when authentication supported this will be used to create authentication handler -func New(pagesDomain, storeSecret, clientID, clientSecret, redirectURI, internalGitlabServer, publicGitlabServer, authScope string) (*Auth, error) { +func New(pagesDomain, storeSecret, clientID, clientSecret, redirectURI, internalGitlabServer, publicGitlabServer, authScope string, authTimeout time.Duration) (*Auth, error) { // generate 3 keys, 2 for the cookie store and 1 for JWT signing keys, err := generateKeys(storeSecret, 3) if err != nil { @@ -675,7 +675,7 @@ func New(pagesDomain, storeSecret, clientID, clientSecret, redirectURI, internal internalGitlabServer: strings.TrimRight(internalGitlabServer, "/"), publicGitlabServer: strings.TrimRight(publicGitlabServer, "/"), apiClient: &http.Client{ - Timeout: 5 * time.Second, + Timeout: authTimeout, Transport: httptransport.DefaultTransport, }, store: sessions.NewCookieStore(keys[0], keys[1]), |