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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cfe902c5b3047b523b062b2d60fef3fd9fc0a9c4
4
- data.tar.gz: 3ee4e4b1218dc82a02f9861eaaed85469a49d9b9
3
+ metadata.gz: 78e3b7429c097aed4c006d56957ee08dc3899bac
4
+ data.tar.gz: 074fd9b3fd37d8dd459144096e885333b226b915
5
5
  SHA512:
6
- metadata.gz: 6eb8b274d4af06e24c873727414512702f689f9261cb97b16d9106f3ccdaaf3e452f27d105cce9815b260cba37c148177e676d013d205db2e513b8b07f33f953
7
- data.tar.gz: 7d89bff0a31977696c623bc854f88689bb6dd17072276191b99150b5e83d681796221674336bb05a02d47d2afbb71bc2e6dbdd76bce77be9577f449216886b66
6
+ metadata.gz: 258eb55a6d73f9163e9e269d067928e637f7fbafda2870fa4a612730905f558f3a0663736b8bf438ecaf44e142824b1654fad046226c72bb354e6c2385de8f80
7
+ data.tar.gz: 145dc591f02cd90e40e0d5458c1d54ea5b3f8ffa5126484cf67789cb151f5bdda4511c5d3012943f2599fcd83e58a465b996a7bd3ab1c2af395a15f77167de32
data/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # Jeff
2
2
 
3
- Jeff [signs][sign] Amazon Web Services requests.
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/0a3R3J0k1R2f423k1q2l/jeff.jpg
11
+ [jeff]: http://f.cl.ly/items/0i1H1h071z1K0N3V2x06/bezos.png
@@ -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 :method => :#{method}
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 query: [
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
@@ -10,13 +10,8 @@ module Jeff
10
10
  end
11
11
 
12
12
  def sign(message)
13
- Base64.encode64(digest(message)).chomp
14
- end
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
@@ -1,3 +1,3 @@
1
1
  module Jeff
2
- VERSION = '0.6.2'
2
+ VERSION = '0.6.3'
3
3
  end
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.2
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-23 00:00:00.000000000 Z
11
+ date: 2013-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon