openproject-token 3.0.0 → 3.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c70ad73f805a38cc1846b8c5b1db6492efda10e039c0d417f41577ba4aa0c50d
4
- data.tar.gz: ddc82e67199f997413a1493eef6518f238821eb5f995cf07d945b7fec95cb8b6
3
+ metadata.gz: f959bb6247948bcf6fd18e7f09c798e5b037d1a4d62bf6e1c92781e7e2e5e4e6
4
+ data.tar.gz: 9d42841010ef13874b4a3b489c1e96bb750c0650e00a94ed583008623279fbfe
5
5
  SHA512:
6
- metadata.gz: abd224aeb838bac009ab74e4aa9d31c60891c4d860351c21e18d2bc52aaca39be0bbf008e304b58e842194234cf3e6070b9de2a59f6086fde577abdaaa84a773
7
- data.tar.gz: eb3bb63292374c49f3d6cf39bebeb7584c64b91835107f520d995cebb4047e3e285f83481948b209e40e3364f85be909346f362540548fbe017665c47d932b47
6
+ metadata.gz: a9128f8b0bc9d6cb550dc89c1d085bed523f552f53c44800b3f51819e2b386fe77d2734178bf9c66de8bbd8506de0ee21b32fe7af3362f8bc6916a93eea7ffee
7
+ data.tar.gz: 3e3172042fac599e58fb80aaa569adfa697a30713eab643d5f4a085728a725d2e7e8b8561772a778266ee8bb5d3211bb6a46bce80d3987cec1fbc6bdc04d971d
@@ -1,5 +1,5 @@
1
1
  module OpenProject
2
2
  class Token
3
- VERSION = "3.0.0"
3
+ VERSION = "3.0.1"
4
4
  end
5
5
  end
@@ -134,8 +134,8 @@ module OpenProject
134
134
  end
135
135
 
136
136
  def valid_domain?(input)
137
- if domain.is_a?(Regexp)
138
- domain.match?(input)
137
+ if parsed_domain.is_a?(Regexp)
138
+ parsed_domain.match?(input)
139
139
  else
140
140
  domain == input
141
141
  end
@@ -182,6 +182,13 @@ module OpenProject
182
182
  raise ParseError, "Failed to load from json: #{e}"
183
183
  end
184
184
 
185
+ def parsed_domain
186
+ @parsed_domain = read_domain!(domain) unless defined?(@parsed_domain)
187
+
188
+ @parsed_domain
189
+ end
190
+
191
+
185
192
  private
186
193
 
187
194
  def load_attributes(attributes)
@@ -191,7 +198,7 @@ module OpenProject
191
198
  @subscriber = attributes["subscriber"]
192
199
  @mail = attributes["mail"]
193
200
  @company = attributes["company"]
194
- @domain = read_domain attributes["domain"]
201
+ @domain = attributes["domain"]
195
202
 
196
203
  date_attribute_keys.each do |attr|
197
204
  value = attributes[attr]
@@ -253,7 +260,7 @@ module OpenProject
253
260
  version
254
261
  end
255
262
 
256
- def read_domain(input)
263
+ def read_domain!(input)
257
264
  return input if input.nil? || !(input.start_with?('/') && input.end_with?('/'))
258
265
 
259
266
  # Omit the slashes of the input
@@ -272,6 +279,7 @@ module OpenProject
272
279
  @domain_required_from_version ||= Gem::Version.new('2.0')
273
280
  end
274
281
 
282
+
275
283
  ##
276
284
  # Reprieve was introduced in version 2.2.0 so could only be set
277
285
  # during generation from then onwards. All tokens before that
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openproject-token
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenProject GmbH