Plugins: Tidy config struct (#84168)

* tidy plugins config usage

* fix tests
This commit is contained in:
Will Browne
2024-03-11 16:28:46 +01:00
committed by GitHub
parent 0c6b0188c8
commit 225ac8003c
16 changed files with 50 additions and 199 deletions

View File

@ -9,7 +9,6 @@ import (
"github.com/grafana/grafana/pkg/plugins/auth"
"github.com/grafana/grafana/pkg/plugins/backendplugin/coreplugin"
"github.com/grafana/grafana/pkg/plugins/backendplugin/provider"
pCfg "github.com/grafana/grafana/pkg/plugins/config"
"github.com/grafana/grafana/pkg/plugins/envvars"
"github.com/grafana/grafana/pkg/plugins/log"
"github.com/grafana/grafana/pkg/plugins/manager/client"
@ -136,7 +135,7 @@ var WireExtensionSet = wire.NewSet(
)
func ProvideClientDecorator(
cfg *setting.Cfg, pCfg *pCfg.PluginManagementCfg,
cfg *setting.Cfg,
pluginRegistry registry.Service,
oAuthTokenService oauthtoken.OAuthTokenService,
tracer tracing.Tracer,
@ -144,16 +143,16 @@ func ProvideClientDecorator(
features *featuremgmt.FeatureManager,
promRegisterer prometheus.Registerer,
) (*client.Decorator, error) {
return NewClientDecorator(cfg, pCfg, pluginRegistry, oAuthTokenService, tracer, cachingService, features, promRegisterer, pluginRegistry)
return NewClientDecorator(cfg, pluginRegistry, oAuthTokenService, tracer, cachingService, features, promRegisterer, pluginRegistry)
}
func NewClientDecorator(
cfg *setting.Cfg, pCfg *pCfg.PluginManagementCfg,
cfg *setting.Cfg,
pluginRegistry registry.Service, oAuthTokenService oauthtoken.OAuthTokenService,
tracer tracing.Tracer, cachingService caching.CachingService, features *featuremgmt.FeatureManager,
promRegisterer prometheus.Registerer, registry registry.Service,
) (*client.Decorator, error) {
c := client.ProvideService(pluginRegistry, pCfg)
c := client.ProvideService(pluginRegistry)
middlewares := CreateMiddlewares(cfg, oAuthTokenService, tracer, cachingService, features, promRegisterer, registry)
return client.NewDecorator(c, middlewares...)
}