Skip to content

Commit

Permalink
Fix: Prevent unintended use of proxy authorization when no command is…
Browse files Browse the repository at this point in the history
… provided (#4217)

* Don't check for cfg.ProxyCommand != nil but for empty slice

Signed-off-by: Fabio Graetz <[email protected]>

* Check for proxy command != nil and len > 0

Signed-off-by: Fabio Graetz <[email protected]>

---------

Signed-off-by: Fabio Graetz <[email protected]>
  • Loading branch information
fg91 authored Oct 13, 2023
1 parent 68c055b commit 2edc3bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flyteidl/clients/go/admin/auth_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func setHTTPClientContext(ctx context.Context, cfg *Config, proxyCredentialsFutu
transport.Proxy = http.ProxyURL(&cfg.HTTPProxyURL.URL)
}

if cfg.ProxyCommand != nil {
if cfg.ProxyCommand != nil && len(cfg.ProxyCommand) > 0 {
httpClient.Transport = &proxyAuthTransport{
transport: transport,
proxyCredentialsFuture: proxyCredentialsFuture,
Expand Down
2 changes: 1 addition & 1 deletion flyteidl/clients/go/admin/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func NewAdminConnection(ctx context.Context, cfg *Config, proxyCredentialsFuture

opts = append(opts, GetAdditionalAdminClientConfigOptions(cfg)...)

if cfg.ProxyCommand != nil {
if cfg.ProxyCommand != nil && len(cfg.ProxyCommand) > 0 {
opts = append(opts, grpc.WithChainUnaryInterceptor(NewProxyAuthInterceptor(cfg, proxyCredentialsFuture)))
opts = append(opts, grpc.WithPerRPCCredentials(proxyCredentialsFuture))
}
Expand Down

0 comments on commit 2edc3bd

Please sign in to comment.