Skip to content

Commit 2376eb8

Browse files
address review comments
1 parent cf0b6a2 commit 2376eb8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

pivnet.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ func NewAccessTokenOrLegacyToken(token string, host string, skipSSLValidation bo
127127
// createProxyAuthTransport creates an HTTP transport with proxy authentication
128128
func createProxyAuthTransport(config ClientConfig) (http.RoundTripper, error) {
129129
// Validate required fields for proxy authentication
130-
if config.ProxyAuthConfig.ProxyURL == "" || config.ProxyAuthConfig.Username == "" || config.ProxyAuthConfig.Password == "" {
131-
return nil, fmt.Errorf("proxy URL, username, and password are required when proxy authentication is specified")
130+
// Note: For Basic auth, username and password can be empty (though both empty means no auth header)
131+
// For SPNEGO, username, password, and proxyURL are all required (validated in NewSPNEGOProxyAuth)
132+
if config.ProxyAuthConfig.ProxyURL == "" {
133+
return nil, fmt.Errorf("proxy URL is required when proxy authentication is specified")
132134
}
133135

134136
// Parse proxy URL

0 commit comments

Comments
 (0)