bazaar_sources 0.2.2 → 0.2.3
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/lib/api_helpers/amazon.rb +5 -3
- metadata +3 -3
data/lib/api_helpers/amazon.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'hpricot'
|
2
2
|
require 'open-uri'
|
3
3
|
require 'cgi'
|
4
|
-
require '
|
4
|
+
require 'openssl'
|
5
5
|
|
6
6
|
module Amazon
|
7
7
|
class AsinNotFoundError < StandardError
|
@@ -596,8 +596,10 @@ module Amazon
|
|
596
596
|
params_string.gsub!('+', '%20')
|
597
597
|
|
598
598
|
query = "GET\n#{host}\n#{path}\n#{params_string}"
|
599
|
-
|
600
|
-
|
599
|
+
# hmac = Digest::HMAC.new(AMAZON_SECRET_ACCESS_KEY, Digest::SHA256).digest(query)
|
600
|
+
digest = OpenSSL::Digest::Digest.new("sha256")
|
601
|
+
hmac = OpenSSL::HMAC.digest(digest, AMAZON_SECRET_ACCESS_KEY, query)
|
602
|
+
|
601
603
|
base64_hmac = Base64.encode64(hmac).chomp
|
602
604
|
signature = CGI::escape(base64_hmac)
|
603
605
|
"http://#{host}#{path}?#{params_string}&Signature=#{signature}"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bazaar_sources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- chris mcc
|