Plugins: Remove pkg/services/org and pkg/services/pluginsintegration/pluginerrs dependencies (#115820)

* remove deps from pkg/plugins

* fmt

* lint fix
This commit is contained in:
Will Browne
2026-01-05 14:10:44 +00:00
committed by GitHub
parent b4a65ac5ac
commit 99cabcb8be
19 changed files with 60 additions and 56 deletions
+14 -15
View File
@@ -14,11 +14,11 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/plugins/auth"
"github.com/grafana/grafana/pkg/plugins/backendplugin"
"github.com/grafana/grafana/pkg/plugins/backendplugin/pluginextensionv2"
"github.com/grafana/grafana/pkg/plugins/log"
"github.com/grafana/grafana/pkg/services/org"
)
var (
@@ -26,7 +26,6 @@ var (
ErrPluginFileRead = errors.New("file could not be read")
ErrUninstallInvalidPluginDir = errors.New("cannot recognize as plugin folder")
ErrInvalidPluginJSON = errors.New("did not find valid type or id properties in plugin.json")
ErrUnsupportedAlias = errors.New("can not set alias in plugin.json")
)
type Plugin struct {
@@ -186,11 +185,11 @@ func ReadPluginJSON(reader io.Reader) (JSONData, error) {
for _, include := range plugin.Includes {
if include.Role == "" {
include.Role = org.RoleViewer
include.Role = identity.RoleViewer
}
// Default to app access for app plugins
if plugin.Type == TypeApp && include.Role == org.RoleViewer && include.Action == "" {
if plugin.Type == TypeApp && include.Role == identity.RoleViewer && include.Action == "" {
include.Action = ActionAppAccess
}
}
@@ -219,17 +218,17 @@ func (d JSONData) DashboardIncludes() []*Includes {
// Route describes a plugin route that is defined in
// the plugin.json file for a plugin.
type Route struct {
Path string `json:"path"`
Method string `json:"method"`
ReqRole org.RoleType `json:"reqRole"`
ReqAction string `json:"reqAction"`
URL string `json:"url"`
URLParams []URLParam `json:"urlParams"`
Headers []Header `json:"headers"`
AuthType string `json:"authType"`
TokenAuth *JWTTokenAuth `json:"tokenAuth"`
JwtTokenAuth *JWTTokenAuth `json:"jwtTokenAuth"`
Body json.RawMessage `json:"body"`
Path string `json:"path"`
Method string `json:"method"`
ReqRole identity.RoleType `json:"reqRole"`
ReqAction string `json:"reqAction"`
URL string `json:"url"`
URLParams []URLParam `json:"urlParams"`
Headers []Header `json:"headers"`
AuthType string `json:"authType"`
TokenAuth *JWTTokenAuth `json:"tokenAuth"`
JwtTokenAuth *JWTTokenAuth `json:"jwtTokenAuth"`
Body json.RawMessage `json:"body"`
}
// Header describes an HTTP header that is forwarded with