api-auth 2.5.1 → 2.6.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.
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe ApiAuth::RequestDrivers::RestClientRequest do
4
4
  let(:timestamp) { Time.now.utc.httpdate }
5
5
 
6
- let(:request_path) { 'http://localhost/resource.xml?foo=bar&bar=foo' }
6
+ let(:request_path) { 'https://localhost/resource.xml?foo=bar&bar=foo' }
7
7
 
8
8
  let(:request_headers) do
9
9
  {
@@ -16,7 +16,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
16
16
 
17
17
  let(:request) do
18
18
  RestClient::Request.new(
19
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
19
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
20
20
  headers: request_headers,
21
21
  method: :put,
22
22
  payload: "hello\nworld"
@@ -35,7 +35,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
35
35
  end
36
36
 
37
37
  it 'gets the request_uri' do
38
- expect(driven_request.request_uri).to eq('http://localhost/resource.xml?foo=bar&bar=foo')
38
+ expect(driven_request.request_uri).to eq('https://localhost/resource.xml?foo=bar&bar=foo')
39
39
  end
40
40
 
41
41
  it 'gets the timestamp' do
@@ -53,7 +53,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
53
53
 
54
54
  it 'treats no body as empty string' do
55
55
  request = RestClient::Request.new(
56
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
56
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
57
57
  headers: request_headers,
58
58
  method: :put
59
59
  )
@@ -66,7 +66,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
66
66
  context 'when put request' do
67
67
  let(:request) do
68
68
  RestClient::Request.new(
69
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
69
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
70
70
  headers: request_headers,
71
71
  method: :put
72
72
  )
@@ -80,7 +80,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
80
80
  context 'when get request' do
81
81
  let(:request) do
82
82
  RestClient::Request.new(
83
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
83
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
84
84
  headers: request_headers,
85
85
  method: :get
86
86
  )
@@ -104,7 +104,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
104
104
  context 'when getting' do
105
105
  let(:request) do
106
106
  RestClient::Request.new(
107
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
107
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
108
108
  headers: request_headers,
109
109
  method: :get
110
110
  )
@@ -119,7 +119,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
119
119
  context 'when posting' do
120
120
  let(:request) do
121
121
  RestClient::Request.new(
122
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
122
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
123
123
  headers: request_headers,
124
124
  method: :post,
125
125
  payload: "hello\nworld"
@@ -140,7 +140,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
140
140
  context 'when putting' do
141
141
  let(:request) do
142
142
  RestClient::Request.new(
143
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
143
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
144
144
  headers: request_headers,
145
145
  method: :put,
146
146
  payload: "hello\nworld"
@@ -161,7 +161,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
161
161
  context 'when deleting' do
162
162
  let(:request) do
163
163
  RestClient::Request.new(
164
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
164
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
165
165
  headers: request_headers,
166
166
  method: :delete
167
167
  )
@@ -203,7 +203,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
203
203
  context 'when getting' do
204
204
  let(:request) do
205
205
  RestClient::Request.new(
206
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
206
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
207
207
  headers: request_headers,
208
208
  method: :get
209
209
  )
@@ -217,7 +217,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
217
217
  context 'when posting' do
218
218
  let(:request) do
219
219
  RestClient::Request.new(
220
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
220
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
221
221
  headers: request_headers,
222
222
  method: :post,
223
223
  payload: "hello\nworld"
@@ -258,7 +258,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
258
258
  context 'when putting' do
259
259
  let(:request) do
260
260
  RestClient::Request.new(
261
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
261
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
262
262
  headers: request_headers,
263
263
  method: :put,
264
264
  payload: "hello\nworld"
@@ -299,7 +299,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
299
299
  context 'when deleting' do
300
300
  let(:request) do
301
301
  RestClient::Request.new(
302
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
302
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
303
303
  headers: request_headers,
304
304
  method: :delete
305
305
  )
@@ -315,7 +315,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
315
315
  context 'when getting' do
316
316
  let(:request) do
317
317
  RestClient::Request.new(
318
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
318
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
319
319
  method: :get
320
320
  )
321
321
  end
@@ -332,7 +332,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
332
332
  context 'when posting' do
333
333
  let(:request) do
334
334
  RestClient::Request.new(
335
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
335
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
336
336
  method: :post,
337
337
  payload: "hello\nworld"
338
338
  )
@@ -350,7 +350,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
350
350
  context 'when putting' do
351
351
  let(:request) do
352
352
  RestClient::Request.new(
353
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
353
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
354
354
  method: :put,
355
355
  payload: "hello\nworld"
356
356
  )
@@ -368,7 +368,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
368
368
  context 'when deleting' do
369
369
  let(:request) do
370
370
  RestClient::Request.new(
371
- url: 'http://localhost/resource.xml?foo=bar&bar=foo',
371
+ url: 'https://localhost/resource.xml?foo=bar&bar=foo',
372
372
  method: :delete
373
373
  )
374
374
  end
@@ -388,7 +388,7 @@ describe ApiAuth::RequestDrivers::RestClientRequest do
388
388
  headers = { 'X-Authorization-Content-SHA256' => 'e59ff97941044f85df5297e1c302d260',
389
389
  :content_type => 'text/plain',
390
390
  'Date' => 'Mon, 23 Jan 1984 03:29:56 GMT' }
391
- request = RestClient::Request.new(url: 'http://localhost/resource.xml?foo=bar&bar=foo',
391
+ request = RestClient::Request.new(url: 'https://localhost/resource.xml?foo=bar&bar=foo',
392
392
  headers: headers,
393
393
  method: :put)
394
394
  ApiAuth.sign!(request, 'some access id', 'some secret key')
data/spec/spec_helper.rb CHANGED
@@ -2,10 +2,14 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
2
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
3
  require 'rspec'
4
4
 
5
+ # Fix for Rails 6.1 compatibility issue
6
+ # ActiveSupport 6.1 expects Logger to be available in the global namespace
7
+ require 'logger'
8
+
5
9
  require 'active_support'
6
- require 'active_support/test_case'
10
+ require 'active_support/core_ext/numeric/time'
7
11
  require 'action_controller'
8
- require 'action_controller/test_case'
12
+ require 'action_dispatch'
9
13
  require 'active_resource'
10
14
  require 'active_resource/http_mock'
11
15
 
metadata CHANGED
@@ -1,35 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mauricio Gomes
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2021-11-26 00:00:00.000000000 Z
10
+ date: 2025-10-18 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: actionpack
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - "<"
18
- - !ruby/object:Gem::Version
19
- version: '6.2'
20
- - - ">"
16
+ - - ">="
21
17
  - !ruby/object:Gem::Version
22
- version: '5.0'
18
+ version: '6.0'
23
19
  type: :development
24
20
  prerelease: false
25
21
  version_requirements: !ruby/object:Gem::Requirement
26
22
  requirements:
27
- - - "<"
28
- - !ruby/object:Gem::Version
29
- version: '6.2'
30
- - - ">"
23
+ - - ">="
31
24
  - !ruby/object:Gem::Version
32
- version: '5.0'
25
+ version: '6.0'
33
26
  - !ruby/object:Gem::Dependency
34
27
  name: activeresource
35
28
  requirement: !ruby/object:Gem::Requirement
@@ -48,22 +41,16 @@ dependencies:
48
41
  name: activesupport
49
42
  requirement: !ruby/object:Gem::Requirement
50
43
  requirements:
51
- - - "<"
52
- - !ruby/object:Gem::Version
53
- version: '6.2'
54
- - - ">"
44
+ - - ">="
55
45
  - !ruby/object:Gem::Version
56
- version: '5.0'
46
+ version: '6.0'
57
47
  type: :development
58
48
  prerelease: false
59
49
  version_requirements: !ruby/object:Gem::Requirement
60
50
  requirements:
61
- - - "<"
62
- - !ruby/object:Gem::Version
63
- version: '6.2'
64
- - - ">"
51
+ - - ">="
65
52
  - !ruby/object:Gem::Version
66
- version: '5.0'
53
+ version: '6.0'
67
54
  - !ruby/object:Gem::Dependency
68
55
  name: amatch
69
56
  requirement: !ruby/object:Gem::Requirement
@@ -98,14 +85,34 @@ dependencies:
98
85
  requirements:
99
86
  - - "~>"
100
87
  - !ruby/object:Gem::Version
101
- version: '0.8'
88
+ version: '1.0'
102
89
  type: :development
103
90
  prerelease: false
104
91
  version_requirements: !ruby/object:Gem::Requirement
105
92
  requirements:
106
93
  - - "~>"
107
94
  - !ruby/object:Gem::Version
108
- version: '0.8'
95
+ version: '1.0'
96
+ - !ruby/object:Gem::Dependency
97
+ name: drb
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: 2.0.4
103
+ - - "<"
104
+ - !ruby/object:Gem::Version
105
+ version: 2.0.6
106
+ type: :development
107
+ prerelease: false
108
+ version_requirements: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 2.0.4
113
+ - - "<"
114
+ - !ruby/object:Gem::Version
115
+ version: 2.0.6
109
116
  - !ruby/object:Gem::Dependency
110
117
  name: faraday
111
118
  requirement: !ruby/object:Gem::Requirement
@@ -120,6 +127,20 @@ dependencies:
120
127
  - - ">="
121
128
  - !ruby/object:Gem::Version
122
129
  version: 1.1.0
130
+ - !ruby/object:Gem::Dependency
131
+ name: grape
132
+ requirement: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - "~>"
135
+ - !ruby/object:Gem::Version
136
+ version: '2.0'
137
+ type: :development
138
+ prerelease: false
139
+ version_requirements: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - "~>"
142
+ - !ruby/object:Gem::Version
143
+ version: '2.0'
123
144
  - !ruby/object:Gem::Dependency
124
145
  name: http
125
146
  requirement: !ruby/object:Gem::Requirement
@@ -205,19 +226,19 @@ dependencies:
205
226
  - !ruby/object:Gem::Version
206
227
  version: '2.0'
207
228
  - !ruby/object:Gem::Dependency
208
- name: grape
229
+ name: rexml
209
230
  requirement: !ruby/object:Gem::Requirement
210
231
  requirements:
211
- - - "~>"
232
+ - - ">="
212
233
  - !ruby/object:Gem::Version
213
- version: 1.1.0
234
+ version: '0'
214
235
  type: :development
215
236
  prerelease: false
216
237
  version_requirements: !ruby/object:Gem::Requirement
217
238
  requirements:
218
- - - "~>"
239
+ - - ">="
219
240
  - !ruby/object:Gem::Version
220
- version: 1.1.0
241
+ version: '0'
221
242
  - !ruby/object:Gem::Dependency
222
243
  name: rspec
223
244
  requirement: !ruby/object:Gem::Requirement
@@ -232,34 +253,20 @@ dependencies:
232
253
  - - "~>"
233
254
  - !ruby/object:Gem::Version
234
255
  version: '3.4'
235
- - !ruby/object:Gem::Dependency
236
- name: rexml
237
- requirement: !ruby/object:Gem::Requirement
238
- requirements:
239
- - - ">="
240
- - !ruby/object:Gem::Version
241
- version: '0'
242
- type: :development
243
- prerelease: false
244
- version_requirements: !ruby/object:Gem::Requirement
245
- requirements:
246
- - - ">="
247
- - !ruby/object:Gem::Version
248
- version: '0'
249
256
  - !ruby/object:Gem::Dependency
250
257
  name: rubocop
251
258
  requirement: !ruby/object:Gem::Requirement
252
259
  requirements:
253
- - - ">="
260
+ - - "~>"
254
261
  - !ruby/object:Gem::Version
255
- version: '0'
262
+ version: '1.50'
256
263
  type: :development
257
264
  prerelease: false
258
265
  version_requirements: !ruby/object:Gem::Requirement
259
266
  requirements:
260
- - - ">="
267
+ - - "~>"
261
268
  - !ruby/object:Gem::Version
262
- version: '0'
269
+ version: '1.50'
263
270
  description: Full HMAC auth implementation for use in your gems and Rails apps.
264
271
  email: mauricio@edge14.com
265
272
  executables: []
@@ -280,9 +287,9 @@ files:
280
287
  - Rakefile
281
288
  - VERSION
282
289
  - api_auth.gemspec
283
- - gemfiles/rails_52.gemfile
284
290
  - gemfiles/rails_60.gemfile
285
291
  - gemfiles/rails_61.gemfile
292
+ - gemfiles/rails_70.gemfile
286
293
  - lib/api-auth.rb
287
294
  - lib/api_auth.rb
288
295
  - lib/api_auth/base.rb
@@ -294,13 +301,17 @@ files:
294
301
  - lib/api_auth/request_drivers/action_dispatch.rb
295
302
  - lib/api_auth/request_drivers/curb.rb
296
303
  - lib/api_auth/request_drivers/faraday.rb
304
+ - lib/api_auth/request_drivers/faraday_env.rb
297
305
  - lib/api_auth/request_drivers/grape_request.rb
298
306
  - lib/api_auth/request_drivers/http.rb
299
307
  - lib/api_auth/request_drivers/httpi.rb
300
308
  - lib/api_auth/request_drivers/net_http.rb
301
309
  - lib/api_auth/request_drivers/rack.rb
302
310
  - lib/api_auth/request_drivers/rest_client.rb
311
+ - lib/faraday/api_auth.rb
312
+ - lib/faraday/api_auth/middleware.rb
303
313
  - spec/api_auth_spec.rb
314
+ - spec/faraday_middleware_spec.rb
304
315
  - spec/fixtures/upload.png
305
316
  - spec/headers_spec.rb
306
317
  - spec/helpers_spec.rb
@@ -308,6 +319,7 @@ files:
308
319
  - spec/request_drivers/action_controller_spec.rb
309
320
  - spec/request_drivers/action_dispatch_spec.rb
310
321
  - spec/request_drivers/curb_spec.rb
322
+ - spec/request_drivers/faraday_env_spec.rb
311
323
  - spec/request_drivers/faraday_spec.rb
312
324
  - spec/request_drivers/grape_request_spec.rb
313
325
  - spec/request_drivers/http_spec.rb
@@ -321,7 +333,6 @@ licenses:
321
333
  - MIT
322
334
  metadata:
323
335
  rubygems_mfa_required: 'true'
324
- post_install_message:
325
336
  rdoc_options: []
326
337
  require_paths:
327
338
  - lib
@@ -329,31 +340,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
329
340
  requirements:
330
341
  - - ">="
331
342
  - !ruby/object:Gem::Version
332
- version: 2.5.0
343
+ version: 2.6.0
333
344
  required_rubygems_version: !ruby/object:Gem::Requirement
334
345
  requirements:
335
346
  - - ">="
336
347
  - !ruby/object:Gem::Version
337
348
  version: '0'
338
349
  requirements: []
339
- rubygems_version: 3.1.6
340
- signing_key:
350
+ rubygems_version: 3.6.6
341
351
  specification_version: 4
342
352
  summary: Simple HMAC authentication for your APIs
343
- test_files:
344
- - spec/api_auth_spec.rb
345
- - spec/fixtures/upload.png
346
- - spec/headers_spec.rb
347
- - spec/helpers_spec.rb
348
- - spec/railtie_spec.rb
349
- - spec/request_drivers/action_controller_spec.rb
350
- - spec/request_drivers/action_dispatch_spec.rb
351
- - spec/request_drivers/curb_spec.rb
352
- - spec/request_drivers/faraday_spec.rb
353
- - spec/request_drivers/grape_request_spec.rb
354
- - spec/request_drivers/http_spec.rb
355
- - spec/request_drivers/httpi_spec.rb
356
- - spec/request_drivers/net_http_spec.rb
357
- - spec/request_drivers/rack_spec.rb
358
- - spec/request_drivers/rest_client_spec.rb
359
- - spec/spec_helper.rb
353
+ test_files: []