aws-sigv4 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/VERSION +1 -1
  4. data/lib/aws-sigv4/signer.rb +13 -6
  5. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed95d4ec56e15f5b06d202643cebf73e89d69efbe461d03035dc309f0aa32b11
4
- data.tar.gz: f235824f3bf7ea35aa4fb7e666250f72be1d8592709f522c8fae42fb36e40a9a
3
+ metadata.gz: a3056c1d15e50cbc5b076e0ef145163bfbe6381d0fc0e6ed23b46bed3ca75a42
4
+ data.tar.gz: 9e1c9f247ee6c8d4e4e7e19308c9ea2ab27d392f5f6a5d27ba5d282e7a15c62c
5
5
  SHA512:
6
- metadata.gz: 62ddb59e6cf4fd5ca5a704db3a7f8f8707329cd8b66fec124de5bc56bc5cc2fac20622987e5a6cbeaec1ce55941ee66ab36ed25178ee82e287515622a33bc314
7
- data.tar.gz: e05f2a2ada39d28681df35b7365e7c71e6eda34b250cd2259312d9b6cc0e810fceb0dffeddd785a4b5e08cea1989eb5e2e4e27303d1cf4ce51ad251952d7047d
6
+ metadata.gz: 93f24fe1853d03a090c198521fed073d39384f59b5d5fcb3942d6d791a066d4c8cfd9bde674fff728b19d2aaba14c9769638fb5f5106dbd956d9a5764ceb4b39
7
+ data.tar.gz: 1043a6e7c1334e586af23f724baef8d28f44cadb19589e04f98237ec0a81c9e571d28402b71c1c07da28525b7159fd1356831ae6d091bbaca77f48989a5c1f5a
data/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.7.0 (2023-11-22)
5
+ ------------------
6
+
7
+ * Feature - AWS SDK for Ruby no longer supports Ruby runtime versions 2.3 and 2.4.
8
+
9
+ 1.6.1 (2023-10-25)
10
+ ------------------
11
+
12
+ * Issue - (Static Stability) use provided `expires_in` in presigned url when credentials are expired.
13
+
4
14
  1.6.0 (2023-06-28)
5
15
  ------------------
6
16
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.6.0
1
+ 1.7.0
@@ -423,7 +423,7 @@ module Aws
423
423
  params['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256'
424
424
  params['X-Amz-Credential'] = credential(creds, date)
425
425
  params['X-Amz-Date'] = datetime
426
- params['X-Amz-Expires'] = presigned_url_expiration(options, expiration).to_s
426
+ params['X-Amz-Expires'] = presigned_url_expiration(options, expiration, Time.strptime(datetime, "%Y%m%dT%H%M%S%Z")).to_s
427
427
  params['X-Amz-Security-Token'] = creds.session_token if creds.session_token
428
428
  params['X-Amz-SignedHeaders'] = signed_headers(headers)
429
429
 
@@ -722,12 +722,19 @@ module Aws
722
722
  !credentials.secret_access_key.empty?
723
723
  end
724
724
 
725
- def presigned_url_expiration(options, expiration)
725
+ def presigned_url_expiration(options, expiration, datetime)
726
726
  expires_in = extract_expires_in(options)
727
727
  return expires_in unless expiration
728
728
 
729
- expiration_seconds = (expiration - Time.now).to_i
730
- [expires_in, expiration_seconds].min
729
+ expiration_seconds = (expiration - datetime).to_i
730
+ # In the static stability case, credentials may expire in the past
731
+ # but still be valid. For those cases, use the user configured
732
+ # expires_in and ingore expiration.
733
+ if expiration_seconds <= 0
734
+ expires_in
735
+ else
736
+ [expires_in, expiration_seconds].min
737
+ end
731
738
  end
732
739
 
733
740
  ### CRT Code
@@ -811,7 +818,7 @@ module Aws
811
818
  headers = downcase_headers(options[:headers])
812
819
  headers['host'] ||= host(url)
813
820
 
814
- datetime = headers.delete('x-amz-date')
821
+ datetime = Time.strptime(headers.delete('x-amz-date'), "%Y%m%dT%H%M%S%Z") if headers['x-amz-date']
815
822
  datetime ||= (options[:time] || Time.now)
816
823
 
817
824
  content_sha256 = headers.delete('x-amz-content-sha256')
@@ -832,7 +839,7 @@ module Aws
832
839
  use_double_uri_encode: @uri_escape_path,
833
840
  should_normalize_uri_path: @normalize_path,
834
841
  omit_session_token: @omit_session_token,
835
- expiration_in_seconds: presigned_url_expiration(options, expiration)
842
+ expiration_in_seconds: presigned_url_expiration(options, expiration, datetime)
836
843
  )
837
844
  http_request = Aws::Crt::Http::Message.new(
838
845
  http_method, url.to_s, headers
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.6.0
4
+ version: 1.7.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-06-28 00:00:00.000000000 Z
11
+ date: 2023-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-eventstream
@@ -60,7 +60,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: '2.3'
63
+ version: '2.5'
64
64
  required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="