Skip to content

Commit

Permalink
pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinwcyu committed Jan 8, 2025
1 parent e059422 commit 479bedb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions backend/proxy/secure_socks_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,14 @@ type cfgProxyWrapper struct {
}

// SecureSocksProxyEnabled checks if the Grafana instance allows the secure socks proxy to be used
// and the datasource options specify to use the proxy
// and the datasource options specify to use the proxy.
// The secure proxy can only be used if it's enabled on both the datasource connection and the client (Grafana server)
func (p *cfgProxyWrapper) SecureSocksProxyEnabled() bool {
// the secure proxy can only be used if it's enabled on both the datasource connection and the client (Grafana server)
if p.opts == nil || !p.opts.Enabled || p.opts.ClientCfg == nil {
return false
}

// if it's enabled on Grafana, check if the datasource is using it
return (p.opts != nil) && p.opts.Enabled
return true
}

// ConfigureSecureSocksHTTPProxy takes a http.DefaultTransport and wraps it in a socks5 proxy with TLS
Expand Down

0 comments on commit 479bedb

Please sign in to comment.