aws-sdk-s3 1.113.0 → 1.113.2

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: cd3cdd3ce413a190558c3c4fb19b0c360e6fdc8429315addf9a99f8a4200e84f
4
- data.tar.gz: 8ea6b6b1a93212b99871945b5deeaa90813f4aef35d55ae2c351194be17f2909
3
+ metadata.gz: 5274b91e581e514386584d3ea2284363db3bcc1d1d6cbdd3ea992484a26ba3e3
4
+ data.tar.gz: 6659086890fbfcb9223311361dbb67f3a55738f2a01ce4845bb05210dd06f59a
5
5
  SHA512:
6
- metadata.gz: 4c83d52e47d9990c34a6ffa1b0ab647e333353dc516a4105a01df1fa2d93fe5d8a7e45c48072e27d95cd4e7581adcc606fabe3afb5cfd9e41047da330910ad37
7
- data.tar.gz: a399eff773756874118891127b2ac26592b1c780559b3900ef0f4982e6ef3286b759331507a79778725e5cb61f7f140d94d08e77bd4ba51b05eb3e23b1f7a621
6
+ metadata.gz: 2e25bc0dd1c8249a1c5982cb36f1e06b8b8dc8c3c04e277cd2b9eff8bb3ed2fc4cfd2617ecdd8ea206881e066a02a0bccfc525258a5dc9b2b15a42ad1568a31b
7
+ data.tar.gz: 9fb04f15c827cdcad16645bde85de0e2b9bdca01483acebc13d6ca8b163eeb21038882468a275b96e293f4c7be42ff481b9275c681d492925cc6e3469a05de02
data/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.113.2 (2022-04-26)
5
+ ------------------
6
+
7
+ * Issue - Fix an issue where `ExpiredToken` errors were retried as if the request was from another region.
8
+
9
+ 1.113.1 (2022-04-25)
10
+ ------------------
11
+
12
+ * Issue - Rewind the underlying file on a streaming retry that is not a truncated body (#2692).
13
+
4
14
  1.113.0 (2022-02-24)
5
15
  ------------------
6
16
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.113.0
1
+ 1.113.2
@@ -15332,7 +15332,7 @@ module Aws::S3
15332
15332
  params: params,
15333
15333
  config: config)
15334
15334
  context[:gem_name] = 'aws-sdk-s3'
15335
- context[:gem_version] = '1.113.0'
15335
+ context[:gem_version] = '1.113.2'
15336
15336
  Seahorse::Client::Request.new(handlers, context)
15337
15337
  end
15338
15338
 
@@ -138,7 +138,8 @@ module Aws
138
138
  def handle_region_errors(response)
139
139
  if wrong_sigv4_region?(response) &&
140
140
  !fips_region?(response) &&
141
- !custom_endpoint?(response)
141
+ !custom_endpoint?(response) &&
142
+ !expired_credentials?(response)
142
143
  get_region_and_retry(response.context)
143
144
  else
144
145
  response
@@ -162,6 +163,10 @@ module Aws
162
163
  resp.context.http_request.endpoint.host.include?('fips')
163
164
  end
164
165
 
166
+ def expired_credentials?(resp)
167
+ resp.context.http_response.body_contents.match(/<Code>ExpiredToken<\/Code>/)
168
+ end
169
+
165
170
  def custom_endpoint?(resp)
166
171
  resolved_suffix = Aws::Partitions::EndpointProvider.dns_suffix_for(
167
172
  resp.context.config.region,
@@ -36,6 +36,17 @@ module Aws
36
36
  def rewind; end
37
37
  end
38
38
 
39
+ class NonRetryableStreamingError < StandardError
40
+
41
+ def initialize(error)
42
+ super('Unable to retry request - retry could result in processing duplicated chunks.')
43
+ set_backtrace(error.backtrace)
44
+ @original_error = error
45
+ end
46
+
47
+ attr_reader :original_error
48
+ end
49
+
39
50
  # This handler works with the ResponseTarget plugin to provide smart
40
51
  # retries of S3 streaming operations that support the range parameter
41
52
  # (currently only: get_object). When a 200 OK with a TruncatedBodyError
@@ -84,8 +95,18 @@ module Aws
84
95
  end
85
96
 
86
97
  context.http_response.on_error do |error|
87
- if retryable_body?(context) && truncated_body?(error)
88
- context.http_request.headers[:range] = "bytes=#{context.http_response.body.size}-"
98
+ if retryable_body?(context)
99
+ if truncated_body?(error)
100
+ context.http_request.headers[:range] = "bytes=#{context.http_response.body.size}-"
101
+ else
102
+ case context.http_response.body
103
+ when RetryableManagedFile
104
+ # call rewind on the underlying file
105
+ context.http_response.body.instance_variable_get(:@file).rewind
106
+ else
107
+ raise NonRetryableStreamingError, error
108
+ end
109
+ end
89
110
  end
90
111
  end
91
112
  end
data/lib/aws-sdk-s3.rb CHANGED
@@ -69,6 +69,6 @@ require_relative 'aws-sdk-s3/event_streams'
69
69
  # @!group service
70
70
  module Aws::S3
71
71
 
72
- GEM_VERSION = '1.113.0'
72
+ GEM_VERSION = '1.113.2'
73
73
 
74
74
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.113.0
4
+ version: 1.113.2
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: 2022-02-24 00:00:00.000000000 Z
11
+ date: 2022-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-kms