aws-sdk-s3 1.86.2 → 1.116.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +913 -0
- data/LICENSE.txt +202 -0
- data/VERSION +1 -0
- data/lib/aws-sdk-s3/arn/access_point_arn.rb +19 -12
- data/lib/aws-sdk-s3/arn/multi_region_access_point_arn.rb +68 -0
- data/lib/aws-sdk-s3/arn/object_lambda_arn.rb +69 -0
- data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +15 -12
- data/lib/aws-sdk-s3/bucket.rb +145 -47
- data/lib/aws-sdk-s3/bucket_acl.rb +27 -8
- data/lib/aws-sdk-s3/bucket_cors.rb +28 -11
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +30 -11
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +31 -9
- data/lib/aws-sdk-s3/bucket_logging.rb +24 -8
- data/lib/aws-sdk-s3/bucket_notification.rb +21 -9
- data/lib/aws-sdk-s3/bucket_policy.rb +26 -9
- data/lib/aws-sdk-s3/bucket_request_payment.rb +26 -10
- data/lib/aws-sdk-s3/bucket_tagging.rb +26 -9
- data/lib/aws-sdk-s3/bucket_versioning.rb +67 -16
- data/lib/aws-sdk-s3/bucket_website.rb +26 -9
- data/lib/aws-sdk-s3/client.rb +3633 -1862
- data/lib/aws-sdk-s3/client_api.rb +546 -116
- data/lib/aws-sdk-s3/customizations/bucket.rb +8 -3
- data/lib/aws-sdk-s3/customizations/object.rb +116 -18
- data/lib/aws-sdk-s3/encryption/client.rb +1 -1
- data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +0 -4
- data/lib/aws-sdk-s3/encryptionV2/client.rb +1 -1
- data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +0 -4
- data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +3 -3
- data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +0 -4
- data/lib/aws-sdk-s3/errors.rb +1 -1
- data/lib/aws-sdk-s3/event_streams.rb +1 -1
- data/lib/aws-sdk-s3/file_downloader.rb +7 -2
- data/lib/aws-sdk-s3/file_uploader.rb +8 -3
- data/lib/aws-sdk-s3/multipart_file_uploader.rb +26 -7
- data/lib/aws-sdk-s3/multipart_upload.rb +133 -19
- data/lib/aws-sdk-s3/multipart_upload_part.rb +141 -21
- data/lib/aws-sdk-s3/object.rb +391 -130
- data/lib/aws-sdk-s3/object_acl.rb +30 -11
- data/lib/aws-sdk-s3/object_summary.rb +243 -115
- data/lib/aws-sdk-s3/object_version.rb +80 -53
- data/lib/aws-sdk-s3/plugins/accelerate.rb +13 -4
- data/lib/aws-sdk-s3/plugins/arn.rb +125 -58
- data/lib/aws-sdk-s3/plugins/bucket_dns.rb +1 -1
- data/lib/aws-sdk-s3/plugins/dualstack.rb +33 -32
- data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +2 -1
- data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +1 -1
- data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +17 -11
- data/lib/aws-sdk-s3/plugins/md5s.rb +5 -3
- data/lib/aws-sdk-s3/plugins/object_lambda_endpoint.rb +25 -0
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +55 -28
- 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 +38 -19
- data/lib/aws-sdk-s3/presigner.rb +33 -30
- data/lib/aws-sdk-s3/resource.rb +24 -4
- data/lib/aws-sdk-s3/types.rb +3777 -1306
- data/lib/aws-sdk-s3/waiters.rb +1 -1
- data/lib/aws-sdk-s3.rb +2 -2
- metadata +20 -14
@@ -88,18 +88,23 @@ module Aws
|
|
88
88
|
# You can pass `virtual_host: true` to use the bucket name as the
|
89
89
|
# host name.
|
90
90
|
#
|
91
|
-
# bucket = s3.bucket('my
|
91
|
+
# bucket = s3.bucket('my-bucket.com')
|
92
92
|
# bucket.url(virtual_host: true)
|
93
|
-
# #=> "http://my
|
93
|
+
# #=> "http://my-bucket.com"
|
94
94
|
#
|
95
95
|
# @option options [Boolean] :virtual_host (false) When `true`,
|
96
96
|
# the bucket name will be used as the host name. This is useful
|
97
97
|
# when you have a CNAME configured for this bucket.
|
98
98
|
#
|
99
|
+
# @option options [Boolean] :secure (true) When `false`, http
|
100
|
+
# will be used with virtual_host. This is required when
|
101
|
+
# the bucket name has a dot (.) in it.
|
102
|
+
#
|
99
103
|
# @return [String] the URL for this bucket.
|
100
104
|
def url(options = {})
|
101
105
|
if options[:virtual_host]
|
102
|
-
|
106
|
+
scheme = options.fetch(:secure, true) ? 'https' : 'http'
|
107
|
+
"#{scheme}://#{name}"
|
103
108
|
elsif @arn
|
104
109
|
Plugins::ARN.resolve_url!(
|
105
110
|
client.config.endpoint.dup,
|
@@ -153,21 +153,35 @@ module Aws
|
|
153
153
|
# obj.presigned_url(:put, acl: 'public-read')
|
154
154
|
# #=> "https://bucket-name.s3.amazonaws.com/object-key?..."
|
155
155
|
#
|
156
|
-
# @
|
157
|
-
#
|
158
|
-
#
|
156
|
+
# @example Pre-signed UploadPart PUT
|
157
|
+
#
|
158
|
+
# # the object uploaded using this URL will be publicly accessible
|
159
|
+
# obj.presigned_url(:upload_part, part_number: 1, upload_id: 'uploadIdToken')
|
160
|
+
# #=> "https://bucket-name.s3.amazonaws.com/object-key?..."
|
161
|
+
#
|
162
|
+
# @param [Symbol] method
|
163
|
+
# The S3 operation to generate a presigned URL for. Valid values
|
164
|
+
# are `:get`, `:put`, `:head`, `:delete`, `:create_multipart_upload`,
|
165
|
+
# `:list_multipart_uploads`, `:complete_multipart_upload`,
|
166
|
+
# `:abort_multipart_upload`, `:list_parts`, and `:upload_part`.
|
159
167
|
#
|
160
168
|
# @param [Hash] params
|
161
169
|
# Additional request parameters to use when generating the pre-signed
|
162
170
|
# URL. See the related documentation in {Client} for accepted
|
163
171
|
# params.
|
164
172
|
#
|
165
|
-
# |
|
166
|
-
#
|
167
|
-
# | `:get`
|
168
|
-
# | `:put`
|
169
|
-
# | `:head`
|
170
|
-
# | `:delete`
|
173
|
+
# | Method | Client Method |
|
174
|
+
# |------------------------------|------------------------------------|
|
175
|
+
# | `:get` | {Client#get_object} |
|
176
|
+
# | `:put` | {Client#put_object} |
|
177
|
+
# | `:head` | {Client#head_object} |
|
178
|
+
# | `:delete` | {Client#delete_object} |
|
179
|
+
# | `:create_multipart_upload` | {Client#create_multipart_upload} |
|
180
|
+
# | `:list_multipart_uploads` | {Client#list_multipart_uploads} |
|
181
|
+
# | `:complete_multipart_upload` | {Client#complete_multipart_upload} |
|
182
|
+
# | `:abort_multipart_upload` | {Client#abort_multipart_upload} |
|
183
|
+
# | `:list_parts` | {Client#list_parts} |
|
184
|
+
# | `:upload_part` | {Client#upload_part} |
|
171
185
|
#
|
172
186
|
# @option params [Boolean] :virtual_host (false) When `true` the
|
173
187
|
# presigned URL will use the bucket name as a virtual host.
|
@@ -188,10 +202,88 @@ module Aws
|
|
188
202
|
#
|
189
203
|
# @return [String]
|
190
204
|
#
|
191
|
-
def presigned_url(
|
205
|
+
def presigned_url(method, params = {})
|
192
206
|
presigner = Presigner.new(client: client)
|
207
|
+
|
208
|
+
if %w(delete head get put).include?(method.to_s)
|
209
|
+
method = "#{method}_object".to_sym
|
210
|
+
end
|
211
|
+
|
193
212
|
presigner.presigned_url(
|
194
|
-
|
213
|
+
method.downcase,
|
214
|
+
params.merge(bucket: bucket_name, key: key)
|
215
|
+
)
|
216
|
+
end
|
217
|
+
|
218
|
+
# Allows you to create presigned URL requests for S3 operations. This
|
219
|
+
# method returns a tuple containing the URL and the signed X-amz-* headers
|
220
|
+
# to be used with the presigned url.
|
221
|
+
#
|
222
|
+
# @example Pre-signed GET URL, valid for one hour
|
223
|
+
#
|
224
|
+
# obj.presigned_request(:get, expires_in: 3600)
|
225
|
+
# #=> ["https://bucket-name.s3.amazonaws.com/object-key?...", {}]
|
226
|
+
#
|
227
|
+
# @example Pre-signed PUT with a canned ACL
|
228
|
+
#
|
229
|
+
# # the object uploaded using this URL will be publicly accessible
|
230
|
+
# obj.presigned_request(:put, acl: 'public-read')
|
231
|
+
# #=> ["https://bucket-name.s3.amazonaws.com/object-key?...",
|
232
|
+
# {"x-amz-acl"=>"public-read"}]
|
233
|
+
#
|
234
|
+
# @param [Symbol] method
|
235
|
+
# The S3 operation to generate a presigned request for. Valid values
|
236
|
+
# are `:get`, `:put`, `:head`, `:delete`, `:create_multipart_upload`,
|
237
|
+
# `:list_multipart_uploads`, `:complete_multipart_upload`,
|
238
|
+
# `:abort_multipart_upload`, `:list_parts`, and `:upload_part`.
|
239
|
+
#
|
240
|
+
# @param [Hash] params
|
241
|
+
# Additional request parameters to use when generating the pre-signed
|
242
|
+
# request. See the related documentation in {Client} for accepted
|
243
|
+
# params.
|
244
|
+
#
|
245
|
+
# | Method | Client Method |
|
246
|
+
# |------------------------------|------------------------------------|
|
247
|
+
# | `:get` | {Client#get_object} |
|
248
|
+
# | `:put` | {Client#put_object} |
|
249
|
+
# | `:head` | {Client#head_object} |
|
250
|
+
# | `:delete` | {Client#delete_object} |
|
251
|
+
# | `:create_multipart_upload` | {Client#create_multipart_upload} |
|
252
|
+
# | `:list_multipart_uploads` | {Client#list_multipart_uploads} |
|
253
|
+
# | `:complete_multipart_upload` | {Client#complete_multipart_upload} |
|
254
|
+
# | `:abort_multipart_upload` | {Client#abort_multipart_upload} |
|
255
|
+
# | `:list_parts` | {Client#list_parts} |
|
256
|
+
# | `:upload_part` | {Client#upload_part} |
|
257
|
+
#
|
258
|
+
# @option params [Boolean] :virtual_host (false) When `true` the
|
259
|
+
# presigned URL will use the bucket name as a virtual host.
|
260
|
+
#
|
261
|
+
# bucket = Aws::S3::Bucket.new('my.bucket.com')
|
262
|
+
# bucket.object('key').presigned_request(virtual_host: true)
|
263
|
+
# #=> ["http://my.bucket.com/key?...", {}]
|
264
|
+
#
|
265
|
+
# @option params [Integer] :expires_in (900) Number of seconds before
|
266
|
+
# the pre-signed URL expires. This may not exceed one week (604800
|
267
|
+
# seconds). Note that the pre-signed URL is also only valid as long as
|
268
|
+
# credentials used to sign it are. For example, when using IAM roles,
|
269
|
+
# temporary tokens generated for signing also have a default expiration
|
270
|
+
# which will affect the effective expiration of the pre-signed URL.
|
271
|
+
#
|
272
|
+
# @raise [ArgumentError] Raised if `:expires_in` exceeds one week
|
273
|
+
# (604800 seconds).
|
274
|
+
#
|
275
|
+
# @return [String, Hash] A tuple with a presigned URL and headers that
|
276
|
+
# should be included with the request.
|
277
|
+
#
|
278
|
+
def presigned_request(method, params = {})
|
279
|
+
presigner = Presigner.new(client: client)
|
280
|
+
|
281
|
+
if %w(delete head get put).include?(method.to_s)
|
282
|
+
method = "#{method}_object".to_sym
|
283
|
+
end
|
284
|
+
|
285
|
+
presigner.presigned_request(
|
286
|
+
method.downcase,
|
195
287
|
params.merge(bucket: bucket_name, key: key)
|
196
288
|
)
|
197
289
|
end
|
@@ -201,16 +293,22 @@ module Aws
|
|
201
293
|
# s3.bucket('bucket-name').object('obj-key').public_url
|
202
294
|
# #=> "https://bucket-name.s3.amazonaws.com/obj-key"
|
203
295
|
#
|
204
|
-
# To use virtual hosted bucket url
|
296
|
+
# To use virtual hosted bucket url.
|
297
|
+
# Uses https unless secure: false is set. If the bucket
|
298
|
+
# name contains dots (.) then you will need to set secure: false.
|
205
299
|
#
|
206
|
-
# s3.bucket('my
|
300
|
+
# s3.bucket('my-bucket.com').object('key')
|
207
301
|
# .public_url(virtual_host: true)
|
208
|
-
# #=> "
|
302
|
+
# #=> "https://my-bucket.com/key"
|
209
303
|
#
|
210
304
|
# @option options [Boolean] :virtual_host (false) When `true`, the bucket
|
211
305
|
# name will be used as the host name. This is useful when you have
|
212
306
|
# a CNAME configured for the bucket.
|
213
307
|
#
|
308
|
+
# @option options [Boolean] :secure (true) When `false`, http
|
309
|
+
# will be used with virtual_host. This is required when
|
310
|
+
# the bucket name has a dot (.) in it.
|
311
|
+
#
|
214
312
|
# @return [String]
|
215
313
|
def public_url(options = {})
|
216
314
|
url = URI.parse(bucket.url(options))
|
@@ -302,7 +400,7 @@ module Aws
|
|
302
400
|
# progress = Proc.new do |bytes, totals|
|
303
401
|
# puts bytes.map.with_index { |b, i| "Part #{i+1}: #{b} / #{totals[i]}"}.join(' ') + "Total: #{100.0 * bytes.sum / totals.sum }%" }
|
304
402
|
# end
|
305
|
-
# obj.upload_file('/path/to/file')
|
403
|
+
# obj.upload_file('/path/to/file', progress_callback: progress)
|
306
404
|
#
|
307
405
|
# @param [String, Pathname, File, Tempfile] source A file on the local
|
308
406
|
# file system that will be uploaded as this object. This can either be
|
@@ -312,10 +410,10 @@ module Aws
|
|
312
410
|
# using an open Tempfile, rewind it before uploading or else the object
|
313
411
|
# will be empty.
|
314
412
|
#
|
315
|
-
# @option options [Integer] :multipart_threshold (
|
413
|
+
# @option options [Integer] :multipart_threshold (104857600) Files larger
|
316
414
|
# than or equal to `:multipart_threshold` are uploaded using the S3
|
317
415
|
# multipart APIs.
|
318
|
-
# Default threshold is
|
416
|
+
# Default threshold is 100MB.
|
319
417
|
#
|
320
418
|
# @option options [Integer] :thread_count (10) The number of parallel
|
321
419
|
# multipart uploads. This option is not used if the file is smaller than
|
@@ -366,7 +464,7 @@ module Aws
|
|
366
464
|
# customizing each range size in multipart_download,
|
367
465
|
# By default, `auto` mode is enabled, which performs multipart_download
|
368
466
|
#
|
369
|
-
# @option options [
|
467
|
+
# @option options [Integer] chunk_size required in get_range mode.
|
370
468
|
#
|
371
469
|
# @option options [Integer] thread_count (10) Customize threads used in
|
372
470
|
# the multipart download.
|
@@ -165,10 +165,6 @@ module Aws
|
|
165
165
|
# to initialize the cipher, and the decrypter truncates the
|
166
166
|
# auth tag from the body when writing the final bytes.
|
167
167
|
def authenticated_decrypter(context, cipher, envelope)
|
168
|
-
if RUBY_VERSION.match(/1.9/)
|
169
|
-
raise "authenticated decryption not supported by OpenSSL in Ruby version ~> 1.9"
|
170
|
-
raise Aws::Errors::NonSupportedRubyVersionError, msg
|
171
|
-
end
|
172
168
|
http_resp = context.http_response
|
173
169
|
content_length = http_resp.headers['content-length'].to_i
|
174
170
|
auth_tag_length = auth_tag_length(envelope)
|
@@ -166,10 +166,6 @@ module Aws
|
|
166
166
|
# to initialize the cipher, and the decrypter truncates the
|
167
167
|
# auth tag from the body when writing the final bytes.
|
168
168
|
def authenticated_decrypter(context, cipher, envelope)
|
169
|
-
if RUBY_VERSION.match(/1.9/)
|
170
|
-
raise "authenticated decryption not supported by OpenSSL in Ruby version ~> 1.9"
|
171
|
-
raise Aws::Errors::NonSupportedRubyVersionError, msg
|
172
|
-
end
|
173
169
|
http_resp = context.http_response
|
174
170
|
content_length = http_resp.headers['content-length'].to_i
|
175
171
|
auth_tag_length = auth_tag_length(envelope)
|
@@ -87,9 +87,9 @@ module Aws
|
|
87
87
|
' kms+context. Please configure the client with the' \
|
88
88
|
' required kms_key_id'
|
89
89
|
else
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
raise ArgumentError, 'Unsupported wrap-alg: ' \
|
91
|
+
"#{envelope['x-amz-wrap-alg']}"
|
92
|
+
end
|
93
93
|
iv = decode64(envelope['x-amz-iv'])
|
94
94
|
Utils.aes_decryption_cipher(:GCM, key, iv)
|
95
95
|
end
|
@@ -9,10 +9,6 @@ module Aws
|
|
9
9
|
class EncryptHandler < Seahorse::Client::Handler
|
10
10
|
|
11
11
|
def call(context)
|
12
|
-
if RUBY_VERSION.match(/1.9/)
|
13
|
-
raise "authenticated encryption not supported by OpenSSL in Ruby version ~> 1.9"
|
14
|
-
raise Aws::Errors::NonSupportedRubyVersionError, msg
|
15
|
-
end
|
16
12
|
envelope, cipher = context[:encryption][:cipher_provider]
|
17
13
|
.encryption_cipher(
|
18
14
|
kms_encryption_context: context[:encryption][:kms_encryption_context]
|
data/lib/aws-sdk-s3/errors.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# WARNING ABOUT GENERATED CODE
|
4
4
|
#
|
5
5
|
# This file is generated. See the contributing guide for more information:
|
6
|
-
# https://github.com/aws/aws-sdk-ruby/blob/
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
7
7
|
#
|
8
8
|
# WARNING ABOUT GENERATED CODE
|
9
9
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# WARNING ABOUT GENERATED CODE
|
4
4
|
#
|
5
5
|
# This file is generated. See the contributing guide for more information:
|
6
|
-
# https://github.com/aws/aws-sdk-ruby/blob/
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
7
7
|
#
|
8
8
|
# WARNING ABOUT GENERATED CODE
|
9
9
|
|
@@ -94,7 +94,12 @@ module Aws
|
|
94
94
|
if @chunk_size && @chunk_size > file_size
|
95
95
|
raise ArgumentError, ":chunk_size shouldn't exceed total file size."
|
96
96
|
else
|
97
|
-
@chunk_size || [
|
97
|
+
chunk_size = @chunk_size || [
|
98
|
+
(file_size.to_f / MAX_PARTS).ceil,
|
99
|
+
MIN_CHUNK_SIZE
|
100
|
+
].max.to_i
|
101
|
+
chunk_size -= 1 if file_size % chunk_size == 1
|
102
|
+
chunk_size
|
98
103
|
end
|
99
104
|
end
|
100
105
|
|
@@ -129,7 +134,7 @@ module Aws
|
|
129
134
|
def write(resp)
|
130
135
|
range, _ = resp.content_range.split(' ').last.split('/')
|
131
136
|
head, _ = range.split('-').map {|s| s.to_i}
|
132
|
-
|
137
|
+
File.write(@path, resp.body.read, head)
|
133
138
|
end
|
134
139
|
|
135
140
|
def single_request
|
@@ -7,16 +7,16 @@ module Aws
|
|
7
7
|
# @api private
|
8
8
|
class FileUploader
|
9
9
|
|
10
|
-
|
10
|
+
ONE_HUNDRED_MEGABYTES = 100 * 1024 * 1024
|
11
11
|
|
12
12
|
# @param [Hash] options
|
13
13
|
# @option options [Client] :client
|
14
|
-
# @option options [Integer] :multipart_threshold (
|
14
|
+
# @option options [Integer] :multipart_threshold (104857600)
|
15
15
|
def initialize(options = {})
|
16
16
|
@options = options
|
17
17
|
@client = options[:client] || Client.new
|
18
18
|
@multipart_threshold = options[:multipart_threshold] ||
|
19
|
-
|
19
|
+
ONE_HUNDRED_MEGABYTES
|
20
20
|
end
|
21
21
|
|
22
22
|
# @return [Client]
|
@@ -32,11 +32,16 @@ module Aws
|
|
32
32
|
# @option options [Proc] :progress_callback
|
33
33
|
# A Proc that will be called when each chunk of the upload is sent.
|
34
34
|
# It will be invoked with [bytes_read], [total_sizes]
|
35
|
+
# @option options [Integer] :thread_count
|
36
|
+
# The thread count to use for multipart uploads. Ignored for
|
37
|
+
# objects smaller than the multipart threshold.
|
35
38
|
# @return [void]
|
36
39
|
def upload(source, options = {})
|
37
40
|
if File.size(source) >= multipart_threshold
|
38
41
|
MultipartFileUploader.new(@options).upload(source, options)
|
39
42
|
else
|
43
|
+
# remove multipart parameters not supported by put_object
|
44
|
+
options.delete(:thread_count)
|
40
45
|
put_object(source, options)
|
41
46
|
end
|
42
47
|
end
|
@@ -21,6 +21,10 @@ module Aws
|
|
21
21
|
Client.api.operation(:create_multipart_upload).input.shape.member_names
|
22
22
|
)
|
23
23
|
|
24
|
+
COMPLETE_OPTIONS = Set.new(
|
25
|
+
Client.api.operation(:complete_multipart_upload).input.shape.member_names
|
26
|
+
)
|
27
|
+
|
24
28
|
# @api private
|
25
29
|
UPLOAD_PART_OPTIONS = Set.new(
|
26
30
|
Client.api.operation(:upload_part).input.shape.member_names
|
@@ -42,7 +46,7 @@ module Aws
|
|
42
46
|
# @option options [Proc] :progress_callback
|
43
47
|
# A Proc that will be called when each chunk of the upload is sent.
|
44
48
|
# It will be invoked with [bytes_read], [total_sizes]
|
45
|
-
# @return [
|
49
|
+
# @return [Seahorse::Client::Response] - the CompleteMultipartUploadResponse
|
46
50
|
def upload(source, options = {})
|
47
51
|
if File.size(source) < MIN_PART_SIZE
|
48
52
|
raise ArgumentError, FILE_TOO_SMALL
|
@@ -61,10 +65,10 @@ module Aws
|
|
61
65
|
|
62
66
|
def complete_upload(upload_id, parts, options)
|
63
67
|
@client.complete_multipart_upload(
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
+
**complete_opts(options).merge(
|
69
|
+
upload_id: upload_id,
|
70
|
+
multipart_upload: { parts: parts }
|
71
|
+
)
|
68
72
|
)
|
69
73
|
end
|
70
74
|
|
@@ -123,6 +127,13 @@ module Aws
|
|
123
127
|
end
|
124
128
|
end
|
125
129
|
|
130
|
+
def complete_opts(options)
|
131
|
+
COMPLETE_OPTIONS.inject({}) do |hash, key|
|
132
|
+
hash[key] = options[key] if options.key?(key)
|
133
|
+
hash
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
126
137
|
def upload_part_opts(options)
|
127
138
|
UPLOAD_PART_OPTIONS.inject({}) do |hash, key|
|
128
139
|
hash[key] = options[key] if options.key?(key)
|
@@ -147,7 +158,15 @@ module Aws
|
|
147
158
|
end
|
148
159
|
resp = @client.upload_part(part)
|
149
160
|
part[:body].close
|
150
|
-
|
161
|
+
completed_part = {etag: resp.etag, part_number: part[:part_number]}
|
162
|
+
|
163
|
+
# get the requested checksum from the response
|
164
|
+
if part[:checksum_algorithm]
|
165
|
+
k = "checksum_#{part[:checksum_algorithm].downcase}".to_sym
|
166
|
+
completed_part[k] = resp[k]
|
167
|
+
end
|
168
|
+
|
169
|
+
completed.push(completed_part)
|
151
170
|
end
|
152
171
|
nil
|
153
172
|
rescue => error
|
@@ -224,4 +243,4 @@ module Aws
|
|
224
243
|
end
|
225
244
|
end
|
226
245
|
end
|
227
|
-
end
|
246
|
+
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# WARNING ABOUT GENERATED CODE
|
4
4
|
#
|
5
5
|
# This file is generated. See the contributing guide for more information:
|
6
|
-
# https://github.com/aws/aws-sdk-ruby/blob/
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
7
7
|
#
|
8
8
|
# WARNING ABOUT GENERATED CODE
|
9
9
|
|
@@ -87,6 +87,12 @@ module Aws::S3
|
|
87
87
|
data[:initiator]
|
88
88
|
end
|
89
89
|
|
90
|
+
# The algorithm that was used to create a checksum of the object.
|
91
|
+
# @return [String]
|
92
|
+
def checksum_algorithm
|
93
|
+
data[:checksum_algorithm]
|
94
|
+
end
|
95
|
+
|
90
96
|
# @!endgroup
|
91
97
|
|
92
98
|
# @return [Client]
|
@@ -226,17 +232,17 @@ module Aws::S3
|
|
226
232
|
# @option options [String] :request_payer
|
227
233
|
# Confirms that the requester knows that they will be charged for the
|
228
234
|
# request. Bucket owners need not specify this parameter in their
|
229
|
-
# requests. For information about downloading objects from
|
230
|
-
#
|
231
|
-
# in the *Amazon S3
|
235
|
+
# requests. For information about downloading objects from Requester
|
236
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
237
|
+
# in the *Amazon S3 User Guide*.
|
232
238
|
#
|
233
239
|
#
|
234
240
|
#
|
235
241
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
236
242
|
# @option options [String] :expected_bucket_owner
|
237
|
-
# The account
|
238
|
-
# a different account, the request
|
239
|
-
#
|
243
|
+
# The account ID of the expected bucket owner. If the bucket is owned by
|
244
|
+
# a different account, the request fails with the HTTP status code `403
|
245
|
+
# Forbidden` (access denied).
|
240
246
|
# @return [Types::AbortMultipartUploadOutput]
|
241
247
|
def abort(options = {})
|
242
248
|
options = options.merge(
|
@@ -255,30 +261,108 @@ module Aws::S3
|
|
255
261
|
# parts: [
|
256
262
|
# {
|
257
263
|
# etag: "ETag",
|
264
|
+
# checksum_crc32: "ChecksumCRC32",
|
265
|
+
# checksum_crc32c: "ChecksumCRC32C",
|
266
|
+
# checksum_sha1: "ChecksumSHA1",
|
267
|
+
# checksum_sha256: "ChecksumSHA256",
|
258
268
|
# part_number: 1,
|
259
269
|
# },
|
260
270
|
# ],
|
261
271
|
# },
|
272
|
+
# checksum_crc32: "ChecksumCRC32",
|
273
|
+
# checksum_crc32c: "ChecksumCRC32C",
|
274
|
+
# checksum_sha1: "ChecksumSHA1",
|
275
|
+
# checksum_sha256: "ChecksumSHA256",
|
262
276
|
# request_payer: "requester", # accepts requester
|
263
277
|
# expected_bucket_owner: "AccountId",
|
278
|
+
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
279
|
+
# sse_customer_key: "SSECustomerKey",
|
280
|
+
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
264
281
|
# })
|
265
282
|
# @param [Hash] options ({})
|
266
283
|
# @option options [Types::CompletedMultipartUpload] :multipart_upload
|
267
284
|
# The container for the multipart upload request information.
|
285
|
+
# @option options [String] :checksum_crc32
|
286
|
+
# This header can be used as a data integrity check to verify that the
|
287
|
+
# data received is the same data that was originally sent. This header
|
288
|
+
# specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
|
289
|
+
# more information, see [Checking object integrity][1] in the *Amazon S3
|
290
|
+
# User Guide*.
|
291
|
+
#
|
292
|
+
#
|
293
|
+
#
|
294
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
295
|
+
# @option options [String] :checksum_crc32c
|
296
|
+
# This header can be used as a data integrity check to verify that the
|
297
|
+
# data received is the same data that was originally sent. This header
|
298
|
+
# specifies the base64-encoded, 32-bit CRC32C checksum of the object.
|
299
|
+
# For more information, see [Checking object integrity][1] in the
|
300
|
+
# *Amazon S3 User Guide*.
|
301
|
+
#
|
302
|
+
#
|
303
|
+
#
|
304
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
305
|
+
# @option options [String] :checksum_sha1
|
306
|
+
# This header can be used as a data integrity check to verify that the
|
307
|
+
# data received is the same data that was originally sent. This header
|
308
|
+
# specifies the base64-encoded, 160-bit SHA-1 digest of the object. For
|
309
|
+
# more information, see [Checking object integrity][1] in the *Amazon S3
|
310
|
+
# User Guide*.
|
311
|
+
#
|
312
|
+
#
|
313
|
+
#
|
314
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
315
|
+
# @option options [String] :checksum_sha256
|
316
|
+
# This header can be used as a data integrity check to verify that the
|
317
|
+
# data received is the same data that was originally sent. This header
|
318
|
+
# specifies the base64-encoded, 256-bit SHA-256 digest of the object.
|
319
|
+
# For more information, see [Checking object integrity][1] in the
|
320
|
+
# *Amazon S3 User Guide*.
|
321
|
+
#
|
322
|
+
#
|
323
|
+
#
|
324
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
268
325
|
# @option options [String] :request_payer
|
269
326
|
# Confirms that the requester knows that they will be charged for the
|
270
327
|
# request. Bucket owners need not specify this parameter in their
|
271
|
-
# requests. For information about downloading objects from
|
272
|
-
#
|
273
|
-
# in the *Amazon S3
|
328
|
+
# requests. For information about downloading objects from Requester
|
329
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
330
|
+
# in the *Amazon S3 User Guide*.
|
274
331
|
#
|
275
332
|
#
|
276
333
|
#
|
277
334
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
278
335
|
# @option options [String] :expected_bucket_owner
|
279
|
-
# The account
|
280
|
-
# a different account, the request
|
281
|
-
#
|
336
|
+
# The account ID of the expected bucket owner. If the bucket is owned by
|
337
|
+
# a different account, the request fails with the HTTP status code `403
|
338
|
+
# Forbidden` (access denied).
|
339
|
+
# @option options [String] :sse_customer_algorithm
|
340
|
+
# The server-side encryption (SSE) algorithm used to encrypt the object.
|
341
|
+
# This parameter is needed only when the object was created using a
|
342
|
+
# checksum algorithm. For more information, see [Protecting data using
|
343
|
+
# SSE-C keys][1] in the *Amazon S3 User Guide*.
|
344
|
+
#
|
345
|
+
#
|
346
|
+
#
|
347
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
348
|
+
# @option options [String] :sse_customer_key
|
349
|
+
# The server-side encryption (SSE) customer managed key. This parameter
|
350
|
+
# is needed only when the object was created using a checksum algorithm.
|
351
|
+
# For more information, see [Protecting data using SSE-C keys][1] in the
|
352
|
+
# *Amazon S3 User Guide*.
|
353
|
+
#
|
354
|
+
#
|
355
|
+
#
|
356
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
357
|
+
# @option options [String] :sse_customer_key_md5
|
358
|
+
# The MD5 server-side encryption (SSE) customer managed key. This
|
359
|
+
# parameter is needed only when the object was created using a checksum
|
360
|
+
# algorithm. For more information, see [Protecting data using SSE-C
|
361
|
+
# keys][1] in the *Amazon S3 User Guide*.
|
362
|
+
#
|
363
|
+
#
|
364
|
+
#
|
365
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
282
366
|
# @return [Object]
|
283
367
|
def complete(options = {})
|
284
368
|
options = options.merge(
|
@@ -322,22 +406,52 @@ module Aws::S3
|
|
322
406
|
# parts = multipart_upload.parts({
|
323
407
|
# request_payer: "requester", # accepts requester
|
324
408
|
# expected_bucket_owner: "AccountId",
|
409
|
+
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
410
|
+
# sse_customer_key: "SSECustomerKey",
|
411
|
+
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
325
412
|
# })
|
326
413
|
# @param [Hash] options ({})
|
327
414
|
# @option options [String] :request_payer
|
328
415
|
# Confirms that the requester knows that they will be charged for the
|
329
416
|
# request. Bucket owners need not specify this parameter in their
|
330
|
-
# requests. For information about downloading objects from
|
331
|
-
#
|
332
|
-
# in the *Amazon S3
|
417
|
+
# requests. For information about downloading objects from Requester
|
418
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
419
|
+
# in the *Amazon S3 User Guide*.
|
333
420
|
#
|
334
421
|
#
|
335
422
|
#
|
336
423
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
337
424
|
# @option options [String] :expected_bucket_owner
|
338
|
-
# The account
|
339
|
-
# a different account, the request
|
340
|
-
#
|
425
|
+
# The account ID of the expected bucket owner. If the bucket is owned by
|
426
|
+
# a different account, the request fails with the HTTP status code `403
|
427
|
+
# Forbidden` (access denied).
|
428
|
+
# @option options [String] :sse_customer_algorithm
|
429
|
+
# The server-side encryption (SSE) algorithm used to encrypt the object.
|
430
|
+
# This parameter is needed only when the object was created using a
|
431
|
+
# checksum algorithm. For more information, see [Protecting data using
|
432
|
+
# SSE-C keys][1] in the *Amazon S3 User Guide*.
|
433
|
+
#
|
434
|
+
#
|
435
|
+
#
|
436
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
437
|
+
# @option options [String] :sse_customer_key
|
438
|
+
# The server-side encryption (SSE) customer managed key. This parameter
|
439
|
+
# is needed only when the object was created using a checksum algorithm.
|
440
|
+
# For more information, see [Protecting data using SSE-C keys][1] in the
|
441
|
+
# *Amazon S3 User Guide*.
|
442
|
+
#
|
443
|
+
#
|
444
|
+
#
|
445
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
446
|
+
# @option options [String] :sse_customer_key_md5
|
447
|
+
# The MD5 server-side encryption (SSE) customer managed key. This
|
448
|
+
# parameter is needed only when the object was created using a checksum
|
449
|
+
# algorithm. For more information, see [Protecting data using SSE-C
|
450
|
+
# keys][1] in the *Amazon S3 User Guide*.
|
451
|
+
#
|
452
|
+
#
|
453
|
+
#
|
454
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
341
455
|
# @return [MultipartUploadPart::Collection]
|
342
456
|
def parts(options = {})
|
343
457
|
batches = Enumerator.new do |y|
|