gitlab-license 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gitlab/license/version.rb +1 -1
- data/lib/gitlab/license.rb +13 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f9153bcc9df80fb7bcc879d15ae1e21709cec7a352ffd5c0c4de2ae082473d6
|
4
|
+
data.tar.gz: a36810ea464918c2f25bb40ebfe877b8561131bebfbf1e0d9530f1270f5f2816
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b37464c9ce48c030aebf3ca982bc2d4831367e0169e09c76d58e152124d6ed63202dd284e63b13c86f6eb7651cc0692db8685cc29a9bf44409167a45ce3cf722
|
7
|
+
data.tar.gz: 935474c12b21840724ae4ed064f6db461777751dae4d7454917b9ada0b93eb80138f4d678ba3b48efb6ed946da38aa11422adf5a4eadef024d3981102ec5b2cf
|
data/lib/gitlab/license.rb
CHANGED
@@ -52,9 +52,9 @@ module Gitlab
|
|
52
52
|
attr_reader :version
|
53
53
|
attr_accessor :licensee, :starts_at, :expires_at, :notify_admins_at,
|
54
54
|
:notify_users_at, :block_changes_at, :last_synced_at, :next_sync_at,
|
55
|
-
:activated_at, :restrictions, :cloud_licensing_enabled,
|
56
|
-
:
|
57
|
-
:generated_from_customers_dot
|
55
|
+
:activated_at, :restrictions, :cloud_licensing_enabled,
|
56
|
+
:offline_cloud_licensing_enabled, :auto_renew_enabled, :seat_reconciliation_enabled,
|
57
|
+
:operational_metrics_enabled, :generated_from_customers_dot
|
58
58
|
|
59
59
|
alias_method :issued_at, :starts_at
|
60
60
|
alias_method :issued_at=, :starts_at=
|
@@ -84,6 +84,8 @@ module Gitlab
|
|
84
84
|
false
|
85
85
|
elsif restrictions && !restrictions.is_a?(Hash)
|
86
86
|
false
|
87
|
+
elsif !cloud_licensing? && offline_cloud_licensing?
|
88
|
+
false
|
87
89
|
else
|
88
90
|
true
|
89
91
|
end
|
@@ -137,6 +139,10 @@ module Gitlab
|
|
137
139
|
cloud_licensing_enabled == true
|
138
140
|
end
|
139
141
|
|
142
|
+
def offline_cloud_licensing?
|
143
|
+
offline_cloud_licensing_enabled == true
|
144
|
+
end
|
145
|
+
|
140
146
|
def auto_renew?
|
141
147
|
auto_renew_enabled == true
|
142
148
|
end
|
@@ -181,6 +187,7 @@ module Gitlab
|
|
181
187
|
hash['activated_at'] = activated_at if activated?
|
182
188
|
|
183
189
|
hash['cloud_licensing_enabled'] = cloud_licensing?
|
190
|
+
hash['offline_cloud_licensing_enabled'] = offline_cloud_licensing?
|
184
191
|
hash['auto_renew_enabled'] = auto_renew?
|
185
192
|
hash['seat_reconciliation_enabled'] = seat_reconciliation?
|
186
193
|
hash['operational_metrics_enabled'] = operational_metrics?
|
@@ -209,7 +216,7 @@ module Gitlab
|
|
209
216
|
private
|
210
217
|
|
211
218
|
def load_attributes(attributes)
|
212
|
-
attributes =
|
219
|
+
attributes = attributes.transform_keys(&:to_s)
|
213
220
|
|
214
221
|
version = attributes['version'] || 1
|
215
222
|
raise ArgumentError, 'Version is too new' unless version && version == 1
|
@@ -230,6 +237,7 @@ module Gitlab
|
|
230
237
|
|
231
238
|
%w[
|
232
239
|
cloud_licensing_enabled
|
240
|
+
offline_cloud_licensing_enabled
|
233
241
|
auto_renew_enabled
|
234
242
|
seat_reconciliation_enabled
|
235
243
|
operational_metrics_enabled
|
@@ -240,7 +248,7 @@ module Gitlab
|
|
240
248
|
|
241
249
|
restrictions = attributes['restrictions']
|
242
250
|
if restrictions&.is_a?(Hash)
|
243
|
-
restrictions =
|
251
|
+
restrictions = restrictions.transform_keys(&:to_sym)
|
244
252
|
@restrictions = restrictions
|
245
253
|
end
|
246
254
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-license
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Douwe Maan
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2022-01-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|