Plugins: Remove secure socks proxy feature toggle (#66611)

This commit is contained in:
Stephanie Hingtgen
2023-04-18 12:11:23 -05:00
committed by GitHub
parent 743fdc159b
commit 255d8f3326
35 changed files with 44 additions and 102 deletions

View File

@@ -187,6 +187,7 @@ type FrontendSettingsDTO struct {
AwsAssumeRoleEnabled bool `json:"awsAssumeRoleEnabled"`
SupportBundlesEnabled bool `json:"supportBundlesEnabled"`
SnapshotEnabled bool `json:"snapshotEnabled"`
SecureSocksDSProxyEnabled bool `json:"secureSocksDSProxyEnabled"`
Azure FrontendSettingsAzureDTO `json:"azure"`

View File

@@ -138,6 +138,7 @@ func (hs *HTTPServer) getFrontendSettings(c *contextmodel.ReqContext) (*dtos.Fro
EditorsCanAdmin: hs.Cfg.EditorsCanAdmin,
DisableSanitizeHtml: hs.Cfg.DisableSanitizeHtml,
DateFormats: hs.Cfg.DateFormats,
SecureSocksDSProxyEnabled: hs.Cfg.SecureSocksDSProxy.Enabled,
Auth: dtos.FrontendSettingsAuthDTO{
OAuthSkipOrgRoleUpdateSync: hs.Cfg.OAuthSkipOrgRoleUpdateSync,

View File

@@ -11,7 +11,6 @@ import (
"github.com/grafana/grafana/pkg/infra/metrics/metricutil"
"github.com/grafana/grafana/pkg/infra/proxy"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/validations"
"github.com/grafana/grafana/pkg/setting"
)
@@ -55,8 +54,7 @@ func New(cfg *setting.Cfg, validator validations.PluginRequestValidator, tracer
return
}
if cfg.IsFeatureToggleEnabled(featuremgmt.FlagSecureSocksDatasourceProxy) &&
cfg.SecureSocksDSProxy.Enabled && proxy.SecureSocksProxyEnabledOnDS(opts) {
if cfg.SecureSocksDSProxy.Enabled && proxy.SecureSocksProxyEnabledOnDS(opts) {
err = proxy.NewSecureSocksHTTPProxy(&cfg.SecureSocksDSProxy, transport)
if err != nil {
logger.Error("Failed to enable secure socks proxy", "error", err.Error(), "datasource", datasourceName)

View File

@@ -310,12 +310,6 @@ var (
Expression: "true", // enabled by default
Owner: grafanaDashboardsSquad,
},
{
Name: "secureSocksDatasourceProxy",
Description: "Enable secure socks tunneling for supported core datasources",
State: FeatureStateAlpha,
Owner: hostedGrafanaTeam,
},
{
Name: "authnService",
Description: "Use new auth service to perform authentication",

View File

@@ -45,7 +45,6 @@ accessTokenExpirationCheck,stable,@grafana/grafana-authnz-team,false,false,false
showTraceId,alpha,@grafana/observability-logs,false,false,false,false
datasourceOnboarding,alpha,@grafana/dashboards-squad,false,false,false,false
emptyDashboardPage,stable,@grafana/dashboards-squad,false,false,false,true
secureSocksDatasourceProxy,alpha,@grafana/hosted-grafana-team,false,false,false,false
authnService,alpha,@grafana/grafana-authnz-team,false,false,false,false
disablePrometheusExemplarSampling,stable,@grafana/observability-metrics,false,false,false,false
alertingBacktesting,alpha,@grafana/alerting-squad,false,false,false,false
1 Name State Owner requiresDevMode RequiresLicense RequiresRestart FrontendOnly
45 showTraceId alpha @grafana/observability-logs false false false false
46 datasourceOnboarding alpha @grafana/dashboards-squad false false false false
47 emptyDashboardPage stable @grafana/dashboards-squad false false false true
secureSocksDatasourceProxy alpha @grafana/hosted-grafana-team false false false false
48 authnService alpha @grafana/grafana-authnz-team false false false false
49 disablePrometheusExemplarSampling stable @grafana/observability-metrics false false false false
50 alertingBacktesting alpha @grafana/alerting-squad false false false false

View File

@@ -191,10 +191,6 @@ const (
// Enable the redesigned user interface of a dashboard page that includes no panels
FlagEmptyDashboardPage = "emptyDashboardPage"
// FlagSecureSocksDatasourceProxy
// Enable secure socks tunneling for supported core datasources
FlagSecureSocksDatasourceProxy = "secureSocksDatasourceProxy"
// FlagAuthnService
// Use new auth service to perform authentication
FlagAuthnService = "authnService"

View File

@@ -274,7 +274,7 @@ func (e *cloudWatchExecutor) newSession(pluginCtx backend.PluginContext, region
}
// work around until https://github.com/grafana/grafana/issues/39089 is implemented
if e.cfg.SecureSocksDSProxy.Enabled && e.features.IsEnabled(featuremgmt.FlagSecureSocksDatasourceProxy) && instance.Settings.SecureSocksProxyEnabled {
if e.cfg.SecureSocksDSProxy.Enabled && instance.Settings.SecureSocksProxyEnabled {
// only update the transport to try to avoid the issue mentioned here https://github.com/grafana/grafana/issues/46365
sess.Config.HTTPClient.Transport = instance.HTTPClient.Transport
}

View File

@@ -18,7 +18,6 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/data/sqlutil"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/tsdb/sqleng"
"github.com/grafana/grafana/pkg/util"
@@ -95,7 +94,7 @@ func newInstanceSettings(cfg *setting.Cfg) datasource.InstanceFactoryFunc {
driverName := "mssql"
// register a new proxy driver if the secure socks proxy is enabled
if cfg.IsFeatureToggleEnabled(featuremgmt.FlagSecureSocksDatasourceProxy) && cfg.SecureSocksDSProxy.Enabled && jsonData.SecureDSProxy {
if cfg.SecureSocksDSProxy.Enabled && jsonData.SecureDSProxy {
driverName, err = createMSSQLProxyDriver(&cfg.SecureSocksDSProxy, cnnstr)
if err != nil {
return nil, err

View File

@@ -21,7 +21,6 @@ import (
"github.com/grafana/grafana/pkg/infra/httpclient"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/tsdb/sqleng"
)
@@ -85,7 +84,7 @@ func newInstanceSettings(cfg *setting.Cfg, httpClientProvider httpclient.Provide
}
// register the secure socks proxy dialer context, if enabled
if cfg.IsFeatureToggleEnabled(featuremgmt.FlagSecureSocksDatasourceProxy) && cfg.SecureSocksDSProxy.Enabled && jsonData.SecureDSProxy {
if cfg.SecureSocksDSProxy.Enabled && jsonData.SecureDSProxy {
// UID is only unique per org, the only way to ensure uniqueness is to do it by connection information
uniqueIdentifier := dsInfo.User + dsInfo.DecryptedSecureJSONData["password"] + dsInfo.URL + dsInfo.Database
protocol, err = registerProxyDialerContext(&cfg.SecureSocksDSProxy, protocol, uniqueIdentifier)

View File

@@ -15,7 +15,6 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/data/sqlutil"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/tsdb/sqleng"
)
@@ -96,7 +95,7 @@ func (s *Service) newInstanceSettings(cfg *setting.Cfg) datasource.InstanceFacto
driverName := "postgres"
// register a proxy driver if the secure socks proxy is enabled
if cfg.IsFeatureToggleEnabled(featuremgmt.FlagSecureSocksDatasourceProxy) && cfg.SecureSocksDSProxy.Enabled && jsonData.SecureDSProxy {
if cfg.SecureSocksDSProxy.Enabled && jsonData.SecureDSProxy {
driverName, err = createPostgresProxyDriver(&cfg.SecureSocksDSProxy, cnnstr)
if err != nil {
return "", nil