aws-sdk-s3 1.111.3 → 1.113.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-s3/bucket.rb +96 -17
- data/lib/aws-sdk-s3/bucket_acl.rb +18 -2
- data/lib/aws-sdk-s3/bucket_cors.rb +20 -4
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +20 -4
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +20 -4
- data/lib/aws-sdk-s3/bucket_logging.rb +18 -2
- data/lib/aws-sdk-s3/bucket_notification.rb +2 -2
- data/lib/aws-sdk-s3/bucket_policy.rb +20 -4
- data/lib/aws-sdk-s3/bucket_request_payment.rb +18 -2
- data/lib/aws-sdk-s3/bucket_tagging.rb +20 -4
- data/lib/aws-sdk-s3/bucket_versioning.rb +54 -6
- data/lib/aws-sdk-s3/bucket_website.rb +20 -4
- data/lib/aws-sdk-s3/client.rb +1750 -634
- data/lib/aws-sdk-s3/client_api.rb +371 -21
- data/lib/aws-sdk-s3/customizations/object.rb +2 -2
- data/lib/aws-sdk-s3/multipart_file_uploader.rb +26 -7
- data/lib/aws-sdk-s3/multipart_upload.rb +126 -12
- data/lib/aws-sdk-s3/multipart_upload_part.rb +132 -13
- data/lib/aws-sdk-s3/object.rb +243 -61
- data/lib/aws-sdk-s3/object_acl.rb +20 -4
- data/lib/aws-sdk-s3/object_summary.rb +163 -41
- data/lib/aws-sdk-s3/object_version.rb +62 -26
- data/lib/aws-sdk-s3/plugins/md5s.rb +5 -3
- data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +31 -0
- data/lib/aws-sdk-s3/plugins/streaming_retry.rb +23 -2
- data/lib/aws-sdk-s3/presigned_post.rb +9 -2
- data/lib/aws-sdk-s3/types.rb +2229 -462
- data/lib/aws-sdk-s3.rb +1 -1
- metadata +5 -4
@@ -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)
|
88
|
-
|
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
|
@@ -98,7 +98,7 @@ module Aws
|
|
98
98
|
# or call the associated method.
|
99
99
|
#
|
100
100
|
# ```ruby
|
101
|
-
# post = Aws::S3::PresignedPost.new(creds, region, bucket)
|
101
|
+
# post = Aws::S3::PresignedPost.new(creds, region, bucket)
|
102
102
|
# post.content_type('text/plain')
|
103
103
|
# ```
|
104
104
|
#
|
@@ -182,6 +182,11 @@ module Aws
|
|
182
182
|
# the post policy.
|
183
183
|
# @param [String] bucket_region Region of the target bucket.
|
184
184
|
# @param [String] bucket_name Name of the target bucket.
|
185
|
+
# @option options [Boolean] :use_accelerate_endpoint (false) When `true`,
|
186
|
+
# PresignedPost will attempt to use accelerated endpoint.
|
187
|
+
# @option options [String] :url See {PresignedPost#url}.
|
188
|
+
# @option options [Sting, Array<String>] :allow_any
|
189
|
+
# See {PresignedPost#allow_any}.
|
185
190
|
# @option options [Time] :signature_expiration Specify when the signature on
|
186
191
|
# the post will expire. Defaults to one hour from creation of the
|
187
192
|
# presigned post. May not exceed one week from creation time.
|
@@ -206,7 +211,7 @@ module Aws
|
|
206
211
|
# See {PresignedPost#content_encoding}.
|
207
212
|
# @option options [String] :content_encoding_starts_with
|
208
213
|
# See {PresignedPost#content_encoding_starts_with}.
|
209
|
-
# @option options [
|
214
|
+
# @option options [Time] :expires See {PresignedPost#expires}.
|
210
215
|
# @option options [String] :expires_starts_with
|
211
216
|
# See {PresignedPost#expires_starts_with}.
|
212
217
|
# @option options [Range<Integer>] :content_length_range
|
@@ -233,6 +238,8 @@ module Aws
|
|
233
238
|
# See {PresignedPost#server_side_encryption_customer_algorithm}.
|
234
239
|
# @option options [String] :server_side_encryption_customer_key
|
235
240
|
# See {PresignedPost#server_side_encryption_customer_key}.
|
241
|
+
# @option options [String] :server_side_encryption_customer_key_starts_with
|
242
|
+
# See {PresignedPost#server_side_encryption_customer_key_starts_with}.
|
236
243
|
def initialize(credentials, bucket_region, bucket_name, options = {})
|
237
244
|
@credentials = credentials.credentials
|
238
245
|
@bucket_region = bucket_region
|