diff --git a/pkg/services/pluginsintegration/pluginconfig/request.go b/pkg/services/pluginsintegration/pluginconfig/request.go index e052457f671..ca1c9f01418 100644 --- a/pkg/services/pluginsintegration/pluginconfig/request.go +++ b/pkg/services/pluginsintegration/pluginconfig/request.go @@ -73,9 +73,9 @@ func (s *RequestConfigProvider) PluginRequestConfig(ctx context.Context, pluginI if s.cfg.ProxySettings.Enabled { m[proxy.PluginSecureSocksProxyEnabled] = "true" - m[proxy.PluginSecureSocksProxyClientCert] = s.cfg.ProxySettings.ClientCert - m[proxy.PluginSecureSocksProxyClientKey] = s.cfg.ProxySettings.ClientKey - m[proxy.PluginSecureSocksProxyRootCAs] = strings.Join(s.cfg.ProxySettings.RootCAs, ",") + m[proxy.PluginSecureSocksProxyClientCert] = s.cfg.ProxySettings.ClientCertFilePath + m[proxy.PluginSecureSocksProxyClientKey] = s.cfg.ProxySettings.ClientKeyFilePath + m[proxy.PluginSecureSocksProxyRootCAs] = strings.Join(s.cfg.ProxySettings.RootCAFilePaths, " ") m[proxy.PluginSecureSocksProxyProxyAddress] = s.cfg.ProxySettings.ProxyAddress m[proxy.PluginSecureSocksProxyServerName] = s.cfg.ProxySettings.ServerName m[proxy.PluginSecureSocksProxyAllowInsecure] = strconv.FormatBool(s.cfg.ProxySettings.AllowInsecure) diff --git a/pkg/services/pluginsintegration/pluginconfig/request_test.go b/pkg/services/pluginsintegration/pluginconfig/request_test.go index 0dd75fe61a2..4067ec2e4ac 100644 --- a/pkg/services/pluginsintegration/pluginconfig/request_test.go +++ b/pkg/services/pluginsintegration/pluginconfig/request_test.go @@ -35,23 +35,23 @@ func TestRequestConfigProvider_PluginRequestConfig(t *testing.T) { name: "Both features and proxy settings enabled", cfg: &PluginInstanceCfg{ ProxySettings: setting.SecureSocksDSProxySettings{ - Enabled: true, - ShowUI: true, - ClientCert: "c3rt", - ClientKey: "k3y", - RootCAs: []string{"ca"}, - ProxyAddress: "https://proxy.grafana.com", - ServerName: "secureProxy", - AllowInsecure: true, + Enabled: true, + ShowUI: true, + ClientCertFilePath: "./c3rt", + ClientKeyFilePath: "./k3y", + RootCAFilePaths: []string{"./ca"}, + ProxyAddress: "https://proxy.grafana.com", + ServerName: "secureProxy", + AllowInsecure: true, }, Features: featuremgmt.WithFeatures("feat-2", "feat-500", "feat-1"), }, expected: map[string]string{ "GF_INSTANCE_FEATURE_TOGGLES_ENABLE": "feat-1,feat-2,feat-500", "GF_SECURE_SOCKS_DATASOURCE_PROXY_SERVER_ENABLED": "true", - "GF_SECURE_SOCKS_DATASOURCE_PROXY_CLIENT_CERT": "c3rt", - "GF_SECURE_SOCKS_DATASOURCE_PROXY_CLIENT_KEY": "k3y", - "GF_SECURE_SOCKS_DATASOURCE_PROXY_ROOT_CA_CERT": "ca", + "GF_SECURE_SOCKS_DATASOURCE_PROXY_CLIENT_CERT": "./c3rt", + "GF_SECURE_SOCKS_DATASOURCE_PROXY_CLIENT_KEY": "./k3y", + "GF_SECURE_SOCKS_DATASOURCE_PROXY_ROOT_CA_CERT": "./ca", "GF_SECURE_SOCKS_DATASOURCE_PROXY_PROXY_ADDRESS": "https://proxy.grafana.com", "GF_SECURE_SOCKS_DATASOURCE_PROXY_SERVER_NAME": "secureProxy", "GF_SECURE_SOCKS_DATASOURCE_PROXY_ALLOW_INSECURE": "true",