From 6c7d5bf95f136aa691d8101cd3e7dc270f178493 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Wed, 14 Jun 2023 18:58:15 +0200 Subject: [PATCH] Authn UI: Remove feature toggle (#70073) * Authn UI: Remove feature toggle * remove feature flag usage --- .../configure-grafana/feature-toggles/index.md | 1 - packages/grafana-data/src/types/featureToggles.gen.ts | 1 - pkg/api/api.go | 2 +- pkg/services/featuremgmt/registry.go | 7 ------- pkg/services/featuremgmt/toggles_gen.csv | 1 - pkg/services/featuremgmt/toggles_gen.go | 4 ---- pkg/services/navtree/navtreeimpl/admin.go | 2 +- public/app/routes/routes.tsx | 11 +++++------ 8 files changed, 7 insertions(+), 22 deletions(-) diff --git a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md index 658364e226e..6a46e2f25ff 100644 --- a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md +++ b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md @@ -38,7 +38,6 @@ Some features are enabled by default. You can disable these feature by setting t | `dataplaneFrontendFallback` | Support dataplane contract field name change for transformations and field name matchers where the name is different | Yes | | `alertingNotificationsPoliciesMatchingInstances` | Enables the preview of matching instances for notification policies | Yes | | `useCachingService` | When turned on, the new query and resource caching implementation using a wire service inject will be used in place of the previous middleware implementation | | -| `authenticationConfigUI` | Enables authentication configuration UI | Yes | | `advancedDataSourcePicker` | Enable a new data source picker with contextual information, recently used order and advanced mode | Yes | ## Preview feature toggles diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts index 9eb28e0c429..8d203e6e611 100644 --- a/packages/grafana-data/src/types/featureToggles.gen.ts +++ b/packages/grafana-data/src/types/featureToggles.gen.ts @@ -90,7 +90,6 @@ export interface FeatureToggles { refactorVariablesTimeRange?: boolean; useCachingService?: boolean; enableElasticsearchBackendQuerying?: boolean; - authenticationConfigUI?: boolean; pluginsAPIManifestKey?: boolean; advancedDataSourcePicker?: boolean; faroDatasourceSelector?: boolean; diff --git a/pkg/api/api.go b/pkg/api/api.go index ca082e4c2c2..ae5b4255cf4 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -209,7 +209,7 @@ func (hs *HTTPServer) registerRoutes() { r.Get("/user/auth-tokens/rotate", routing.Wrap(hs.RotateUserAuthTokenRedirect)) } - if hs.License.FeatureEnabled("saml") && hs.Features.IsEnabled(featuremgmt.FlagAuthenticationConfigUI) { + if hs.License.FeatureEnabled("saml") { // TODO change the scope when we extend the auth UI to more providers r.Get("/admin/authentication/", authorize(ac.EvalPermission(ac.ActionSettingsWrite, ac.ScopeSettingsSAML)), hs.Index) } diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index adf3a20993a..19c10cdb6ad 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -487,13 +487,6 @@ var ( Stage: FeatureStagePublicPreview, Owner: grafanaObservabilityLogsSquad, }, - { - Name: "authenticationConfigUI", - Description: "Enables authentication configuration UI", - Stage: FeatureStageGeneralAvailability, - Expression: "true", - Owner: grafanaAuthnzSquad, - }, { Name: "pluginsAPIManifestKey", Description: "Use grafana.com API to retrieve the public manifest key", diff --git a/pkg/services/featuremgmt/toggles_gen.csv b/pkg/services/featuremgmt/toggles_gen.csv index e16756b5b02..b9f1a43dc8f 100644 --- a/pkg/services/featuremgmt/toggles_gen.csv +++ b/pkg/services/featuremgmt/toggles_gen.csv @@ -71,7 +71,6 @@ externalServiceAuth,experimental,@grafana/grafana-authnz-team,true,false,false,f refactorVariablesTimeRange,preview,@grafana/dashboards-squad,false,false,false,false useCachingService,GA,@grafana/grafana-operator-experience-squad,false,false,true,false enableElasticsearchBackendQuerying,preview,@grafana/observability-logs,false,false,false,false -authenticationConfigUI,GA,@grafana/grafana-authnz-team,false,false,false,false pluginsAPIManifestKey,experimental,@grafana/plugins-platform-backend,false,false,false,false advancedDataSourcePicker,GA,@grafana/dashboards-squad,false,false,false,true faroDatasourceSelector,preview,@grafana/app-o11y,false,false,false,true diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index b70811eda10..9d3fb419e6a 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -295,10 +295,6 @@ const ( // Enable the processing of queries and responses in the Elasticsearch data source through backend FlagEnableElasticsearchBackendQuerying = "enableElasticsearchBackendQuerying" - // FlagAuthenticationConfigUI - // Enables authentication configuration UI - FlagAuthenticationConfigUI = "authenticationConfigUI" - // FlagPluginsAPIManifestKey // Use grafana.com API to retrieve the public manifest key FlagPluginsAPIManifestKey = "pluginsAPIManifestKey" diff --git a/pkg/services/navtree/navtreeimpl/admin.go b/pkg/services/navtree/navtreeimpl/admin.go index dbb4f191e1c..3dc024e4364 100644 --- a/pkg/services/navtree/navtreeimpl/admin.go +++ b/pkg/services/navtree/navtreeimpl/admin.go @@ -16,7 +16,7 @@ func (s *ServiceImpl) getAdminNode(c *contextmodel.ReqContext) (*navtree.NavLink hasAccess := ac.HasAccess(s.accessControl, c) hasGlobalAccess := ac.HasGlobalAccess(s.accessControl, s.accesscontrolService, c) orgsAccessEvaluator := ac.EvalPermission(ac.ActionOrgsRead) - authConfigUIAvailable := s.license.FeatureEnabled("saml") && s.features.IsEnabled(featuremgmt.FlagAuthenticationConfigUI) + authConfigUIAvailable := s.license.FeatureEnabled("saml") if hasAccess(datasources.ConfigurationPageAccess) { configNodes = append(configNodes, &navtree.NavLink{ diff --git a/public/app/routes/routes.tsx b/public/app/routes/routes.tsx index 991b59693b4..156ebb9e0ff 100644 --- a/public/app/routes/routes.tsx +++ b/public/app/routes/routes.tsx @@ -307,12 +307,11 @@ export function getAppRoutes(): RouteDescriptor[] { { path: '/admin/authentication', roles: () => contextSrv.evaluatePermission(() => ['Admin', 'ServerAdmin'], [AccessControlAction.SettingsWrite]), - component: - config.featureToggles.authenticationConfigUI && config.licenseInfo.enabledFeatures?.saml - ? SafeDynamicImport( - () => import(/* webpackChunkName: "AdminAuthentication" */ 'app/features/auth-config/AuthConfigPage') - ) - : () => , + component: config.licenseInfo.enabledFeatures?.saml + ? SafeDynamicImport( + () => import(/* webpackChunkName: "AdminAuthentication" */ 'app/features/auth-config/AuthConfigPage') + ) + : () => , }, { path: '/admin',