zipmark 0.0.1.beta.5 → 0.0.1.beta.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.
- data/lib/zipmark/callback.rb +2 -2
- data/lib/zipmark/client.rb +6 -0
- data/lib/zipmark/entity.rb +4 -0
- data/lib/zipmark/iterator.rb +0 -2
- data/lib/zipmark/util.rb +8 -0
- data/lib/zipmark/version.rb +1 -1
- metadata +2 -2
data/lib/zipmark/callback.rb
CHANGED
@@ -67,8 +67,8 @@ module Zipmark
|
|
67
67
|
|
68
68
|
def validate_authorization
|
69
69
|
string_to_sign = ["POST",hashed_content,'application/json',date.rfc2822,uri,application_identifier].join("\n")
|
70
|
-
signed_string = Base64.strict_encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), secret, string_to_sign))
|
71
|
-
valid_authorization = "ZM #{Base64.strict_encode64(identifier)}:#{signed_string}"
|
70
|
+
signed_string = Base64.strict_encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), secret, string_to_sign)).chomp
|
71
|
+
valid_authorization = "ZM #{Base64.strict_encode64(identifier).chomp}:#{signed_string}"
|
72
72
|
if authorization_header == valid_authorization
|
73
73
|
return true
|
74
74
|
else
|
data/lib/zipmark/client.rb
CHANGED
@@ -10,6 +10,12 @@ module Zipmark
|
|
10
10
|
# Public: Gets the Adapter.
|
11
11
|
attr_reader :adapter
|
12
12
|
|
13
|
+
begin
|
14
|
+
require 'json'
|
15
|
+
rescue LoadError => e
|
16
|
+
puts 'You must have a json library installed to use Zipmark'
|
17
|
+
end
|
18
|
+
|
13
19
|
# Public: Initialize a Zipmark Client
|
14
20
|
#
|
15
21
|
# options - Hash options used to configure the Client (default: {})
|
data/lib/zipmark/entity.rb
CHANGED
data/lib/zipmark/iterator.rb
CHANGED
data/lib/zipmark/util.rb
CHANGED
data/lib/zipmark/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zipmark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.beta.
|
4
|
+
version: 0.0.1.beta.6
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-04 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Simple Client Library to connect to the Zipmark API
|
15
15
|
email: jake@zipmark.com
|