From ae23ead4d959aa73a5a0ffada60e4147d679523c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 18 Apr 2025 22:35:57 +0000 Subject: [PATCH] apply security patch: release-11.6.1/394-202504041254.patch commit 16b732e9ffe6034f828b3f8e10aa17232da022ef Author: Stephanie Hingtgen Date: Fri Apr 4 13:50:50 2025 +0100 APIs: Remove dashboard and folder registration --- pkg/registry/apis/dashboard/register.go | 10 ++++------ pkg/registry/apis/folders/register.go | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/registry/apis/dashboard/register.go b/pkg/registry/apis/dashboard/register.go index cedda8820ff..9b6028c6a91 100644 --- a/pkg/registry/apis/dashboard/register.go +++ b/pkg/registry/apis/dashboard/register.go @@ -30,17 +30,13 @@ import ( "github.com/grafana/grafana/pkg/infra/db" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/tracing" - "github.com/grafana/grafana/pkg/registry/apis/dashboard/legacy" - "github.com/grafana/grafana/pkg/registry/apis/dashboard/legacysearcher" "github.com/grafana/grafana/pkg/services/accesscontrol" "github.com/grafana/grafana/pkg/services/apiserver/builder" - "github.com/grafana/grafana/pkg/services/apiserver/endpoints/request" "github.com/grafana/grafana/pkg/services/dashboards" "github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/provisioning" "github.com/grafana/grafana/pkg/services/search/sort" "github.com/grafana/grafana/pkg/setting" - "github.com/grafana/grafana/pkg/storage/legacysql" "github.com/grafana/grafana/pkg/storage/legacysql/dualwrite" "github.com/grafana/grafana/pkg/storage/unified/apistore" "github.com/grafana/grafana/pkg/storage/unified/resource" @@ -85,7 +81,8 @@ func RegisterAPIService( dual dualwrite.Service, sorter sort.Service, ) *DashboardsAPIBuilder { - softDelete := features.IsEnabledGlobally(featuremgmt.FlagDashboardRestore) + // disable dashboard api in 11.6 + /* softDelete := features.IsEnabledGlobally(featuremgmt.FlagDashboardRestore) dbp := legacysql.NewDatabaseProvider(sql) namespacer := request.GetNamespaceMapper(cfg) legacyDashboardSearcher := legacysearcher.NewDashboardSearchClient(dashStore, sorter) @@ -105,7 +102,8 @@ func RegisterAPIService( reg: reg, } apiregistration.RegisterAPI(builder) - return builder + return builder*/ + return nil } func (b *DashboardsAPIBuilder) GetGroupVersions() []schema.GroupVersion { diff --git a/pkg/registry/apis/folders/register.go b/pkg/registry/apis/folders/register.go index 6d4d64f1d9a..e6882a70406 100644 --- a/pkg/registry/apis/folders/register.go +++ b/pkg/registry/apis/folders/register.go @@ -67,7 +67,8 @@ func RegisterAPIService(cfg *setting.Cfg, registerer prometheus.Registerer, unified resource.ResourceClient, ) *FolderAPIBuilder { - if !featuremgmt.AnyEnabled(features, + // disable api in 11.6 + if true || !featuremgmt.AnyEnabled(features, featuremgmt.FlagKubernetesClientDashboardsFolders, featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs, featuremgmt.FlagProvisioning) {