Skip to content

Commit 02c17c4

Browse files
committed
fix(core): Add timeouts to base transport.
chore(deps): Bump `golang.org/x/oauth2` to `v0.24.0`
1 parent 0610b0a commit 02c17c4

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

auth_providers/auth_core.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,19 @@ func (c *CommandAuthConfig) ValidateAuthConfig() error {
288288

289289
// BuildTransport creates a custom http Transport for authentication to Keyfactor Command API.
290290
func (c *CommandAuthConfig) BuildTransport() (*http.Transport, error) {
291+
defaultTimeout := time.Duration(c.HttpClientTimeout) * time.Second
291292
output := http.Transport{
292293
Proxy: http.ProxyFromEnvironment,
293294
TLSClientConfig: &tls.Config{
294295
Renegotiation: tls.RenegotiateOnceAsClient,
295296
},
296-
TLSHandshakeTimeout: 10 * time.Second,
297+
TLSHandshakeTimeout: defaultTimeout,
298+
ResponseHeaderTimeout: defaultTimeout,
299+
IdleConnTimeout: defaultTimeout,
300+
ExpectContinueTimeout: defaultTimeout,
301+
MaxIdleConns: 10,
302+
MaxIdleConnsPerHost: 10,
303+
MaxConnsPerHost: 10,
297304
}
298305

299306
if c.SkipVerify {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ module github.com/Keyfactor/keyfactor-auth-client-go
1717
go 1.22
1818

1919
require (
20-
golang.org/x/oauth2 v0.23.0
20+
golang.org/x/oauth2 v0.24.0
2121
gopkg.in/yaml.v2 v2.4.0
2222
)

go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
22
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
3-
golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA=
4-
golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
5-
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
6-
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
3+
golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE=
4+
golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
75
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
86
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
97
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=

0 commit comments

Comments
 (0)