mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 10:52:40 +08:00
track signature files + add warn log (#38938)
This commit is contained in:
@ -73,6 +73,7 @@ type PluginBase struct {
|
||||
IsCorePlugin bool `json:"-"`
|
||||
SignatureType PluginSignatureType `json:"-"`
|
||||
SignatureOrg string `json:"-"`
|
||||
SignedFiles PluginFiles `json:"-"`
|
||||
|
||||
GrafanaNetVersion string `json:"-"`
|
||||
GrafanaNetHasUpdate bool `json:"-"`
|
||||
@ -80,6 +81,23 @@ type PluginBase struct {
|
||||
Root *PluginBase
|
||||
}
|
||||
|
||||
func (p *PluginBase) IncludedInSignature(file string) bool {
|
||||
// permit Core plugin files
|
||||
if p.IsCorePlugin {
|
||||
return true
|
||||
}
|
||||
|
||||
// permit when no signed files (no MANIFEST)
|
||||
if p.SignedFiles == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
if _, exists := p.SignedFiles[file]; !exists {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type PluginDependencies struct {
|
||||
GrafanaVersion string `json:"grafanaVersion"`
|
||||
Plugins []PluginDependencyItem `json:"plugins"`
|
||||
|
Reference in New Issue
Block a user