aws-sigv4 1.0.2 → 1.0.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aws-sigv4/signer.rb +13 -13
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e851448c736298e3747c738f65f56f24a8372e24
4
- data.tar.gz: 486465ce9e3d77e9bacb4ec0988a776fbe0e0731
3
+ metadata.gz: 230c5aa7c49bded384ea0cc96ecbc3cdc6d3bec7
4
+ data.tar.gz: b1b194fa0740e2588a94dd9a0c66f7c5f4198f70
5
5
  SHA512:
6
- metadata.gz: 442874f160c708b314b3f6ff3a3323a066831fe4ae0cefae3455d3149bedd02e168f6f90c6d357c65d07b28c9a8c9350ec407c8d2f49fd025a9a1921b857c407
7
- data.tar.gz: 92742d9c385a2e2de49cf200567cb2eb8e6401c88ae0b4fa724e6d3e7d00f54e7640a084caf92650d8d8e4384cceb3218fc99df96e8c106e46bba9f9e727250e
6
+ metadata.gz: 53016c5f240e3154815b4f172158a5a29c84ef7e912e756f8f5b53e619854bbc30a041358b5be4a8fc82708cbbb12c549f31c843421cbf5a0e6c3f2e0537ab23
7
+ data.tar.gz: 4ff775b31b1603a3eaf5206cb0c59bdac3599a95973626d746d81ec21b8e51db46cdc9fd8cb6a7008afaeaec5bb6ac6af6a12b5317ba60e2c64303424235a63d
@@ -166,11 +166,11 @@ module Aws
166
166
  # )
167
167
  #
168
168
  # # Apply the following hash of headers to your HTTP request
169
- # signature.headers['Host']
170
- # signature.headers['X-Amz-Date']
171
- # signature.headers['X-Amz-Security-Token']
172
- # signature.headers['X-Amz-Content-Sha256']
173
- # signature.headers['Authorization']
169
+ # signature.headers['host']
170
+ # signature.headers['x-amz-date']
171
+ # signature.headers['x-amz-security-token']
172
+ # signature.headers['x-amz-content-sha256']
173
+ # signature.headers['authorization']
174
174
  #
175
175
  # In addition to computing the signature headers, the canonicalized
176
176
  # request, string to sign and content sha256 checksum are also available.
@@ -192,7 +192,7 @@ module Aws
192
192
  # to sign. If the 'X-Amz-Content-Sha256' header is set, the `:body`
193
193
  # is optional and will not be read.
194
194
  #
195
- # @option request [otpional, String, IO] :body ('') The HTTP request body.
195
+ # @option request [optional, String, IO] :body ('') The HTTP request body.
196
196
  # A sha256 checksum is computed of the body unless the
197
197
  # 'X-Amz-Content-Sha256' header is set.
198
198
  #
@@ -253,7 +253,7 @@ module Aws
253
253
  # To generate a presigned URL, you must provide a HTTP URI and
254
254
  # the http method.
255
255
  #
256
- # url = signer.presigned_url(
256
+ # url = signer.presign_url(
257
257
  # http_method: 'GET',
258
258
  # url: 'https://my-bucket.s3-us-east-1.amazonaws.com/key',
259
259
  # expires_in: 60
@@ -262,7 +262,7 @@ module Aws
262
262
  # By default, signatures are valid for 15 minutes. You can specify
263
263
  # the number of seconds for the URL to expire in.
264
264
  #
265
- # url = signer.presigned_url(
265
+ # url = signer.presign_url(
266
266
  # http_method: 'GET',
267
267
  # url: 'https://my-bucket.s3-us-east-1.amazonaws.com/key',
268
268
  # expires_in: 3600 # one hour
@@ -273,7 +273,7 @@ module Aws
273
273
  # **must** be provided, or the signature is invalid. Other headers
274
274
  # are optional, but should be provided for security reasons.
275
275
  #
276
- # url = signer.presigned_url(
276
+ # url = signer.presign_url(
277
277
  # http_method: 'PUT',
278
278
  # url: 'https://my-bucket.s3-us-east-1.amazonaws.com/key',
279
279
  # headers: {
@@ -438,11 +438,11 @@ module Aws
438
438
  end
439
439
 
440
440
  def canonical_headers(headers)
441
- headers = headers.inject([]) do |headers, (k,v)|
441
+ headers = headers.inject([]) do |hdrs, (k,v)|
442
442
  if @unsigned_headers.include?(k)
443
- headers
443
+ hdrs
444
444
  else
445
- headers << [k,v]
445
+ hdrs << [k,v]
446
446
  end
447
447
  end
448
448
  headers = headers.sort_by(&:first)
@@ -473,7 +473,7 @@ module Aws
473
473
  OpenSSL::Digest::SHA256.file(value).hexdigest
474
474
  elsif value.respond_to?(:read)
475
475
  sha256 = OpenSSL::Digest::SHA256.new
476
- while chunk = value.read(1024 * 1024) # 1MB
476
+ while chunk = value.read(1024 * 1024, buffer ||= "") # 1MB
477
477
  sha256.update(chunk)
478
478
  end
479
479
  value.rewind
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sigv4
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-31 00:00:00.000000000 Z
11
+ date: 2018-06-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Amazon Web Services Signature Version 4 signing ligrary. Generates sigv4
14
14
  signature for HTTP requests.
@@ -45,7 +45,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
45
45
  version: '0'
46
46
  requirements: []
47
47
  rubyforge_project:
48
- rubygems_version: 2.5.1
48
+ rubygems_version: 2.5.2.3
49
49
  signing_key:
50
50
  specification_version: 4
51
51
  summary: AWS Signature Version 4 library.