jeff 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/lib/jeff.rb +4 -6
- data/lib/jeff/secret.rb +2 -7
- data/lib/jeff/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78e3b7429c097aed4c006d56957ee08dc3899bac
|
4
|
+
data.tar.gz: 074fd9b3fd37d8dd459144096e885333b226b915
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 258eb55a6d73f9163e9e269d067928e637f7fbafda2870fa4a612730905f558f3a0663736b8bf438ecaf44e142824b1654fad046226c72bb354e6c2385de8f80
|
7
|
+
data.tar.gz: 145dc591f02cd90e40e0d5458c1d54ea5b3f8ffa5126484cf67789cb151f5bdda4511c5d3012943f2599fcd83e58a465b996a7bd3ab1c2af395a15f77167de32
|
data/README.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
# Jeff
|
2
2
|
|
3
|
-
Jeff
|
3
|
+
[Serially or in parallel, Monsieur Jeff will diligently sign your Amazon Web
|
4
|
+
Services requests.][sign]
|
5
|
+
|
6
|
+
:heart::heart::heart:
|
4
7
|
|
5
8
|
![jeff][jeff]
|
6
9
|
|
7
10
|
[sign]: http://docs.amazonwebservices.com/general/latest/gr/signature-version-2.html
|
8
|
-
[jeff]: http://f.cl.ly/items/
|
11
|
+
[jeff]: http://f.cl.ly/items/0i1H1h071z1K0N3V2x06/bezos.png
|
data/lib/jeff.rb
CHANGED
@@ -101,7 +101,7 @@ module Jeff
|
|
101
101
|
Excon::HTTP_VERBS.each do |method|
|
102
102
|
eval <<-DEF
|
103
103
|
def #{method}(opts = {})
|
104
|
-
opts.update
|
104
|
+
opts.update(:method => :#{method}, :omit_default_port => true)
|
105
105
|
connection.request(build_options(opts))
|
106
106
|
end
|
107
107
|
DEF
|
@@ -110,10 +110,8 @@ module Jeff
|
|
110
110
|
private
|
111
111
|
|
112
112
|
def build_options(opts)
|
113
|
-
opts[:headers] ||= {}
|
114
|
-
opts[:headers].update('Host' => connection.data[:host])
|
115
|
-
|
116
113
|
if opts[:body]
|
114
|
+
opts[:headers] ||= {}
|
117
115
|
opts[:headers].update('Content-MD5' => calculate_md5(opts[:body]))
|
118
116
|
end
|
119
117
|
|
@@ -141,10 +139,10 @@ module Jeff
|
|
141
139
|
].join("\n")
|
142
140
|
signature = secret.sign(string_to_sign)
|
143
141
|
|
144
|
-
opts.update
|
142
|
+
opts.update(query: [
|
145
143
|
query,
|
146
144
|
"Signature=#{escape(signature)}"
|
147
|
-
].join('&')
|
145
|
+
].join('&'))
|
148
146
|
end
|
149
147
|
|
150
148
|
module ClassMethods
|
data/lib/jeff/secret.rb
CHANGED
@@ -10,13 +10,8 @@ module Jeff
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def sign(message)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def digest(message)
|
19
|
-
OpenSSL::HMAC.digest(SHA256, @key, message)
|
13
|
+
digest = OpenSSL::HMAC.digest(SHA256, @key, message)
|
14
|
+
Base64.encode64(digest).chomp
|
20
15
|
end
|
21
16
|
end
|
22
17
|
end
|
data/lib/jeff/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jeff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hakan Ensari
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|