m2m_keygen 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96c064aa20bd3557f28c6d810ecc93aeaafe8dd996e49adf4b6e2c133c5c12b6
4
- data.tar.gz: 05e56692c0d9616a707eda089e3cbd572f4bd91a85af1e1f83018c1a9be6b0d7
3
+ metadata.gz: 385c9b5cec4581c958eda9972cb0c0d1c6015cf8ec39670ce6667dcefde15839
4
+ data.tar.gz: bf3bd3d11bd3a58f501d808c70123519719f5fe26a294e6363d7637f198e6106
5
5
  SHA512:
6
- metadata.gz: 927202b115c6400f8648b567b5ae19e663397764af38033193ccb9736f28b5dda4d4fbbc3804d15a51e2e43f1f713535a442022929698785cb42c849429638b9
7
- data.tar.gz: 6591b7812cbab9897b28f76cb63c1fc588d66df59d968ba1629ea33ed326c25dc350ad0c086d381618016e16fcb424ddb21c33e01b47df4cee38814b164fa334
6
+ metadata.gz: 9ca255f2052ba656a11311a4dd1532e8761dd53874db90a64c603159a7c080a64733f7e299e15bb8d482972b333ff58b09f7d62d9303263a05c6c87063029503
7
+ data.tar.gz: 764986a41b42fdefb8d0b83ebfaf51e6f2c0d70c6e34290afc919d2442cf51dd86e23f5450dc2ee6045f8c15d7f55824d0081b09ed379855bad2e739cc6efa16
data/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.2] - 2022-09-05
11
+
12
+ ### Changed
13
+
14
+ - Request default value for params in RackValidator
15
+
10
16
  ## [0.4.1] - 2022-09-05
11
17
 
12
18
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- m2m_keygen (0.4.1)
4
+ m2m_keygen (0.4.2)
5
5
  rack
6
6
  sorbet-runtime
7
7
  zeitwerk (~> 2.6)
@@ -125,7 +125,7 @@
125
125
  </div>
126
126
 
127
127
  <div id="footer">
128
- Generated on Mon Sep 5 14:49:01 2022 by
128
+ Generated on Mon Sep 5 14:55:58 2022 by
129
129
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
130
130
  0.9.28 (ruby-3.1.2).
131
131
  </div>
@@ -311,7 +311,7 @@
311
311
  </div>
312
312
 
313
313
  <div id="footer">
314
- Generated on Mon Sep 5 14:49:01 2022 by
314
+ Generated on Mon Sep 5 14:55:58 2022 by
315
315
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
316
316
  0.9.28 (ruby-3.1.2).
317
317
  </div>
@@ -504,10 +504,10 @@
504
504
  <span class='comment'># This will cover the case when Rails is used.
505
505
  </span> <span class='id identifier rubyid_req'>req</span> <span class='op'>=</span> <span class='const'>Rack</span><span class='op'>::</span><span class='const'>Request</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_env'>env</span><span class='rparen'>)</span>
506
506
  <span class='ivar'>@signature</span><span class='period'>.</span><span class='id identifier rubyid_validate'>validate</span><span class='lparen'>(</span>
507
- <span class='label'>params:</span> <span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_params'>params</span><span class='comma'>,</span>
508
- <span class='label'>verb:</span> <span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_request_method'>request_method</span><span class='comma'>,</span>
509
- <span class='label'>path:</span> <span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span>
510
- <span class='label'>signature:</span> <span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>HTTP_X_SIGNATURE</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
507
+ <span class='label'>params:</span> <span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_params'>params</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span>
508
+ <span class='label'>verb:</span> <span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_request_method'>request_method</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>get</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
509
+ <span class='label'>path:</span> <span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
510
+ <span class='label'>signature:</span> <span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>HTTP_X_SIGNATURE</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>
511
511
  <span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expiry</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expiry</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>&gt;</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>&amp;&amp;</span>
512
512
  <span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expiry</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>&lt;</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>+</span> <span class='int'>120</span>
513
513
  <span class='kw'>end</span></pre>
@@ -521,7 +521,7 @@
521
521
  </div>
522
522
 
523
523
  <div id="footer">
524
- Generated on Mon Sep 5 14:49:01 2022 by
524
+ Generated on Mon Sep 5 14:55:58 2022 by
525
525
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
526
526
  0.9.28 (ruby-3.1.2).
527
527
  </div>
@@ -670,7 +670,7 @@
670
670
  </div>
671
671
 
672
672
  <div id="footer">
673
- Generated on Mon Sep 5 14:49:01 2022 by
673
+ Generated on Mon Sep 5 14:55:58 2022 by
674
674
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
675
675
  0.9.28 (ruby-3.1.2).
676
676
  </div>
@@ -137,7 +137,7 @@
137
137
  </div>
138
138
 
139
139
  <div id="footer">
140
- Generated on Mon Sep 5 14:49:01 2022 by
140
+ Generated on Mon Sep 5 14:55:58 2022 by
141
141
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
142
142
  0.9.28 (ruby-3.1.2).
143
143
  </div>
data/docs/M2mKeygen.html CHANGED
@@ -131,7 +131,7 @@
131
131
 
132
132
  </div>
133
133
  </dt>
134
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>0.4.1</span><span class='tstring_end'>&quot;</span></span></pre></dd>
134
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>0.4.2</span><span class='tstring_end'>&quot;</span></span></pre></dd>
135
135
 
136
136
  </dl>
137
137
 
@@ -147,7 +147,7 @@
147
147
  </div>
148
148
 
149
149
  <div id="footer">
150
- Generated on Mon Sep 5 14:49:01 2022 by
150
+ Generated on Mon Sep 5 14:55:58 2022 by
151
151
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
152
152
  0.9.28 (ruby-3.1.2).
153
153
  </div>
data/docs/_index.html CHANGED
@@ -172,7 +172,7 @@
172
172
  </div>
173
173
 
174
174
  <div id="footer">
175
- Generated on Mon Sep 5 14:49:01 2022 by
175
+ Generated on Mon Sep 5 14:55:58 2022 by
176
176
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
177
177
  0.9.28 (ruby-3.1.2).
178
178
  </div>
@@ -220,7 +220,7 @@ The receiver will generate the same signature from the HTTP request it has recei
220
220
  </div></div>
221
221
 
222
222
  <div id="footer">
223
- Generated on Mon Sep 5 14:49:01 2022 by
223
+ Generated on Mon Sep 5 14:55:58 2022 by
224
224
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
225
225
  0.9.28 (ruby-3.1.2).
226
226
  </div>
data/docs/index.html CHANGED
@@ -220,7 +220,7 @@ The receiver will generate the same signature from the HTTP request it has recei
220
220
  </div></div>
221
221
 
222
222
  <div id="footer">
223
- Generated on Mon Sep 5 14:49:01 2022 by
223
+ Generated on Mon Sep 5 14:55:58 2022 by
224
224
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
225
225
  0.9.28 (ruby-3.1.2).
226
226
  </div>
@@ -100,7 +100,7 @@
100
100
  </div>
101
101
 
102
102
  <div id="footer">
103
- Generated on Mon Sep 5 14:49:01 2022 by
103
+ Generated on Mon Sep 5 14:55:58 2022 by
104
104
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
105
105
  0.9.28 (ruby-3.1.2).
106
106
  </div>
@@ -23,10 +23,10 @@ module M2mKeygen
23
23
  # This will cover the case when Rails is used.
24
24
  req = Rack::Request.new(req.env)
25
25
  @signature.validate(
26
- params: req.params,
27
- verb: req.request_method,
28
- path: req.path,
29
- signature: req.env["HTTP_X_SIGNATURE"]
26
+ params: req.params || {},
27
+ verb: req.request_method || "get",
28
+ path: req.path || "/",
29
+ signature: req.env["HTTP_X_SIGNATURE"] || ""
30
30
  ) && req.params["expiry"] && req.params["expiry"].to_i > Time.now.to_i &&
31
31
  req.params["expiry"].to_i < Time.now.to_i + 120
32
32
  end
@@ -3,5 +3,5 @@
3
3
 
4
4
  module M2mKeygen
5
5
  # Gem version
6
- VERSION = "0.4.1"
6
+ VERSION = "0.4.2"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: m2m_keygen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis <Zaratan> Pasin