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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3056c1d15e50cbc5b076e0ef145163bfbe6381d0fc0e6ed23b46bed3ca75a42
4
- data.tar.gz: 9e1c9f247ee6c8d4e4e7e19308c9ea2ab27d392f5f6a5d27ba5d282e7a15c62c
3
+ metadata.gz: 482b4ffa8bd9e9e2d7dab0d61ab15553f0e8d05e1be2923b388157664a47a9fa
4
+ data.tar.gz: c5caa84527ca213826f8c802195430caacb25750530609f1b8d7267810808574
5
5
  SHA512:
6
- metadata.gz: 93f24fe1853d03a090c198521fed073d39384f59b5d5fcb3942d6d791a066d4c8cfd9bde674fff728b19d2aaba14c9769638fb5f5106dbd956d9a5764ceb4b39
7
- data.tar.gz: 1043a6e7c1334e586af23f724baef8d28f44cadb19589e04f98237ec0a81c9e571d28402b71c1c07da28525b7159fd1356831ae6d091bbaca77f48989a5c1f5a
6
+ metadata.gz: c16c5df7f8c6ca10cf073c25984506ce938f26823f99d82813b5bde3fb283d23a3c480adec2945b98975946a7b32efe57a0058cd65bb383606c5ee5228711381
7
+ data.tar.gz: b72ea1894eb1c419179325f8e715fb454ab02ae2d1ac243b90ed2f4032c0fd966ba157287a12009587908d0a6a2f62261c78e319a230196792b6ec4206a20718
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.8.0 (2023-11-28)
5
+ ------------------
6
+
7
+ * Feature - Support `sigv4-s3express` signing algorithm.
8
+
4
9
  1.7.0 (2023-11-22)
5
10
  ------------------
6
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.0
1
+ 1.8.0
@@ -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
- sigv4_headers['x-amz-security-token'] = creds.session_token if creds.session_token
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
- params['X-Amz-Security-Token'] = creds.session_token if creds.session_token
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.7.0
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-22 00:00:00.000000000 Z
11
+ date: 2023-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-eventstream