auth-hmac 1.0.0 → 1.0.1
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.
- data/History.txt +5 -1
- data/lib/auth-hmac.rb +1 -1
- data/lib/auth-hmac/version.rb +1 -1
- data/spec/auth-hmac_spec.rb +29 -0
- metadata +2 -2
data/History.txt
CHANGED
data/lib/auth-hmac.rb
CHANGED
data/lib/auth-hmac/version.rb
CHANGED
data/spec/auth-hmac_spec.rb
CHANGED
@@ -228,6 +228,35 @@ describe AuthHMAC do
|
|
228
228
|
def rescue_action(e) raise(e) end
|
229
229
|
end
|
230
230
|
|
231
|
+
class NilCredentialsController < ActionController::Base
|
232
|
+
with_auth_hmac nil
|
233
|
+
before_filter :force_auth
|
234
|
+
|
235
|
+
def index
|
236
|
+
render :nothing => true, :status => :ok
|
237
|
+
end
|
238
|
+
|
239
|
+
def public
|
240
|
+
render :nothing => true, :status => :ok
|
241
|
+
end
|
242
|
+
|
243
|
+
def rescue_action(e) raise(e) end
|
244
|
+
|
245
|
+
private
|
246
|
+
def force_auth
|
247
|
+
hmac_authenticated?
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
it "should not raise an error when credentials are nil" do
|
252
|
+
request = ActionController::TestRequest.new
|
253
|
+
request.action = 'index'
|
254
|
+
request.path = "/index"
|
255
|
+
lambda do
|
256
|
+
NilCredentialsController.new.process(request, ActionController::TestResponse.new).code.should == "200"
|
257
|
+
end.should_not raise_error
|
258
|
+
end
|
259
|
+
|
231
260
|
it "should allow a request with the proper hmac" do
|
232
261
|
request = ActionController::TestRequest.new
|
233
262
|
request.env['Authorization'] = "AuthHMAC access key 1:6BVEVfAyIDoI3K+WallRMnDxROQ="
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auth-hmac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Geoghegan
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-08-
|
12
|
+
date: 2008-08-22 00:00:00 +09:30
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|