ey_api_hmac 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ey_api_hmac/sso.rb +3 -0
- data/lib/ey_api_hmac/version.rb +1 -1
- data/spec/sso_spec.rb +6 -0
- metadata +3 -3
data/lib/ey_api_hmac/sso.rb
CHANGED
@@ -31,6 +31,9 @@ module EY
|
|
31
31
|
access_key_id = md[1]
|
32
32
|
hmac = md[2]
|
33
33
|
secret = lookup.call(access_key_id)
|
34
|
+
unless secret
|
35
|
+
raise HmacAuthFail, "Authentication failed (lookup didn't find #{access_key_id})"
|
36
|
+
end
|
34
37
|
unless authenticated?(url, access_key_id, secret)
|
35
38
|
raise HmacAuthFail, "Authentication failed for #{access_key_id}"
|
36
39
|
end
|
data/lib/ey_api_hmac/version.rb
CHANGED
data/spec/sso_spec.rb
CHANGED
@@ -54,6 +54,12 @@ describe EY::ApiHMAC do
|
|
54
54
|
}.should raise_error(EY::ApiHMAC::HmacAuthFail)
|
55
55
|
end
|
56
56
|
|
57
|
+
it "unauthorized when lookup fails" do
|
58
|
+
lambda{
|
59
|
+
EY::ApiHMAC::SSO.authenticate!("http://example.com/sign_test"){|x| false}
|
60
|
+
}.should raise_error(EY::ApiHMAC::HmacAuthFail)
|
61
|
+
end
|
62
|
+
|
57
63
|
it "unauthorized with crappy urls" do
|
58
64
|
lambda{
|
59
65
|
EY::ApiHMAC::SSO.authenticate!("http://example.com/sign_test", &@auth_key_lookup)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ey_api_hmac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 7
|
10
|
+
version: 0.4.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Jacob Burkhart & Thorben Schr\xC3\xB6der & David Calavera & others"
|