aws-sigv4 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sigv4/signer.rb +13 -13
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 230c5aa7c49bded384ea0cc96ecbc3cdc6d3bec7
|
4
|
+
data.tar.gz: b1b194fa0740e2588a94dd9a0c66f7c5f4198f70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53016c5f240e3154815b4f172158a5a29c84ef7e912e756f8f5b53e619854bbc30a041358b5be4a8fc82708cbbb12c549f31c843421cbf5a0e6c3f2e0537ab23
|
7
|
+
data.tar.gz: 4ff775b31b1603a3eaf5206cb0c59bdac3599a95973626d746d81ec21b8e51db46cdc9fd8cb6a7008afaeaec5bb6ac6af6a12b5317ba60e2c64303424235a63d
|
data/lib/aws-sigv4/signer.rb
CHANGED
@@ -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['
|
170
|
-
# signature.headers['
|
171
|
-
# signature.headers['
|
172
|
-
# signature.headers['
|
173
|
-
# signature.headers['
|
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 [
|
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.
|
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.
|
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.
|
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 |
|
441
|
+
headers = headers.inject([]) do |hdrs, (k,v)|
|
442
442
|
if @unsigned_headers.include?(k)
|
443
|
-
|
443
|
+
hdrs
|
444
444
|
else
|
445
|
-
|
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.
|
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:
|
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.
|
48
|
+
rubygems_version: 2.5.2.3
|
49
49
|
signing_key:
|
50
50
|
specification_version: 4
|
51
51
|
summary: AWS Signature Version 4 library.
|