Plugins: Display plugin permissions required (#78355)

* Add definition of external service registration

* Add style and tables for permissions needed

* Add external service registration to local without counterpart

* Add feature toggle check

* Add feature flag check in the backend as well

* Add the disclaimer for permissions

---------

Co-authored-by: Gabriel MABILLE <gabriel.mabille@grafana.com>
This commit is contained in:
linoman
2023-12-20 16:29:13 +01:00
committed by GitHub
co-authored by Gabriel MABILLE
parent e27e2f66ba
commit 824e0f9ce8
7 changed files with 81 additions and 3 deletions
+2
View File
@@ -2,6 +2,7 @@ package dtos
import (
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/plugins/plugindef"
"github.com/grafana/grafana/pkg/services/accesscontrol"
)
@@ -47,6 +48,7 @@ type PluginListItem struct {
SignatureOrg string `json:"signatureOrg"`
AccessControl accesscontrol.Metadata `json:"accessControl,omitempty"`
AngularDetected bool `json:"angularDetected"`
IAM *plugindef.IAM `json:"iam,omitempty"`
}
type PluginList []PluginListItem
+4
View File
@@ -144,6 +144,10 @@ func (hs *HTTPServer) GetPluginList(c *contextmodel.ReqContext) response.Respons
AngularDetected: pluginDef.Angular.Detected,
}
if hs.Features.IsEnabled(c.Req.Context(), featuremgmt.FlagExternalServiceAccounts) {
listItem.IAM = pluginDef.IAM
}
update, exists := hs.pluginsUpdateChecker.HasUpdate(c.Req.Context(), pluginDef.ID)
if exists {
listItem.LatestVersion = update