MM-19606- Rework Prepackaged Plugins (#13449)
* MM-19609 - Add new prepackage configuration settings (#13062) * Add signatures to the prepackaged plugins (#13138) * MM-19612 - Support querying local plugin marketplace when upst… (#13250) * MM-19612 - Support querying local plugin marketplace when upstream unavailable or disabled * Update translations file * Fixed comment * Updated to check EnableRemoteMarketplace setting and LocalOnly to get marketplace plugins * Fixed unit tests * Tests cleanup code * Removed unused error message * Updated tests * MM-19614- Updated Marketplace Service error id (#13388) * [MM-19610] Consume prepackaged plugins (#13005) * consume prepackaged plugins into memory * missing i18n * remove spurious .gitignore changes * return on failure to install prepackged plugins * cleanup * s/plugins/availablePlugins * whitespace * don't return extractDir when not needed * s/plug/plugin * error on icon, cleanup * update armored version of testplugin signature * honour AutomaticPrepackagedPlugins * document getPrepackagedPlugin * MM-19613 - Include prepackaged plugins in marketplace results (#13433) * Added prepackaged plugins to marketplace results * PR Feedback * PR Feedback * Update error where definition * Removing unnecessary var declaration * Updated comments * MM-21263 - Use EnableRemoteMarketplace in marketplace install… (#13438) * MM-21263 - Use EnableRemoteMarketplace in marketplace install endpoint * Call updateConfig before calling NewServer in TestHelper * Added translations * PR feedback * Translations * Feedback * s/helpers.go/download.go * Converging env.PrepackagedPlugins * Initial PR feedback * Ordered imports properly * Updated DownloadURL to return slice of bytes * Fixed method typo * Fixed logging * Added read lock for prepackaged plugins list * PR Feedback * Added condition to only install prepackaged plugin if it was previously enabled * Linting * Updated to check plugin state in config * Closing filereader * Only add local label if remote marketplace is enabled * Updated local tag description * Fixed tests Co-authored-by: Ali Farooq <ali.farooq0@pm.me> Co-authored-by: Shota Gvinepadze <wineson@gmail.com> Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com> Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
508fbf2f53
Коммит
87eb7697f9
@@ -2265,18 +2265,20 @@ type PluginState struct {
|
||||
}
|
||||
|
||||
type PluginSettings struct {
|
||||
Enable *bool
|
||||
EnableUploads *bool `restricted:"true"`
|
||||
AllowInsecureDownloadUrl *bool `restricted:"true"`
|
||||
EnableHealthCheck *bool `restricted:"true"`
|
||||
Directory *string `restricted:"true"`
|
||||
ClientDirectory *string `restricted:"true"`
|
||||
Plugins map[string]map[string]interface{}
|
||||
PluginStates map[string]*PluginState
|
||||
EnableMarketplace *bool
|
||||
RequirePluginSignature *bool
|
||||
MarketplaceUrl *string
|
||||
SignaturePublicKeyFiles []string
|
||||
Enable *bool
|
||||
EnableUploads *bool `restricted:"true"`
|
||||
AllowInsecureDownloadUrl *bool `restricted:"true"`
|
||||
EnableHealthCheck *bool `restricted:"true"`
|
||||
Directory *string `restricted:"true"`
|
||||
ClientDirectory *string `restricted:"true"`
|
||||
Plugins map[string]map[string]interface{}
|
||||
PluginStates map[string]*PluginState
|
||||
EnableMarketplace *bool
|
||||
EnableRemoteMarketplace *bool
|
||||
AutomaticPrepackagedPlugins *bool
|
||||
RequirePluginSignature *bool
|
||||
MarketplaceUrl *string
|
||||
SignaturePublicKeyFiles []string
|
||||
}
|
||||
|
||||
func (s *PluginSettings) SetDefaults(ls LogSettings) {
|
||||
@@ -2321,6 +2323,14 @@ func (s *PluginSettings) SetDefaults(ls LogSettings) {
|
||||
s.EnableMarketplace = NewBool(PLUGIN_SETTINGS_DEFAULT_ENABLE_MARKETPLACE)
|
||||
}
|
||||
|
||||
if s.EnableRemoteMarketplace == nil {
|
||||
s.EnableRemoteMarketplace = NewBool(true)
|
||||
}
|
||||
|
||||
if s.AutomaticPrepackagedPlugins == nil {
|
||||
s.AutomaticPrepackagedPlugins = NewBool(true)
|
||||
}
|
||||
|
||||
if s.MarketplaceUrl == nil || *s.MarketplaceUrl == "" || *s.MarketplaceUrl == PLUGIN_SETTINGS_OLD_MARKETPLACE_URL {
|
||||
s.MarketplaceUrl = NewString(PLUGIN_SETTINGS_DEFAULT_MARKETPLACE_URL)
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ type MarketplacePluginFilter struct {
|
||||
PerPage int
|
||||
Filter string
|
||||
ServerVersion string
|
||||
LocalOnly bool
|
||||
}
|
||||
|
||||
// ApplyToURL modifies the given url to include query string parameters for the request.
|
||||
@@ -89,6 +90,7 @@ func (filter *MarketplacePluginFilter) ApplyToURL(u *url.URL) {
|
||||
}
|
||||
q.Add("filter", filter.Filter)
|
||||
q.Add("server_version", filter.ServerVersion)
|
||||
q.Add("local_only", strconv.FormatBool(filter.LocalOnly))
|
||||
u.RawQuery = q.Encode()
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user