gitlab-license 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/gitlab/license/version.rb +1 -1
- data/lib/gitlab/license.rb +16 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22b0a5d5cec617462fad10a954e69a8ab0cbf2234c4c666b2bce3962387627b4
|
4
|
+
data.tar.gz: 5c74cb614cca7a0501188c219fa4dd716d6158fd79cae2a9aeef698d08d90ff9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cbae440edf6fa10bb5944b63957e204e3fe6213d66d338b1cb7ce0428e2bdfc65a56b634a16c5832cd0039c568108a34c9f9c8b2da1f15e1427332355a2535a
|
7
|
+
data.tar.gz: ee7e2deda0d8f42d5453455a9d9d6d88f1b3a53d908f87323928151587a3640bdf3ad4fa7cb9d792639f88df00c0b934491d54e20233d0513b884135ea789ef1
|
data/README.md
CHANGED
@@ -27,7 +27,9 @@ To release a new version of this gem, follow these steps:
|
|
27
27
|
1. [Build the gem](https://guides.rubygems.org/command-reference/#gem-build) to be published: `gem build gitlab-license.gemspec`
|
28
28
|
1. [Publish the gem](https://guides.rubygems.org/publishing) to Rubygems: `gem push gitlab-license-2.1.0.gem`
|
29
29
|
- Note you will need to be added as an owner in Rubygems in order to publish.
|
30
|
-
|
30
|
+
1. Once published, the new version of the gem can be installed in projects that depend on `gitlab-license` like [CustomersDot](https://gitlab.com/gitlab-org/customers-gitlab-com) and [GitLab](https://gitlab.com/gitlab-org/gitlab).
|
31
|
+
- It is recommended to install the new version in both GitLab and CustomersDot to keep the versions aligned.
|
32
|
+
- This can be installed via bundler or using `gem install` directly.
|
31
33
|
|
32
34
|
## Usage
|
33
35
|
|
data/lib/gitlab/license.rb
CHANGED
@@ -8,7 +8,7 @@ require 'gitlab/license/encryptor'
|
|
8
8
|
require 'gitlab/license/boundary'
|
9
9
|
|
10
10
|
module Gitlab
|
11
|
-
class License
|
11
|
+
class License # rubocop:disable Metrics/ClassLength
|
12
12
|
class Error < StandardError; end
|
13
13
|
class ImportError < Error; end
|
14
14
|
class ValidationError < Error; end
|
@@ -79,7 +79,7 @@ module Gitlab
|
|
79
79
|
:activated_at, :restrictions, :cloud_licensing_enabled,
|
80
80
|
:offline_cloud_licensing_enabled, :auto_renew_enabled, :seat_reconciliation_enabled,
|
81
81
|
:operational_metrics_enabled, :generated_from_customers_dot,
|
82
|
-
:generated_from_cancellation
|
82
|
+
:generated_from_cancellation, :temporary_extension, :contract_overages_allowed
|
83
83
|
|
84
84
|
alias_method :issued_at, :starts_at
|
85
85
|
alias_method :issued_at=, :starts_at=
|
@@ -170,6 +170,10 @@ module Gitlab
|
|
170
170
|
offline_cloud_licensing_enabled == true
|
171
171
|
end
|
172
172
|
|
173
|
+
def contract_overages_allowed?
|
174
|
+
contract_overages_allowed == true
|
175
|
+
end
|
176
|
+
|
173
177
|
def auto_renew?
|
174
178
|
auto_renew_enabled == true
|
175
179
|
end
|
@@ -198,6 +202,10 @@ module Gitlab
|
|
198
202
|
licensee['Company'].to_s.match?(/GitLab/i) && licensee['Email'].to_s.end_with?('@jihulab.com')
|
199
203
|
end
|
200
204
|
|
205
|
+
def temporary_extension?
|
206
|
+
temporary_extension == true
|
207
|
+
end
|
208
|
+
|
201
209
|
def restricted?(key = nil)
|
202
210
|
if key
|
203
211
|
restricted? && restrictions.has_key?(key)
|
@@ -230,10 +238,13 @@ module Gitlab
|
|
230
238
|
hash['auto_renew_enabled'] = auto_renew?
|
231
239
|
hash['seat_reconciliation_enabled'] = seat_reconciliation?
|
232
240
|
hash['operational_metrics_enabled'] = operational_metrics?
|
241
|
+
hash['contract_overages_allowed'] = contract_overages_allowed?
|
233
242
|
|
234
243
|
hash['generated_from_customers_dot'] = generated_from_customers_dot?
|
235
244
|
hash['generated_from_cancellation'] = generated_from_cancellation?
|
236
245
|
|
246
|
+
hash['temporary_extension'] = temporary_extension?
|
247
|
+
|
237
248
|
hash['restrictions'] = restrictions if restricted?
|
238
249
|
|
239
250
|
hash
|
@@ -283,10 +294,13 @@ module Gitlab
|
|
283
294
|
operational_metrics_enabled
|
284
295
|
generated_from_customers_dot
|
285
296
|
generated_from_cancellation
|
297
|
+
temporary_extension
|
286
298
|
].each do |attr_name|
|
287
299
|
public_send("#{attr_name}=", attributes[attr_name] == true)
|
288
300
|
end
|
289
301
|
|
302
|
+
@contract_overages_allowed = attributes['contract_overages_allowed'] != false
|
303
|
+
|
290
304
|
restrictions = attributes['restrictions']
|
291
305
|
if restrictions&.is_a?(Hash)
|
292
306
|
restrictions = restrictions.transform_keys(&:to_sym)
|
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.6.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: 2024-11-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
- !ruby/object:Gem::Version
|
142
142
|
version: '0'
|
143
143
|
requirements: []
|
144
|
-
rubygems_version: 3.
|
144
|
+
rubygems_version: 3.1.6
|
145
145
|
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: gitlab-license helps you generate, verify and enforce software licenses.
|