authograph 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.
- checksums.yaml +4 -4
- data/lib/authograph/adapters/http.rb +9 -4
- data/lib/authograph/signer.rb +7 -8
- data/lib/authograph/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: 5a009a88fac93d49a6386eb963bd7e540ab904c3
|
4
|
+
data.tar.gz: 299582d4a1eb05ababa92219e1a6c4883a327d88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a61ca58c96985b2357ba5af9a3ea503869c51836edfe9bb3bd84c818c9974cd8e5ba1b8f3b14e39086193d566fc033a03f35ed4ed62461efb827d069d8eb5c7c
|
7
|
+
data.tar.gz: 1c032e7dad769f70a81fc0186f6b6de6d122c7b8be9829bf16a72e10d013301beb5bd304ab4a25ea030e47ad8dd272c278c4a6dc9cd6625c02c9a79d1a27c436
|
@@ -25,10 +25,15 @@ module Authograph::Adapters
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def body
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
if !@request.body_stream.nil?
|
29
|
+
data = @request.body_stream.read
|
30
|
+
@request.body_stream.rewind
|
31
|
+
data
|
32
|
+
elsif !@request.body.nil?
|
33
|
+
@request.body
|
34
|
+
else
|
35
|
+
''
|
36
|
+
end
|
32
37
|
end
|
33
38
|
end
|
34
39
|
end
|
data/lib/authograph/signer.rb
CHANGED
@@ -87,22 +87,21 @@ module Authograph
|
|
87
87
|
def build_payload(_request)
|
88
88
|
parts = [
|
89
89
|
_request.method,
|
90
|
-
_request.path
|
91
|
-
_request.content_type || '',
|
92
|
-
body_md5(_request)
|
90
|
+
_request.path
|
93
91
|
]
|
94
92
|
|
93
|
+
if %w[POST PUT].include?(_request.method)
|
94
|
+
parts << _request.content_type || ''
|
95
|
+
parts << body_md5(_request)
|
96
|
+
end
|
97
|
+
|
95
98
|
# extra headers to be considered
|
96
99
|
@sign_headers.each { |h| parts << (_request.get_header(h) || '') }
|
97
100
|
parts.join "\n"
|
98
101
|
end
|
99
102
|
|
100
103
|
def body_md5(_request)
|
101
|
-
|
102
|
-
Digest::MD5.base64digest _request.body
|
103
|
-
else
|
104
|
-
''
|
105
|
-
end
|
104
|
+
Digest::MD5.base64digest _request.body
|
106
105
|
end
|
107
106
|
end
|
108
107
|
end
|
data/lib/authograph/version.rb
CHANGED