Plugins: Add module hash field to plugin model (#116119)

* add module hash field to plugin model

* fix tests

* fix lint issues
This commit is contained in:
Will Browne
2026-01-13 14:35:45 +00:00
committed by GitHub
parent 86652a6515
commit aa9b587cc1
43 changed files with 767 additions and 620 deletions
+25 -2
View File
@@ -40,6 +40,7 @@ type Plugin struct {
Pinned bool
// Signature fields
Manifest *PluginManifest
Signature SignatureStatus
SignatureType SignatureType
SignatureOrg string
@@ -48,8 +49,9 @@ type Plugin struct {
Error *Error
// SystemJS fields
Module string
BaseURL string
Module string
ModuleHash string
BaseURL string
Angular AngularMeta
@@ -532,3 +534,24 @@ func (pt Type) IsValid() bool {
}
return false
}
// PluginManifest holds details for the file manifest
type PluginManifest struct {
Plugin string `json:"plugin"`
Version string `json:"version"`
KeyID string `json:"keyId"`
Time int64 `json:"time"`
Files map[string]string `json:"files"`
// V2 supported fields
ManifestVersion string `json:"manifestVersion"`
SignatureType SignatureType `json:"signatureType"`
SignedByOrg string `json:"signedByOrg"`
SignedByOrgName string `json:"signedByOrgName"`
RootURLs []string `json:"rootUrls"`
}
// IsV2 returns true if the manifest is version 2.x
func (m *PluginManifest) IsV2() bool {
return strings.HasPrefix(m.ManifestVersion, "2.")
}