MM-60679 - Validate playbook plugin version, based on license (#28366)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1ea854438a
Коммит
0048723ccd
@@ -670,6 +670,7 @@ func (a *App) mergePrepackagedPlugins(remoteMarketplacePlugins map[string]*model
|
||||
return model.NewAppError("mergePrepackagedPlugins", "app.plugin.config.app_error", nil, "", http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
isEnterpriseLicense := a.License() != nil && a.License().IsE20OrEnterprise()
|
||||
for _, prepackaged := range pluginsEnvironment.PrepackagedPlugins() {
|
||||
if prepackaged.Manifest == nil {
|
||||
continue
|
||||
@@ -684,6 +685,22 @@ func (a *App) mergePrepackagedPlugins(remoteMarketplacePlugins map[string]*model
|
||||
},
|
||||
}
|
||||
|
||||
// If not enterprise, check version.
|
||||
// Playbooks is not listed in the marketplace, this only handles prepackaged.
|
||||
if !isEnterpriseLicense {
|
||||
if prepackaged.Manifest.Id == model.PluginIdPlaybooks {
|
||||
version, err := semver.Parse(prepackaged.Manifest.Version)
|
||||
if err != nil {
|
||||
mlog.Error("Unable to verify prepackaged playbooks version", mlog.Err(err))
|
||||
continue
|
||||
}
|
||||
// Do not show playbooks >=v2 if we do not have an enterprise license
|
||||
if version.GTE(SemVerV2) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If not available in marketplace, add the prepackaged
|
||||
if remoteMarketplacePlugins[prepackaged.Manifest.Id] == nil {
|
||||
remoteMarketplacePlugins[prepackaged.Manifest.Id] = prepackagedMarketplace
|
||||
|
||||
Ссылка в новой задаче
Block a user