[MM-25284] Include license type in Marketplace request (#14586)

Этот коммит содержится в:
Ben Schumacher
2020-05-23 07:05:51 +02:00
коммит произвёл GitHub
родитель d317dd2dde
Коммит 23ecc9ad0a
4 изменённых файлов: 109 добавлений и 9 удалений

Просмотреть файл

@@ -64,6 +64,7 @@ type Features struct {
GuestAccountsPermissions *bool `json:"guest_accounts_permissions"`
IDLoadedPushNotifications *bool `json:"id_loaded"`
LockTeammateNameDisplay *bool `json:"lock_teammate_name_display"`
EnterprisePlugins *bool `json:"enterprise_plugins"`
// after we enabled more features we'll need to control them with this
FutureFeatures *bool `json:"future_features"`
@@ -90,6 +91,7 @@ func (f *Features) ToMap() map[string]interface{} {
"guest_accounts_permissions": *f.GuestAccountsPermissions,
"id_loaded": *f.IDLoadedPushNotifications,
"lock_teammate_name_display": *f.LockTeammateNameDisplay,
"enterprise_plugins": *f.EnterprisePlugins,
"future": *f.FutureFeatures,
}
}
@@ -190,6 +192,10 @@ func (f *Features) SetDefaults() {
if f.LockTeammateNameDisplay == nil {
f.LockTeammateNameDisplay = NewBool(*f.FutureFeatures)
}
if f.EnterprisePlugins == nil {
f.EnterprisePlugins = NewBool(*f.FutureFeatures)
}
}
func (l *License) IsExpired() bool {

Просмотреть файл

@@ -74,11 +74,13 @@ func (plugin *BaseMarketplacePlugin) DecodeSignature() (io.ReadSeeker, error) {
// MarketplacePluginFilter describes the parameters to request a list of plugins.
type MarketplacePluginFilter struct {
Page int
PerPage int
Filter string
ServerVersion string
LocalOnly bool
Page int
PerPage int
Filter string
ServerVersion string
BuildEnterpriseReady bool
EnterprisePlugins bool
LocalOnly bool
}
// ApplyToURL modifies the given url to include query string parameters for the request.
@@ -90,6 +92,8 @@ func (filter *MarketplacePluginFilter) ApplyToURL(u *url.URL) {
}
q.Add("filter", filter.Filter)
q.Add("server_version", filter.ServerVersion)
q.Add("build_enterprise_ready", strconv.FormatBool(filter.BuildEnterpriseReady))
q.Add("enterprise_plugins", strconv.FormatBool(filter.EnterprisePlugins))
q.Add("local_only", strconv.FormatBool(filter.LocalOnly))
u.RawQuery = q.Encode()
}