umbrellio-utils 0.7.2 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +79 -77
- data/lib/umbrellio_utils/checks.rb +2 -7
- data/lib/umbrellio_utils/request_wrapper.rb +4 -3
- data/lib/umbrellio_utils/version.rb +1 -1
- 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: 0fbbcbcfd7e518b7673e46222b16b7b1bd34043e6ce41daeab68be72061a0c02
|
4
|
+
data.tar.gz: 77c3e024673156610281bcb81cbdaf25ec86e1034ab32c02975f0afa39ef7f06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79ed5bc2a2c4c1c1271fb7f9ed026b7993d22d426e11a25dc6af9c0f950d24f10a92cbd4820a84704f49c4af42696a8382bb9d5d3354684d2565509dd8cc356e
|
7
|
+
data.tar.gz: 2d38414441ef3aeceab73d7089c2656dcffaf78c4a9f4142f9ce091ad058a0a816882b0a1e0b1d99388822100e1042489e68c689f14c75090b37e40144a2dc0d
|
data/Gemfile.lock
CHANGED
@@ -1,73 +1,73 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
umbrellio-utils (0.7.
|
4
|
+
umbrellio-utils (0.7.4)
|
5
5
|
memery (~> 1)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actioncable (7.0.
|
11
|
-
actionpack (= 7.0.
|
12
|
-
activesupport (= 7.0.
|
10
|
+
actioncable (7.0.8)
|
11
|
+
actionpack (= 7.0.8)
|
12
|
+
activesupport (= 7.0.8)
|
13
13
|
nio4r (~> 2.0)
|
14
14
|
websocket-driver (>= 0.6.1)
|
15
|
-
actionmailbox (7.0.
|
16
|
-
actionpack (= 7.0.
|
17
|
-
activejob (= 7.0.
|
18
|
-
activerecord (= 7.0.
|
19
|
-
activestorage (= 7.0.
|
20
|
-
activesupport (= 7.0.
|
15
|
+
actionmailbox (7.0.8)
|
16
|
+
actionpack (= 7.0.8)
|
17
|
+
activejob (= 7.0.8)
|
18
|
+
activerecord (= 7.0.8)
|
19
|
+
activestorage (= 7.0.8)
|
20
|
+
activesupport (= 7.0.8)
|
21
21
|
mail (>= 2.7.1)
|
22
22
|
net-imap
|
23
23
|
net-pop
|
24
24
|
net-smtp
|
25
|
-
actionmailer (7.0.
|
26
|
-
actionpack (= 7.0.
|
27
|
-
actionview (= 7.0.
|
28
|
-
activejob (= 7.0.
|
29
|
-
activesupport (= 7.0.
|
25
|
+
actionmailer (7.0.8)
|
26
|
+
actionpack (= 7.0.8)
|
27
|
+
actionview (= 7.0.8)
|
28
|
+
activejob (= 7.0.8)
|
29
|
+
activesupport (= 7.0.8)
|
30
30
|
mail (~> 2.5, >= 2.5.4)
|
31
31
|
net-imap
|
32
32
|
net-pop
|
33
33
|
net-smtp
|
34
34
|
rails-dom-testing (~> 2.0)
|
35
|
-
actionpack (7.0.
|
36
|
-
actionview (= 7.0.
|
37
|
-
activesupport (= 7.0.
|
35
|
+
actionpack (7.0.8)
|
36
|
+
actionview (= 7.0.8)
|
37
|
+
activesupport (= 7.0.8)
|
38
38
|
rack (~> 2.0, >= 2.2.4)
|
39
39
|
rack-test (>= 0.6.3)
|
40
40
|
rails-dom-testing (~> 2.0)
|
41
41
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
42
|
-
actiontext (7.0.
|
43
|
-
actionpack (= 7.0.
|
44
|
-
activerecord (= 7.0.
|
45
|
-
activestorage (= 7.0.
|
46
|
-
activesupport (= 7.0.
|
42
|
+
actiontext (7.0.8)
|
43
|
+
actionpack (= 7.0.8)
|
44
|
+
activerecord (= 7.0.8)
|
45
|
+
activestorage (= 7.0.8)
|
46
|
+
activesupport (= 7.0.8)
|
47
47
|
globalid (>= 0.6.0)
|
48
48
|
nokogiri (>= 1.8.5)
|
49
|
-
actionview (7.0.
|
50
|
-
activesupport (= 7.0.
|
49
|
+
actionview (7.0.8)
|
50
|
+
activesupport (= 7.0.8)
|
51
51
|
builder (~> 3.1)
|
52
52
|
erubi (~> 1.4)
|
53
53
|
rails-dom-testing (~> 2.0)
|
54
54
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
55
|
-
activejob (7.0.
|
56
|
-
activesupport (= 7.0.
|
55
|
+
activejob (7.0.8)
|
56
|
+
activesupport (= 7.0.8)
|
57
57
|
globalid (>= 0.3.6)
|
58
|
-
activemodel (7.0.
|
59
|
-
activesupport (= 7.0.
|
60
|
-
activerecord (7.0.
|
61
|
-
activemodel (= 7.0.
|
62
|
-
activesupport (= 7.0.
|
63
|
-
activestorage (7.0.
|
64
|
-
actionpack (= 7.0.
|
65
|
-
activejob (= 7.0.
|
66
|
-
activerecord (= 7.0.
|
67
|
-
activesupport (= 7.0.
|
58
|
+
activemodel (7.0.8)
|
59
|
+
activesupport (= 7.0.8)
|
60
|
+
activerecord (7.0.8)
|
61
|
+
activemodel (= 7.0.8)
|
62
|
+
activesupport (= 7.0.8)
|
63
|
+
activestorage (7.0.8)
|
64
|
+
actionpack (= 7.0.8)
|
65
|
+
activejob (= 7.0.8)
|
66
|
+
activerecord (= 7.0.8)
|
67
|
+
activesupport (= 7.0.8)
|
68
68
|
marcel (~> 1.0)
|
69
69
|
mini_mime (>= 1.1.0)
|
70
|
-
activesupport (7.0.
|
70
|
+
activesupport (7.0.8)
|
71
71
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
72
72
|
i18n (>= 1.6, < 2)
|
73
73
|
minitest (>= 5.1)
|
@@ -77,6 +77,7 @@ GEM
|
|
77
77
|
amazing_print (1.5.0)
|
78
78
|
amq-protocol (2.3.2)
|
79
79
|
ast (2.4.2)
|
80
|
+
bigdecimal (3.1.4)
|
80
81
|
builder (3.2.4)
|
81
82
|
bundler-audit (0.9.1)
|
82
83
|
bundler (>= 1.2.0, < 3)
|
@@ -103,8 +104,8 @@ GEM
|
|
103
104
|
ffi-compiler (1.0.1)
|
104
105
|
ffi (>= 1.0.0)
|
105
106
|
rake
|
106
|
-
globalid (1.1
|
107
|
-
activesupport (>=
|
107
|
+
globalid (1.2.1)
|
108
|
+
activesupport (>= 6.1)
|
108
109
|
http (5.1.1)
|
109
110
|
addressable (~> 2.8)
|
110
111
|
http-cookie (~> 1.0)
|
@@ -133,10 +134,10 @@ GEM
|
|
133
134
|
memery (1.5.0)
|
134
135
|
ruby2_keywords (~> 0.0.2)
|
135
136
|
method_source (1.0.0)
|
136
|
-
mini_mime (1.1.
|
137
|
-
mini_portile2 (2.8.
|
138
|
-
minitest (5.
|
139
|
-
net-imap (0.3.
|
137
|
+
mini_mime (1.1.5)
|
138
|
+
mini_portile2 (2.8.4)
|
139
|
+
minitest (5.20.0)
|
140
|
+
net-imap (0.3.7)
|
140
141
|
date
|
141
142
|
net-protocol
|
142
143
|
net-pop (0.1.2)
|
@@ -146,21 +147,21 @@ GEM
|
|
146
147
|
net-smtp (0.3.3)
|
147
148
|
net-protocol
|
148
149
|
nio4r (2.5.9)
|
149
|
-
nokogiri (1.15.
|
150
|
+
nokogiri (1.15.4)
|
150
151
|
mini_portile2 (~> 2.8.2)
|
151
152
|
racc (~> 1.4)
|
152
|
-
nokogiri (1.15.
|
153
|
+
nokogiri (1.15.4-arm64-darwin)
|
153
154
|
racc (~> 1.4)
|
154
|
-
nokogiri (1.15.
|
155
|
+
nokogiri (1.15.4-x86_64-darwin)
|
155
156
|
racc (~> 1.4)
|
156
|
-
nokogiri (1.15.
|
157
|
+
nokogiri (1.15.4-x86_64-linux)
|
157
158
|
racc (~> 1.4)
|
158
159
|
nori (2.6.0)
|
159
160
|
parallel (1.23.0)
|
160
161
|
parser (3.2.2.3)
|
161
162
|
ast (~> 2.4.1)
|
162
163
|
racc
|
163
|
-
pg (1.5.
|
164
|
+
pg (1.5.4)
|
164
165
|
pry (0.14.2)
|
165
166
|
coderay (~> 1.1)
|
166
167
|
method_source (~> 1.0)
|
@@ -172,33 +173,33 @@ GEM
|
|
172
173
|
sneakers (~> 2.0)
|
173
174
|
tainbox
|
174
175
|
racc (1.7.1)
|
175
|
-
rack (2.2.
|
176
|
+
rack (2.2.8)
|
176
177
|
rack-test (2.1.0)
|
177
178
|
rack (>= 1.3)
|
178
|
-
rails (7.0.
|
179
|
-
actioncable (= 7.0.
|
180
|
-
actionmailbox (= 7.0.
|
181
|
-
actionmailer (= 7.0.
|
182
|
-
actionpack (= 7.0.
|
183
|
-
actiontext (= 7.0.
|
184
|
-
actionview (= 7.0.
|
185
|
-
activejob (= 7.0.
|
186
|
-
activemodel (= 7.0.
|
187
|
-
activerecord (= 7.0.
|
188
|
-
activestorage (= 7.0.
|
189
|
-
activesupport (= 7.0.
|
179
|
+
rails (7.0.8)
|
180
|
+
actioncable (= 7.0.8)
|
181
|
+
actionmailbox (= 7.0.8)
|
182
|
+
actionmailer (= 7.0.8)
|
183
|
+
actionpack (= 7.0.8)
|
184
|
+
actiontext (= 7.0.8)
|
185
|
+
actionview (= 7.0.8)
|
186
|
+
activejob (= 7.0.8)
|
187
|
+
activemodel (= 7.0.8)
|
188
|
+
activerecord (= 7.0.8)
|
189
|
+
activestorage (= 7.0.8)
|
190
|
+
activesupport (= 7.0.8)
|
190
191
|
bundler (>= 1.15.0)
|
191
|
-
railties (= 7.0.
|
192
|
-
rails-dom-testing (2.
|
192
|
+
railties (= 7.0.8)
|
193
|
+
rails-dom-testing (2.2.0)
|
193
194
|
activesupport (>= 5.0.0)
|
194
195
|
minitest
|
195
196
|
nokogiri (>= 1.6)
|
196
197
|
rails-html-sanitizer (1.6.0)
|
197
198
|
loofah (~> 2.21)
|
198
199
|
nokogiri (~> 1.14)
|
199
|
-
railties (7.0.
|
200
|
-
actionpack (= 7.0.
|
201
|
-
activesupport (= 7.0.
|
200
|
+
railties (7.0.8)
|
201
|
+
actionpack (= 7.0.8)
|
202
|
+
activesupport (= 7.0.8)
|
202
203
|
method_source
|
203
204
|
rake (>= 12.2)
|
204
205
|
thor (~> 1.0)
|
@@ -207,7 +208,7 @@ GEM
|
|
207
208
|
rake (13.0.6)
|
208
209
|
rbtree (0.4.6)
|
209
210
|
regexp_parser (2.8.1)
|
210
|
-
rexml (3.2.
|
211
|
+
rexml (3.2.6)
|
211
212
|
rspec (3.12.0)
|
212
213
|
rspec-core (~> 3.12.0)
|
213
214
|
rspec-expectations (~> 3.12.0)
|
@@ -220,7 +221,7 @@ GEM
|
|
220
221
|
rspec-json_matcher (0.2.0)
|
221
222
|
amazing_print
|
222
223
|
json
|
223
|
-
rspec-mocks (3.12.
|
224
|
+
rspec-mocks (3.12.6)
|
224
225
|
diff-lcs (>= 1.2.0, < 2.0)
|
225
226
|
rspec-support (~> 3.12.0)
|
226
227
|
rspec-support (3.12.1)
|
@@ -262,9 +263,10 @@ GEM
|
|
262
263
|
ruby-progressbar (1.13.0)
|
263
264
|
ruby2_keywords (0.0.5)
|
264
265
|
self_data (1.3.0)
|
265
|
-
semantic_logger (4.
|
266
|
+
semantic_logger (4.14.0)
|
266
267
|
concurrent-ruby (~> 1.0)
|
267
|
-
sequel (5.
|
268
|
+
sequel (5.72.0)
|
269
|
+
bigdecimal
|
268
270
|
sequel-batches (2.0.2)
|
269
271
|
sequel
|
270
272
|
serverengine (2.0.7)
|
@@ -288,30 +290,30 @@ GEM
|
|
288
290
|
rbtree
|
289
291
|
set (~> 1.0)
|
290
292
|
symbiont-ruby (0.7.0)
|
291
|
-
table_sync (6.1
|
293
|
+
table_sync (6.4.1)
|
292
294
|
memery
|
293
|
-
rabbit_messaging
|
295
|
+
rabbit_messaging (~> 0.13)
|
294
296
|
rails
|
295
297
|
self_data
|
296
298
|
tainbox (2.1.2)
|
297
299
|
activesupport
|
298
300
|
thor (1.2.2)
|
299
|
-
timecop (0.9.
|
301
|
+
timecop (0.9.8)
|
300
302
|
timeout (0.4.0)
|
301
303
|
tzinfo (2.0.6)
|
302
304
|
concurrent-ruby (~> 1.0)
|
303
|
-
umbrellio-sequel-plugins (0.
|
305
|
+
umbrellio-sequel-plugins (0.14.0.187)
|
304
306
|
sequel
|
305
307
|
symbiont-ruby
|
306
308
|
unf (0.1.4)
|
307
309
|
unf_ext
|
308
310
|
unf_ext (0.0.8.2)
|
309
311
|
unicode-display_width (2.4.2)
|
310
|
-
websocket-driver (0.7.
|
312
|
+
websocket-driver (0.7.6)
|
311
313
|
websocket-extensions (>= 0.1.0)
|
312
314
|
websocket-extensions (0.1.5)
|
313
315
|
yard (0.9.34)
|
314
|
-
zeitwerk (2.6.
|
316
|
+
zeitwerk (2.6.11)
|
315
317
|
|
316
318
|
PLATFORMS
|
317
319
|
arm64-darwin-20
|
@@ -5,6 +5,7 @@ module UmbrellioUtils
|
|
5
5
|
extend self
|
6
6
|
|
7
7
|
EMAIL_REGEXP = /\A([\w+-].?)+@[a-z\d-]+(\.[a-z]+)*\.[a-z]+\z/i.freeze
|
8
|
+
HOLDER_NAME_REGEXP = /\A([A-Za-z0-9.'-]+ ?)+\z/.freeze
|
8
9
|
|
9
10
|
def secure_compare(src, dest)
|
10
11
|
ActiveSupport::SecurityUtils.secure_compare(
|
@@ -33,13 +34,7 @@ module UmbrellioUtils
|
|
33
34
|
end
|
34
35
|
|
35
36
|
def valid_card_holder?(holder)
|
36
|
-
|
37
|
-
return if words.count != 2
|
38
|
-
return if words.any? { |x| x.match?(/(.+)(\1)(\1)/) }
|
39
|
-
return unless words.all? { |x| x.size >= 2 }
|
40
|
-
return unless words.all? { |x| x.match?(/\A[A-Z]+\z/) }
|
41
|
-
|
42
|
-
true
|
37
|
+
holder.to_s =~ HOLDER_NAME_REGEXP
|
43
38
|
end
|
44
39
|
|
45
40
|
def valid_card_cvv?(cvv)
|
@@ -4,8 +4,9 @@ module UmbrellioUtils
|
|
4
4
|
class RequestWrapper
|
5
5
|
include Memery
|
6
6
|
|
7
|
-
def initialize(request)
|
7
|
+
def initialize(request, remove_xml_attributes: true)
|
8
8
|
self.request = request
|
9
|
+
self.remove_xml_attributes = remove_xml_attributes
|
9
10
|
end
|
10
11
|
|
11
12
|
memoize def params
|
@@ -50,14 +51,14 @@ module UmbrellioUtils
|
|
50
51
|
|
51
52
|
private
|
52
53
|
|
53
|
-
attr_accessor :request
|
54
|
+
attr_accessor :request, :remove_xml_attributes
|
54
55
|
|
55
56
|
def parse_params
|
56
57
|
case request.media_type
|
57
58
|
when "application/json", /\+json\z/
|
58
59
|
Parsing.safely_parse_json(body)
|
59
60
|
when "application/xml"
|
60
|
-
Parsing.parse_xml(body)
|
61
|
+
Parsing.parse_xml(body, remove_attributes: remove_xml_attributes)
|
61
62
|
else
|
62
63
|
request.get? ? request.GET : request.POST
|
63
64
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: umbrellio-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JustAnotherDude
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: memery
|
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
86
|
- !ruby/object:Gem::Version
|
87
87
|
version: '0'
|
88
88
|
requirements: []
|
89
|
-
rubygems_version: 3.4.
|
89
|
+
rubygems_version: 3.4.21
|
90
90
|
signing_key:
|
91
91
|
specification_version: 4
|
92
92
|
summary: A set of utilities that speed up development
|