Plugins: Update PDC pattern from latest plugin SDK changes (#76036)
* update with sdk * do sql * fix core plugins * fix proxy settings * bump SDK version * tidy * enable pdc for test * add codeowners
This commit is contained in:
@@ -2,15 +2,23 @@ package proxyutil
|
||||
|
||||
import (
|
||||
sdkproxy "github.com/grafana/grafana-plugin-sdk-go/backend/proxy"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/grafana/grafana/pkg/tsdb/sqleng"
|
||||
)
|
||||
|
||||
func GetSQLProxyOptions(dsInfo sqleng.DataSourceInfo) *sdkproxy.Options {
|
||||
func GetSQLProxyOptions(cfg setting.SecureSocksDSProxySettings, dsInfo sqleng.DataSourceInfo) *sdkproxy.Options {
|
||||
opts := &sdkproxy.Options{
|
||||
Enabled: dsInfo.JsonData.SecureDSProxy,
|
||||
Enabled: dsInfo.JsonData.SecureDSProxy && cfg.Enabled,
|
||||
Auth: &sdkproxy.AuthOptions{
|
||||
Username: dsInfo.UID,
|
||||
},
|
||||
ClientCfg: &sdkproxy.ClientCfg{
|
||||
ClientCert: cfg.ClientCert,
|
||||
ClientKey: cfg.ClientKey,
|
||||
ServerName: cfg.ServerName,
|
||||
RootCA: cfg.RootCA,
|
||||
ProxyAddress: cfg.ProxyAddress,
|
||||
},
|
||||
}
|
||||
if dsInfo.JsonData.SecureDSProxyUsername != "" {
|
||||
opts.Auth.Username = dsInfo.JsonData.SecureDSProxyUsername
|
||||
|
||||
Reference in New Issue
Block a user