rack-simple_auth 0.0.5 → 0.0.6
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/lib/rack/simple_auth/hmac.rb +7 -5
- data/lib/rack/simple_auth/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9821660c1ff4703956f11cd39f67f3a09f98a9ad
|
4
|
+
data.tar.gz: 6cab22a6d00d70e62411e28ec042def714c347d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84068e6c7c66de24a364c6cc607c01ec65ec7d9ade78c8a7d3ab6a720b324084b73a3c0aa472afb7706b4ae510e82f5e8b63c160df94d4bfe1fb526e19eac491
|
7
|
+
data.tar.gz: 4fed2416ba52add9e396e692a12c327d78f238d97fbf9829b496d8ff330e2b55313d3ea78780227b053626a6b1b4ce9f8c85ce371d6d891d8819d64d115152b6
|
@@ -32,6 +32,8 @@ module Rack
|
|
32
32
|
# @param [Rack::Request] request [current Request]
|
33
33
|
# @return [boolean] ValidationStatus [If authorized returns true, else false]
|
34
34
|
def valid?(request)
|
35
|
+
@hash_array = build_allowed_messages(request)
|
36
|
+
|
35
37
|
if request.env['HTTP_AUTHORIZATION'].nil?
|
36
38
|
log(request)
|
37
39
|
|
@@ -42,8 +44,6 @@ module Rack
|
|
42
44
|
message_hash = auth_array[0]
|
43
45
|
signature = auth_array[1]
|
44
46
|
|
45
|
-
@hash_array = build_allowed_messages(request)
|
46
|
-
|
47
47
|
if signature == @signature && @hash_array.include?(message_hash)
|
48
48
|
true
|
49
49
|
else
|
@@ -106,10 +106,12 @@ module Rack
|
|
106
106
|
|
107
107
|
log = "#{Time.new} - #{method} #{path} - 400 Unauthorized - HTTP_AUTHORIZATION: #{request.env['HTTP_AUTHORIZATION']}\n"
|
108
108
|
log << "Auth Message Config: #{@config[request.request_method]}\n"
|
109
|
-
log << "Allowed Encrypted Messages:\n"
|
110
109
|
|
111
|
-
@hash_array
|
112
|
-
log << "
|
110
|
+
if @hash_array
|
111
|
+
log << "Allowed Encrypted Messages:\n"
|
112
|
+
@hash_array.each do |hash|
|
113
|
+
log << "#{hash}\n"
|
114
|
+
end
|
113
115
|
end
|
114
116
|
|
115
117
|
log << "Auth Signature: #{@signature}"
|