-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Check for missing client config in secure socks proxy check #1179
Fix: Check for missing client config in secure socks proxy check #1179
Conversation
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @kevinwcyu! Feel free to merge as I will cut a release of the SDK soon 😄
// it cannot be enabled if it's not enabled on Grafana | ||
if p.opts == nil { | ||
// 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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can now change the line 91 to simply return true
. Also, I'd move extra comment to the function comment (so it's more discoverable that ClientCfg is also checked)
What this PR does / why we need it:
When I was adding PDC support for some AWS data sources, it didn't look like
p.opts
was evernil
when checking whether the secure socks proxy should be enabled. It looks like it's always set, at least for the path that our data sources goes through.This PR checks for the presence of a
clientCfg
in addition to checking if the proxy options are available as theclientCfg
doesn't get set if secure socks proxy is not enabled in Grafana.I was running into an edge case where I enabled the secure socks proxy in my
custom.ini
as described here, then enabled the secure socks proxy for my data source, then disabled the secure socks proxy in mycustom.ini
again. Since the data source still had the secure socks proxy setting enabled, I was hitting this error becausep.opts
was never nil and the data source's settings still had the secure socks proxy setting enabled.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer: