Chore: Use Grafana API to retrieve the public key to validate plugins (#66439)
This commit is contained in:
@@ -518,6 +518,12 @@ var (
|
||||
State: FeatureStateAlpha,
|
||||
Owner: grafanaAuthnzSquad,
|
||||
},
|
||||
{
|
||||
Name: "pluginsAPIManifestKey",
|
||||
Description: "Use grafana.com API to retrieve the public manifest key",
|
||||
State: FeatureStateAlpha,
|
||||
Owner: grafanaPluginsPlatformSquad,
|
||||
},
|
||||
{
|
||||
Name: "advancedDataSourcePicker",
|
||||
Description: "Enable a new data source picker with contextual information, recently used order, CSV upload and advanced mode",
|
||||
|
||||
@@ -77,5 +77,6 @@ dataplaneFrontendFallback,alpha,@grafana/observability-metrics,false,false,false
|
||||
useCachingService,stable,@grafana/grafana-operator-experience-squad,false,false,true,false
|
||||
enableElasticsearchBackendQuerying,beta,@grafana/observability-logs,false,false,false,false
|
||||
authenticationConfigUI,alpha,@grafana/grafana-authnz-team,false,false,false,false
|
||||
pluginsAPIManifestKey,alpha,@grafana/plugins-platform-backend,false,false,false,false
|
||||
advancedDataSourcePicker,alpha,@grafana/dashboards-squad,false,false,false,true
|
||||
opensearchDetectVersion,alpha,@grafana/aws-plugins,false,false,false,true
|
||||
|
||||
|
@@ -319,6 +319,10 @@ const (
|
||||
// Enables authentication configuration UI
|
||||
FlagAuthenticationConfigUI = "authenticationConfigUI"
|
||||
|
||||
// FlagPluginsAPIManifestKey
|
||||
// Use grafana.com API to retrieve the public manifest key
|
||||
FlagPluginsAPIManifestKey = "pluginsAPIManifestKey"
|
||||
|
||||
// FlagAdvancedDataSourcePicker
|
||||
// Enable a new data source picker with contextual information, recently used order, CSV upload and advanced mode
|
||||
FlagAdvancedDataSourcePicker = "advancedDataSourcePicker"
|
||||
|
||||
@@ -5,10 +5,11 @@ import (
|
||||
"strings"
|
||||
|
||||
pCfg "github.com/grafana/grafana/pkg/plugins/config"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
func ProvideConfig(settingProvider setting.Provider, grafanaCfg *setting.Cfg) (*pCfg.Cfg, error) {
|
||||
func ProvideConfig(settingProvider setting.Provider, grafanaCfg *setting.Cfg, features *featuremgmt.FeatureManager) (*pCfg.Cfg, error) {
|
||||
plugins := settingProvider.Section("plugins")
|
||||
allowedUnsigned := grafanaCfg.PluginsAllowUnsigned
|
||||
if len(plugins.KeyValue("allow_loading_unsigned_plugins").Value()) > 0 {
|
||||
@@ -25,6 +26,7 @@ func ProvideConfig(settingProvider setting.Provider, grafanaCfg *setting.Cfg) (*
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("new opentelemetry cfg: %w", err)
|
||||
}
|
||||
|
||||
return pCfg.NewCfg(
|
||||
settingProvider.KeyValue("", "app_mode").MustBool(grafanaCfg.Env == setting.Dev),
|
||||
grafanaCfg.PluginsPath,
|
||||
@@ -38,6 +40,7 @@ func ProvideConfig(settingProvider setting.Provider, grafanaCfg *setting.Cfg) (*
|
||||
grafanaCfg.PluginLogBackendRequests,
|
||||
grafanaCfg.PluginsCDNURLTemplate,
|
||||
tracingCfg,
|
||||
featuremgmt.ProvideToggles(features),
|
||||
), nil
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,8 @@ var WireSet = wire.NewSet(
|
||||
wire.Bind(new(pluginsettings.Service), new(*pluginSettings.Service)),
|
||||
filestore.ProvideService,
|
||||
wire.Bind(new(plugins.FileStore), new(*filestore.Service)),
|
||||
wire.Bind(new(plugins.SignatureCalculator), new(*signature.Signature)),
|
||||
signature.ProvideService,
|
||||
)
|
||||
|
||||
// WireExtensionSet provides a wire.ProviderSet of plugin providers that can be
|
||||
|
||||
Reference in New Issue
Block a user