aws-sigv4 1.7.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/aws-sigv4/signer.rb +22 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 482b4ffa8bd9e9e2d7dab0d61ab15553f0e8d05e1be2923b388157664a47a9fa
|
4
|
+
data.tar.gz: c5caa84527ca213826f8c802195430caacb25750530609f1b8d7267810808574
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c16c5df7f8c6ca10cf073c25984506ce938f26823f99d82813b5bde3fb283d23a3c480adec2945b98975946a7b32efe57a0058cd65bb383606c5ee5228711381
|
7
|
+
data.tar.gz: b72ea1894eb1c419179325f8e715fb454ab02ae2d1ac243b90ed2f4032c0fd966ba157287a12009587908d0a6a2f62261c78e319a230196792b6ec4206a20718
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.8.0
|
data/lib/aws-sigv4/signer.rb
CHANGED
@@ -157,6 +157,13 @@ module Aws
|
|
157
157
|
' request with sigv4a which requires the `aws-crt` gem.'\
|
158
158
|
' Please install the gem or add it to your gemfile.'
|
159
159
|
end
|
160
|
+
|
161
|
+
if @signing_algorithm == 'sigv4-s3express'.to_sym &&
|
162
|
+
Signer.use_crt? && Aws::Crt::GEM_VERSION <= '0.1.9'
|
163
|
+
raise ArgumentError,
|
164
|
+
'This version of aws-crt does not support S3 Express. Please
|
165
|
+
update this gem to at least version 0.2.0.'
|
166
|
+
end
|
160
167
|
end
|
161
168
|
|
162
169
|
# @return [String]
|
@@ -251,7 +258,14 @@ module Aws
|
|
251
258
|
sigv4_headers = {}
|
252
259
|
sigv4_headers['host'] = headers['host'] || host(url)
|
253
260
|
sigv4_headers['x-amz-date'] = datetime
|
254
|
-
|
261
|
+
if creds.session_token
|
262
|
+
if @signing_algorithm == 'sigv4-s3express'.to_sym
|
263
|
+
sigv4_headers['x-amz-s3session-token'] = creds.session_token
|
264
|
+
else
|
265
|
+
sigv4_headers['x-amz-security-token'] = creds.session_token
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
255
269
|
sigv4_headers['x-amz-content-sha256'] ||= content_sha256 if @apply_checksum_header
|
256
270
|
|
257
271
|
headers = headers.merge(sigv4_headers) # merge so we do not modify given headers hash
|
@@ -424,7 +438,13 @@ module Aws
|
|
424
438
|
params['X-Amz-Credential'] = credential(creds, date)
|
425
439
|
params['X-Amz-Date'] = datetime
|
426
440
|
params['X-Amz-Expires'] = presigned_url_expiration(options, expiration, Time.strptime(datetime, "%Y%m%dT%H%M%S%Z")).to_s
|
427
|
-
|
441
|
+
if creds.session_token
|
442
|
+
if @signing_algorithm == 'sigv4-s3express'.to_sym
|
443
|
+
params['X-Amz-S3session-Token'] = creds.session_token
|
444
|
+
else
|
445
|
+
params['X-Amz-Security-Token'] = creds.session_token
|
446
|
+
end
|
447
|
+
end
|
428
448
|
params['X-Amz-SignedHeaders'] = signed_headers(headers)
|
429
449
|
|
430
450
|
params = params.map do |key, value|
|
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.
|
4
|
+
version: 1.8.0
|
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: 2023-11-
|
11
|
+
date: 2023-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-eventstream
|