api-auth 2.5.0 → 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.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +71 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +14 -1
- data/.rubocop_todo.yml +11 -30
- data/Appraisals +12 -18
- data/CHANGELOG.md +18 -0
- data/Gemfile +0 -2
- data/README.md +25 -16
- data/VERSION +1 -1
- data/api_auth.gemspec +14 -7
- data/gemfiles/rails_60.gemfile +5 -5
- data/gemfiles/rails_61.gemfile +5 -7
- data/gemfiles/rails_70.gemfile +9 -0
- data/lib/api_auth/base.rb +4 -4
- data/lib/api_auth/headers.rb +6 -4
- data/lib/api_auth/helpers.rb +4 -0
- data/lib/api_auth/railtie.rb +7 -7
- data/lib/api_auth/request_drivers/action_controller.rb +9 -4
- data/lib/api_auth/request_drivers/faraday_env.rb +102 -0
- data/lib/api_auth.rb +1 -0
- data/lib/faraday/api_auth/middleware.rb +35 -0
- data/lib/faraday/api_auth.rb +8 -0
- data/spec/api_auth_spec.rb +3 -3
- data/spec/faraday_middleware_spec.rb +17 -0
- data/spec/headers_spec.rb +8 -8
- data/spec/railtie_spec.rb +2 -1
- data/spec/request_drivers/action_controller_spec.rb +42 -3
- data/spec/request_drivers/action_dispatch_spec.rb +132 -8
- data/spec/request_drivers/faraday_env_spec.rb +188 -0
- data/spec/request_drivers/http_spec.rb +1 -1
- data/spec/request_drivers/httpi_spec.rb +2 -2
- data/spec/request_drivers/rest_client_spec.rb +19 -19
- data/spec/spec_helper.rb +6 -2
- metadata +70 -61
- data/.travis.yml +0 -30
- data/gemfiles/http4.gemfile +0 -7
- data/gemfiles/rails_52.gemfile +0 -9
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe ApiAuth::RequestDrivers::FaradayEnv do
|
|
4
|
+
let(:timestamp) { Time.now.utc.httpdate }
|
|
5
|
+
|
|
6
|
+
let(:request) do
|
|
7
|
+
Faraday::Env.new(verb, body, URI(uri), {}, Faraday::Utils::Headers.new(headers))
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
let(:verb) { :put }
|
|
11
|
+
let(:uri) { 'https://localhost/resource.xml?foo=bar&bar=foo' }
|
|
12
|
+
let(:body) { "hello\nworld" }
|
|
13
|
+
|
|
14
|
+
let(:headers) do
|
|
15
|
+
{
|
|
16
|
+
'Authorization' => 'APIAuth 1044:12345',
|
|
17
|
+
'X-Authorization-Content-SHA256' => '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=',
|
|
18
|
+
'content-type' => 'text/plain',
|
|
19
|
+
'date' => timestamp
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
subject(:driven_request) { described_class.new(request) }
|
|
24
|
+
|
|
25
|
+
describe 'getting headers correctly' do
|
|
26
|
+
it 'gets the content_type' do
|
|
27
|
+
expect(driven_request.content_type).to eq('text/plain')
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
context 'without Content-Type' do
|
|
31
|
+
let(:headers) { {} }
|
|
32
|
+
|
|
33
|
+
it 'defaults to url-encoded' do
|
|
34
|
+
expect(driven_request.content_type).to eq 'application/x-www-form-urlencoded'
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
it 'gets the content_hash' do
|
|
39
|
+
expect(driven_request.content_hash).to eq('47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=')
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
it 'gets the request_uri' do
|
|
43
|
+
expect(driven_request.request_uri).to eq('/resource.xml?foo=bar&bar=foo')
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it 'gets the timestamp' do
|
|
47
|
+
expect(driven_request.timestamp).to eq(timestamp)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
it 'gets the authorization_header' do
|
|
51
|
+
expect(driven_request.authorization_header).to eq('APIAuth 1044:12345')
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
describe '#calculated_hash' do
|
|
55
|
+
it 'calculates hash from the body' do
|
|
56
|
+
expect(driven_request.calculated_hash).to eq('JsYKYdAdtYNspw/v1EpqAWYgQTyO9fJZpsVhLU9507g=')
|
|
57
|
+
expect(driven_request.body.bytesize).to eq(11)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
context 'no body' do
|
|
61
|
+
let(:body) { nil }
|
|
62
|
+
|
|
63
|
+
it 'treats no body as empty string' do
|
|
64
|
+
expect(driven_request.calculated_hash).to eq('47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=')
|
|
65
|
+
expect(driven_request.body.bytesize).to eq(0)
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
context 'multipart content' do
|
|
70
|
+
let(:body) { File.new('spec/fixtures/upload.png') }
|
|
71
|
+
|
|
72
|
+
it 'calculates correctly for multipart content' do
|
|
73
|
+
expect(driven_request.calculated_hash).to eq('AlKDe7kjMQhuKgKuNG8I7GA93MasHcaVJkJLaUT7+dY=')
|
|
74
|
+
expect(driven_request.body.bytesize).to eq(5112)
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
describe 'http_method' do
|
|
80
|
+
context 'when put request' do
|
|
81
|
+
let(:verb) { :put }
|
|
82
|
+
|
|
83
|
+
it 'returns upcased put' do
|
|
84
|
+
expect(driven_request.http_method).to eq('PUT')
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
context 'when get request' do
|
|
89
|
+
let(:verb) { :get }
|
|
90
|
+
|
|
91
|
+
it 'returns upcased get' do
|
|
92
|
+
expect(driven_request.http_method).to eq('GET')
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
describe 'setting headers correctly' do
|
|
99
|
+
let(:headers) do
|
|
100
|
+
{
|
|
101
|
+
'content-type' => 'text/plain'
|
|
102
|
+
}
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
describe '#populate_content_hash' do
|
|
106
|
+
context 'when request type has no body' do
|
|
107
|
+
let(:verb) { :get }
|
|
108
|
+
|
|
109
|
+
it "doesn't populate content hash" do
|
|
110
|
+
driven_request.populate_content_hash
|
|
111
|
+
expect(request.request_headers['X-Authorization-Content-SHA256']).to be_nil
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
context 'when request type has a body' do
|
|
116
|
+
let(:verb) { :put }
|
|
117
|
+
|
|
118
|
+
it 'populates content hash' do
|
|
119
|
+
driven_request.populate_content_hash
|
|
120
|
+
expect(request.request_headers['X-Authorization-Content-SHA256']).to eq('JsYKYdAdtYNspw/v1EpqAWYgQTyO9fJZpsVhLU9507g=')
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
it 'refreshes the cached headers' do
|
|
124
|
+
driven_request.populate_content_hash
|
|
125
|
+
expect(driven_request.content_hash).to eq('JsYKYdAdtYNspw/v1EpqAWYgQTyO9fJZpsVhLU9507g=')
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
describe '#set_date' do
|
|
131
|
+
before do
|
|
132
|
+
allow(Time).to receive_message_chain(:now, :utc, :httpdate).and_return(timestamp)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
it 'sets the date header of the request' do
|
|
136
|
+
driven_request.set_date
|
|
137
|
+
expect(request.request_headers['DATE']).to eq(timestamp)
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
describe '#set_auth_header' do
|
|
142
|
+
it 'sets the auth header' do
|
|
143
|
+
driven_request.set_auth_header('APIAuth 1044:54321')
|
|
144
|
+
expect(request.request_headers['Authorization']).to eq('APIAuth 1044:54321')
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
describe 'content_hash_mismatch?' do
|
|
150
|
+
context 'when request type has no body' do
|
|
151
|
+
let(:verb) { :get }
|
|
152
|
+
|
|
153
|
+
it 'is false' do
|
|
154
|
+
expect(driven_request.content_hash_mismatch?).to be false
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
context 'when request type has a body' do
|
|
159
|
+
let(:verb) { :put }
|
|
160
|
+
|
|
161
|
+
context 'when calculated matches sent' do
|
|
162
|
+
before do
|
|
163
|
+
request.request_headers['X-Authorization-Content-SHA256'] = 'JsYKYdAdtYNspw/v1EpqAWYgQTyO9fJZpsVhLU9507g='
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
it 'is false' do
|
|
167
|
+
expect(driven_request.content_hash_mismatch?).to be false
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
context "when calculated doesn't match sent" do
|
|
172
|
+
before do
|
|
173
|
+
request['X-Authorization-Content-SHA256'] = '3'
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
it 'is true' do
|
|
177
|
+
expect(driven_request.content_hash_mismatch?).to be true
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
describe 'fetch_headers' do
|
|
184
|
+
it 'returns request headers' do
|
|
185
|
+
expect(driven_request.fetch_headers).to include('CONTENT-TYPE' => 'text/plain')
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
end
|
|
@@ -13,7 +13,7 @@ describe ApiAuth::RequestDrivers::HttpRequest do
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
let(:verb) { :put }
|
|
16
|
-
let(:uri) { '
|
|
16
|
+
let(:uri) { 'https://localhost/resource.xml?foo=bar&bar=foo' }
|
|
17
17
|
let(:body) { "hello\nworld" }
|
|
18
18
|
|
|
19
19
|
let(:headers) do
|
|
@@ -4,7 +4,7 @@ describe ApiAuth::RequestDrivers::HttpiRequest do
|
|
|
4
4
|
let(:timestamp) { Time.now.utc.httpdate }
|
|
5
5
|
|
|
6
6
|
let(:request) do
|
|
7
|
-
httpi_request = HTTPI::Request.new('
|
|
7
|
+
httpi_request = HTTPI::Request.new('https://localhost/resource.xml?foo=bar&bar=foo')
|
|
8
8
|
httpi_request.headers.merge!('Authorization' => 'APIAuth 1044:12345',
|
|
9
9
|
'X-Authorization-Content-SHA256' => '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=',
|
|
10
10
|
'content-type' => 'text/plain',
|
|
@@ -56,7 +56,7 @@ describe ApiAuth::RequestDrivers::HttpiRequest do
|
|
|
56
56
|
|
|
57
57
|
describe 'setting headers correctly' do
|
|
58
58
|
let(:request) do
|
|
59
|
-
httpi_request = HTTPI::Request.new('
|
|
59
|
+
httpi_request = HTTPI::Request.new('https://localhost/resource.xml?foo=bar&bar=foo')
|
|
60
60
|
httpi_request.headers['content-type'] = 'text/plain'
|
|
61
61
|
httpi_request
|
|
62
62
|
end
|
|
@@ -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) { '
|
|
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: '
|
|
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('
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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/
|
|
10
|
+
require 'active_support/core_ext/numeric/time'
|
|
7
11
|
require 'action_controller'
|
|
8
|
-
require '
|
|
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.
|
|
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:
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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
|
|
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
|
|
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:
|
|
229
|
+
name: rexml
|
|
209
230
|
requirement: !ruby/object:Gem::Requirement
|
|
210
231
|
requirements:
|
|
211
|
-
- - "
|
|
232
|
+
- - ">="
|
|
212
233
|
- !ruby/object:Gem::Version
|
|
213
|
-
version:
|
|
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:
|
|
241
|
+
version: '0'
|
|
221
242
|
- !ruby/object:Gem::Dependency
|
|
222
243
|
name: rspec
|
|
223
244
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -233,19 +254,19 @@ dependencies:
|
|
|
233
254
|
- !ruby/object:Gem::Version
|
|
234
255
|
version: '3.4'
|
|
235
256
|
- !ruby/object:Gem::Dependency
|
|
236
|
-
name:
|
|
257
|
+
name: rubocop
|
|
237
258
|
requirement: !ruby/object:Gem::Requirement
|
|
238
259
|
requirements:
|
|
239
|
-
- - "
|
|
260
|
+
- - "~>"
|
|
240
261
|
- !ruby/object:Gem::Version
|
|
241
|
-
version: '
|
|
262
|
+
version: '1.50'
|
|
242
263
|
type: :development
|
|
243
264
|
prerelease: false
|
|
244
265
|
version_requirements: !ruby/object:Gem::Requirement
|
|
245
266
|
requirements:
|
|
246
|
-
- - "
|
|
267
|
+
- - "~>"
|
|
247
268
|
- !ruby/object:Gem::Version
|
|
248
|
-
version: '
|
|
269
|
+
version: '1.50'
|
|
249
270
|
description: Full HMAC auth implementation for use in your gems and Rails apps.
|
|
250
271
|
email: mauricio@edge14.com
|
|
251
272
|
executables: []
|
|
@@ -253,11 +274,11 @@ extensions: []
|
|
|
253
274
|
extra_rdoc_files: []
|
|
254
275
|
files:
|
|
255
276
|
- ".document"
|
|
277
|
+
- ".github/workflows/main.yml"
|
|
256
278
|
- ".gitignore"
|
|
257
279
|
- ".rspec"
|
|
258
280
|
- ".rubocop.yml"
|
|
259
281
|
- ".rubocop_todo.yml"
|
|
260
|
-
- ".travis.yml"
|
|
261
282
|
- Appraisals
|
|
262
283
|
- CHANGELOG.md
|
|
263
284
|
- Gemfile
|
|
@@ -266,10 +287,9 @@ files:
|
|
|
266
287
|
- Rakefile
|
|
267
288
|
- VERSION
|
|
268
289
|
- api_auth.gemspec
|
|
269
|
-
- gemfiles/http4.gemfile
|
|
270
|
-
- gemfiles/rails_52.gemfile
|
|
271
290
|
- gemfiles/rails_60.gemfile
|
|
272
291
|
- gemfiles/rails_61.gemfile
|
|
292
|
+
- gemfiles/rails_70.gemfile
|
|
273
293
|
- lib/api-auth.rb
|
|
274
294
|
- lib/api_auth.rb
|
|
275
295
|
- lib/api_auth/base.rb
|
|
@@ -281,13 +301,17 @@ files:
|
|
|
281
301
|
- lib/api_auth/request_drivers/action_dispatch.rb
|
|
282
302
|
- lib/api_auth/request_drivers/curb.rb
|
|
283
303
|
- lib/api_auth/request_drivers/faraday.rb
|
|
304
|
+
- lib/api_auth/request_drivers/faraday_env.rb
|
|
284
305
|
- lib/api_auth/request_drivers/grape_request.rb
|
|
285
306
|
- lib/api_auth/request_drivers/http.rb
|
|
286
307
|
- lib/api_auth/request_drivers/httpi.rb
|
|
287
308
|
- lib/api_auth/request_drivers/net_http.rb
|
|
288
309
|
- lib/api_auth/request_drivers/rack.rb
|
|
289
310
|
- lib/api_auth/request_drivers/rest_client.rb
|
|
311
|
+
- lib/faraday/api_auth.rb
|
|
312
|
+
- lib/faraday/api_auth/middleware.rb
|
|
290
313
|
- spec/api_auth_spec.rb
|
|
314
|
+
- spec/faraday_middleware_spec.rb
|
|
291
315
|
- spec/fixtures/upload.png
|
|
292
316
|
- spec/headers_spec.rb
|
|
293
317
|
- spec/helpers_spec.rb
|
|
@@ -295,6 +319,7 @@ files:
|
|
|
295
319
|
- spec/request_drivers/action_controller_spec.rb
|
|
296
320
|
- spec/request_drivers/action_dispatch_spec.rb
|
|
297
321
|
- spec/request_drivers/curb_spec.rb
|
|
322
|
+
- spec/request_drivers/faraday_env_spec.rb
|
|
298
323
|
- spec/request_drivers/faraday_spec.rb
|
|
299
324
|
- spec/request_drivers/grape_request_spec.rb
|
|
300
325
|
- spec/request_drivers/http_spec.rb
|
|
@@ -304,9 +329,10 @@ files:
|
|
|
304
329
|
- spec/request_drivers/rest_client_spec.rb
|
|
305
330
|
- spec/spec_helper.rb
|
|
306
331
|
homepage: https://github.com/mgomes/api_auth
|
|
307
|
-
licenses:
|
|
308
|
-
|
|
309
|
-
|
|
332
|
+
licenses:
|
|
333
|
+
- MIT
|
|
334
|
+
metadata:
|
|
335
|
+
rubygems_mfa_required: 'true'
|
|
310
336
|
rdoc_options: []
|
|
311
337
|
require_paths:
|
|
312
338
|
- lib
|
|
@@ -314,31 +340,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
314
340
|
requirements:
|
|
315
341
|
- - ">="
|
|
316
342
|
- !ruby/object:Gem::Version
|
|
317
|
-
version: 2.
|
|
343
|
+
version: 2.6.0
|
|
318
344
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
319
345
|
requirements:
|
|
320
346
|
- - ">="
|
|
321
347
|
- !ruby/object:Gem::Version
|
|
322
348
|
version: '0'
|
|
323
349
|
requirements: []
|
|
324
|
-
rubygems_version: 3.
|
|
325
|
-
signing_key:
|
|
350
|
+
rubygems_version: 3.6.6
|
|
326
351
|
specification_version: 4
|
|
327
352
|
summary: Simple HMAC authentication for your APIs
|
|
328
|
-
test_files:
|
|
329
|
-
- spec/api_auth_spec.rb
|
|
330
|
-
- spec/fixtures/upload.png
|
|
331
|
-
- spec/headers_spec.rb
|
|
332
|
-
- spec/helpers_spec.rb
|
|
333
|
-
- spec/railtie_spec.rb
|
|
334
|
-
- spec/request_drivers/action_controller_spec.rb
|
|
335
|
-
- spec/request_drivers/action_dispatch_spec.rb
|
|
336
|
-
- spec/request_drivers/curb_spec.rb
|
|
337
|
-
- spec/request_drivers/faraday_spec.rb
|
|
338
|
-
- spec/request_drivers/grape_request_spec.rb
|
|
339
|
-
- spec/request_drivers/http_spec.rb
|
|
340
|
-
- spec/request_drivers/httpi_spec.rb
|
|
341
|
-
- spec/request_drivers/net_http_spec.rb
|
|
342
|
-
- spec/request_drivers/rack_spec.rb
|
|
343
|
-
- spec/request_drivers/rest_client_spec.rb
|
|
344
|
-
- spec/spec_helper.rb
|
|
353
|
+
test_files: []
|