openproject-token 2.2.0 → 3.0.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/lib/open_project/token/version.rb +1 -1
- data/lib/open_project/token.rb +16 -1
- 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: c70ad73f805a38cc1846b8c5b1db6492efda10e039c0d417f41577ba4aa0c50d
|
|
4
|
+
data.tar.gz: ddc82e67199f997413a1493eef6518f238821eb5f995cf07d945b7fec95cb8b6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: abd224aeb838bac009ab74e4aa9d31c60891c4d860351c21e18d2bc52aaca39be0bbf008e304b58e842194234cf3e6070b9de2a59f6086fde577abdaaa84a773
|
|
7
|
+
data.tar.gz: eb3bb63292374c49f3d6cf39bebeb7584c64b91835107f520d995cebb4047e3e285f83481948b209e40e3364f85be909346f362540548fbe017665c47d932b47
|
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 domain.is_a?(Regexp)
|
|
138
|
+
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)
|
|
@@ -183,7 +191,7 @@ module OpenProject
|
|
|
183
191
|
@subscriber = attributes["subscriber"]
|
|
184
192
|
@mail = attributes["mail"]
|
|
185
193
|
@company = attributes["company"]
|
|
186
|
-
@domain = attributes["domain"]
|
|
194
|
+
@domain = read_domain attributes["domain"]
|
|
187
195
|
|
|
188
196
|
date_attribute_keys.each do |attr|
|
|
189
197
|
value = attributes[attr]
|
|
@@ -245,6 +253,13 @@ module OpenProject
|
|
|
245
253
|
version
|
|
246
254
|
end
|
|
247
255
|
|
|
256
|
+
def read_domain(input)
|
|
257
|
+
return input if input.nil? || !(input.start_with?('/') && input.end_with?('/'))
|
|
258
|
+
|
|
259
|
+
# Omit the slashes of the input
|
|
260
|
+
Regexp.new input[1..-2]
|
|
261
|
+
end
|
|
262
|
+
|
|
248
263
|
def date_attribute_keys
|
|
249
264
|
%w(starts_at issued_at expires_at notify_admins_at notify_users_at block_changes_at)
|
|
250
265
|
end
|
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.0
|
|
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: []
|