openproject-token 2.2.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/open_project/token/version.rb +1 -1
- data/lib/open_project/token.rb +23 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f959bb6247948bcf6fd18e7f09c798e5b037d1a4d62bf6e1c92781e7e2e5e4e6
|
4
|
+
data.tar.gz: 9d42841010ef13874b4a3b489c1e96bb750c0650e00a94ed583008623279fbfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9128f8b0bc9d6cb550dc89c1d085bed523f552f53c44800b3f51819e2b386fe77d2734178bf9c66de8bbd8506de0ee21b32fe7af3362f8bc6916a93eea7ffee
|
7
|
+
data.tar.gz: 3e3172042fac599e58fb80aaa569adfa697a30713eab643d5f4a085728a725d2e7e8b8561772a778266ee8bb5d3211bb6a46bce80d3987cec1fbc6bdc04d971d
|
data/lib/open_project/token.rb
CHANGED
@@ -133,6 +133,14 @@ module OpenProject
|
|
133
133
|
version && Gem::Version.new(version) >= domain_required_from_version
|
134
134
|
end
|
135
135
|
|
136
|
+
def valid_domain?(input)
|
137
|
+
if parsed_domain.is_a?(Regexp)
|
138
|
+
parsed_domain.match?(input)
|
139
|
+
else
|
140
|
+
domain == input
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
136
144
|
def restricted?(key = nil)
|
137
145
|
if key
|
138
146
|
restricted? && restrictions.has_key?(key)
|
@@ -174,6 +182,13 @@ module OpenProject
|
|
174
182
|
raise ParseError, "Failed to load from json: #{e}"
|
175
183
|
end
|
176
184
|
|
185
|
+
def parsed_domain
|
186
|
+
@parsed_domain = read_domain!(domain) unless defined?(@parsed_domain)
|
187
|
+
|
188
|
+
@parsed_domain
|
189
|
+
end
|
190
|
+
|
191
|
+
|
177
192
|
private
|
178
193
|
|
179
194
|
def load_attributes(attributes)
|
@@ -245,6 +260,13 @@ module OpenProject
|
|
245
260
|
version
|
246
261
|
end
|
247
262
|
|
263
|
+
def read_domain!(input)
|
264
|
+
return input if input.nil? || !(input.start_with?('/') && input.end_with?('/'))
|
265
|
+
|
266
|
+
# Omit the slashes of the input
|
267
|
+
Regexp.new input[1..-2]
|
268
|
+
end
|
269
|
+
|
248
270
|
def date_attribute_keys
|
249
271
|
%w(starts_at issued_at expires_at notify_admins_at notify_users_at block_changes_at)
|
250
272
|
end
|
@@ -257,6 +279,7 @@ module OpenProject
|
|
257
279
|
@domain_required_from_version ||= Gem::Version.new('2.0')
|
258
280
|
end
|
259
281
|
|
282
|
+
|
260
283
|
##
|
261
284
|
# Reprieve was introduced in version 2.2.0 so could only be set
|
262
285
|
# during generation from then onwards. All tokens before that
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openproject-token
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenProject GmbH
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.5'
|
55
|
-
description:
|
55
|
+
description:
|
56
56
|
email: info@openproject.com
|
57
57
|
executables: []
|
58
58
|
extensions: []
|
@@ -69,7 +69,7 @@ homepage: https://www.openproject.org
|
|
69
69
|
licenses:
|
70
70
|
- GPL-3.0
|
71
71
|
metadata: {}
|
72
|
-
post_install_message:
|
72
|
+
post_install_message:
|
73
73
|
rdoc_options: []
|
74
74
|
require_paths:
|
75
75
|
- lib
|
@@ -84,8 +84,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
|
-
rubygems_version: 3.
|
88
|
-
signing_key:
|
87
|
+
rubygems_version: 3.3.7
|
88
|
+
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: OpenProject EE token reader
|
91
91
|
test_files: []
|