aws-sdk-s3 1.174.0 → 1.179.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +32 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-s3/bucket.rb +40 -26
- data/lib/aws-sdk-s3/bucket_acl.rb +5 -4
- data/lib/aws-sdk-s3/bucket_cors.rb +5 -4
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +1 -1
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +2 -2
- data/lib/aws-sdk-s3/bucket_logging.rb +1 -1
- data/lib/aws-sdk-s3/bucket_policy.rb +9 -8
- data/lib/aws-sdk-s3/bucket_request_payment.rb +2 -2
- data/lib/aws-sdk-s3/bucket_tagging.rb +2 -2
- data/lib/aws-sdk-s3/bucket_versioning.rb +6 -6
- data/lib/aws-sdk-s3/bucket_website.rb +2 -2
- data/lib/aws-sdk-s3/client.rb +1409 -867
- data/lib/aws-sdk-s3/client_api.rb +128 -2
- data/lib/aws-sdk-s3/endpoint_provider.rb +36 -0
- data/lib/aws-sdk-s3/endpoints.rb +42 -0
- data/lib/aws-sdk-s3/file_downloader.rb +4 -21
- data/lib/aws-sdk-s3/multipart_file_uploader.rb +31 -13
- data/lib/aws-sdk-s3/multipart_upload.rb +48 -6
- data/lib/aws-sdk-s3/multipart_upload_part.rb +52 -36
- data/lib/aws-sdk-s3/object.rb +111 -59
- data/lib/aws-sdk-s3/object_acl.rb +4 -4
- data/lib/aws-sdk-s3/object_summary.rb +63 -28
- data/lib/aws-sdk-s3/object_version.rb +21 -8
- data/lib/aws-sdk-s3/plugins/checksum_algorithm.rb +31 -0
- data/lib/aws-sdk-s3/plugins/express_session_auth.rb +11 -20
- data/lib/aws-sdk-s3/plugins/md5s.rb +10 -71
- data/lib/aws-sdk-s3/presigner.rb +5 -5
- data/lib/aws-sdk-s3/resource.rb +9 -8
- data/lib/aws-sdk-s3/types.rb +1264 -528
- data/lib/aws-sdk-s3.rb +1 -1
- data/sig/bucket.rbs +5 -4
- data/sig/bucket_acl.rbs +1 -1
- data/sig/bucket_cors.rbs +1 -1
- data/sig/bucket_lifecycle.rbs +1 -1
- data/sig/bucket_lifecycle_configuration.rbs +1 -1
- data/sig/bucket_logging.rbs +1 -1
- data/sig/bucket_policy.rbs +1 -1
- data/sig/bucket_request_payment.rbs +1 -1
- data/sig/bucket_tagging.rbs +1 -1
- data/sig/bucket_versioning.rbs +3 -3
- data/sig/bucket_website.rbs +1 -1
- data/sig/client.rbs +85 -31
- data/sig/multipart_upload.rbs +8 -1
- data/sig/multipart_upload_part.rbs +5 -1
- data/sig/object.rbs +13 -5
- data/sig/object_acl.rbs +1 -1
- data/sig/object_summary.rbs +11 -6
- data/sig/object_version.rbs +5 -2
- data/sig/resource.rbs +4 -2
- data/sig/types.rbs +126 -34
- metadata +5 -5
- data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +0 -31
@@ -16,7 +16,6 @@ module Aws
|
|
16
16
|
|
17
17
|
THREAD_COUNT = 10
|
18
18
|
|
19
|
-
# @api private
|
20
19
|
CREATE_OPTIONS = Set.new(
|
21
20
|
Client.api.operation(:create_multipart_upload).input.shape.member_names
|
22
21
|
)
|
@@ -25,11 +24,16 @@ module Aws
|
|
25
24
|
Client.api.operation(:complete_multipart_upload).input.shape.member_names
|
26
25
|
)
|
27
26
|
|
28
|
-
# @api private
|
29
27
|
UPLOAD_PART_OPTIONS = Set.new(
|
30
28
|
Client.api.operation(:upload_part).input.shape.member_names
|
31
29
|
)
|
32
30
|
|
31
|
+
CHECKSUM_KEYS = Set.new(
|
32
|
+
Client.api.operation(:upload_part).input.shape.members.map do |n, s|
|
33
|
+
n if s.location == 'header' && s.location_name.start_with?('x-amz-checksum-')
|
34
|
+
end.compact
|
35
|
+
)
|
36
|
+
|
33
37
|
# @option options [Client] :client
|
34
38
|
# @option options [Integer] :thread_count (THREAD_COUNT)
|
35
39
|
def initialize(options = {})
|
@@ -121,15 +125,27 @@ module Aws
|
|
121
125
|
parts
|
122
126
|
end
|
123
127
|
|
128
|
+
def checksum_key?(key)
|
129
|
+
CHECKSUM_KEYS.include?(key)
|
130
|
+
end
|
131
|
+
|
132
|
+
def has_checksum_key?(keys)
|
133
|
+
keys.any? { |key| checksum_key?(key) }
|
134
|
+
end
|
135
|
+
|
124
136
|
def create_opts(options)
|
125
|
-
|
137
|
+
opts = { checksum_algorithm: Aws::Plugins::ChecksumAlgorithm::DEFAULT_CHECKSUM }
|
138
|
+
opts[:checksum_type] = 'FULL_OBJECT' if has_checksum_key?(options.keys)
|
139
|
+
CREATE_OPTIONS.inject(opts) do |hash, key|
|
126
140
|
hash[key] = options[key] if options.key?(key)
|
127
141
|
hash
|
128
142
|
end
|
129
143
|
end
|
130
144
|
|
131
145
|
def complete_opts(options)
|
132
|
-
|
146
|
+
opts = {}
|
147
|
+
opts[:checksum_type] = 'FULL_OBJECT' if has_checksum_key?(options.keys)
|
148
|
+
COMPLETE_OPTIONS.inject(opts) do |hash, key|
|
133
149
|
hash[key] = options[key] if options.key?(key)
|
134
150
|
hash
|
135
151
|
end
|
@@ -137,7 +153,10 @@ module Aws
|
|
137
153
|
|
138
154
|
def upload_part_opts(options)
|
139
155
|
UPLOAD_PART_OPTIONS.inject({}) do |hash, key|
|
140
|
-
|
156
|
+
if options.key?(key)
|
157
|
+
# don't pass through checksum calculations
|
158
|
+
hash[key] = options[key] unless checksum_key?(key)
|
159
|
+
end
|
141
160
|
hash
|
142
161
|
end
|
143
162
|
end
|
@@ -159,14 +178,13 @@ module Aws
|
|
159
178
|
end
|
160
179
|
resp = @client.upload_part(part)
|
161
180
|
part[:body].close
|
162
|
-
completed_part = {
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
181
|
+
completed_part = {
|
182
|
+
etag: resp.etag,
|
183
|
+
part_number: part[:part_number]
|
184
|
+
}
|
185
|
+
algorithm = resp.context.params[:checksum_algorithm]
|
186
|
+
k = "checksum_#{algorithm.downcase}".to_sym
|
187
|
+
completed_part[k] = resp.send(k)
|
170
188
|
completed.push(completed_part)
|
171
189
|
end
|
172
190
|
nil
|
@@ -103,6 +103,18 @@ module Aws::S3
|
|
103
103
|
data[:checksum_algorithm]
|
104
104
|
end
|
105
105
|
|
106
|
+
# The checksum type that is used to calculate the object’s checksum
|
107
|
+
# value. For more information, see [Checking object integrity][1] in the
|
108
|
+
# *Amazon S3 User Guide*.
|
109
|
+
#
|
110
|
+
#
|
111
|
+
#
|
112
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
113
|
+
# @return [String]
|
114
|
+
def checksum_type
|
115
|
+
data[:checksum_type]
|
116
|
+
end
|
117
|
+
|
106
118
|
# @!endgroup
|
107
119
|
|
108
120
|
# @return [Client]
|
@@ -295,6 +307,7 @@ module Aws::S3
|
|
295
307
|
# etag: "ETag",
|
296
308
|
# checksum_crc32: "ChecksumCRC32",
|
297
309
|
# checksum_crc32c: "ChecksumCRC32C",
|
310
|
+
# checksum_crc64nvme: "ChecksumCRC64NVME",
|
298
311
|
# checksum_sha1: "ChecksumSHA1",
|
299
312
|
# checksum_sha256: "ChecksumSHA256",
|
300
313
|
# part_number: 1,
|
@@ -303,8 +316,11 @@ module Aws::S3
|
|
303
316
|
# },
|
304
317
|
# checksum_crc32: "ChecksumCRC32",
|
305
318
|
# checksum_crc32c: "ChecksumCRC32C",
|
319
|
+
# checksum_crc64nvme: "ChecksumCRC64NVME",
|
306
320
|
# checksum_sha1: "ChecksumSHA1",
|
307
321
|
# checksum_sha256: "ChecksumSHA256",
|
322
|
+
# checksum_type: "COMPOSITE", # accepts COMPOSITE, FULL_OBJECT
|
323
|
+
# mpu_object_size: 1,
|
308
324
|
# request_payer: "requester", # accepts requester
|
309
325
|
# expected_bucket_owner: "AccountId",
|
310
326
|
# if_match: "IfMatch",
|
@@ -319,7 +335,7 @@ module Aws::S3
|
|
319
335
|
# @option options [String] :checksum_crc32
|
320
336
|
# This header can be used as a data integrity check to verify that the
|
321
337
|
# data received is the same data that was originally sent. This header
|
322
|
-
# specifies the
|
338
|
+
# specifies the Base64 encoded, 32-bit `CRC-32` checksum of the object.
|
323
339
|
# For more information, see [Checking object integrity][1] in the
|
324
340
|
# *Amazon S3 User Guide*.
|
325
341
|
#
|
@@ -329,19 +345,30 @@ module Aws::S3
|
|
329
345
|
# @option options [String] :checksum_crc32c
|
330
346
|
# This header can be used as a data integrity check to verify that the
|
331
347
|
# data received is the same data that was originally sent. This header
|
332
|
-
# specifies the
|
348
|
+
# specifies the Base64 encoded, 32-bit `CRC-32C` checksum of the object.
|
333
349
|
# For more information, see [Checking object integrity][1] in the
|
334
350
|
# *Amazon S3 User Guide*.
|
335
351
|
#
|
336
352
|
#
|
337
353
|
#
|
338
354
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
355
|
+
# @option options [String] :checksum_crc64nvme
|
356
|
+
# This header can be used as a data integrity check to verify that the
|
357
|
+
# data received is the same data that was originally sent. This header
|
358
|
+
# specifies the Base64 encoded, 64-bit `CRC-64NVME` checksum of the
|
359
|
+
# object. The `CRC-64NVME` checksum is always a full object checksum.
|
360
|
+
# For more information, see [Checking object integrity in the Amazon S3
|
361
|
+
# User Guide][1].
|
362
|
+
#
|
363
|
+
#
|
364
|
+
#
|
365
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
339
366
|
# @option options [String] :checksum_sha1
|
340
367
|
# This header can be used as a data integrity check to verify that the
|
341
368
|
# data received is the same data that was originally sent. This header
|
342
|
-
# specifies the
|
343
|
-
# more information, see [Checking object integrity][1] in the
|
344
|
-
# User Guide*.
|
369
|
+
# specifies the Base64 encoded, 160-bit `SHA-1` digest of the object.
|
370
|
+
# For more information, see [Checking object integrity][1] in the
|
371
|
+
# *Amazon S3 User Guide*.
|
345
372
|
#
|
346
373
|
#
|
347
374
|
#
|
@@ -349,13 +376,28 @@ module Aws::S3
|
|
349
376
|
# @option options [String] :checksum_sha256
|
350
377
|
# This header can be used as a data integrity check to verify that the
|
351
378
|
# data received is the same data that was originally sent. This header
|
352
|
-
# specifies the
|
379
|
+
# specifies the Base64 encoded, 256-bit `SHA-256` digest of the object.
|
353
380
|
# For more information, see [Checking object integrity][1] in the
|
354
381
|
# *Amazon S3 User Guide*.
|
355
382
|
#
|
356
383
|
#
|
357
384
|
#
|
358
385
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
386
|
+
# @option options [String] :checksum_type
|
387
|
+
# This header specifies the checksum type of the object, which
|
388
|
+
# determines how part-level checksums are combined to create an
|
389
|
+
# object-level checksum for multipart objects. You can use this header
|
390
|
+
# as a data integrity check to verify that the checksum type that is
|
391
|
+
# received is the same checksum that was specified. If the checksum type
|
392
|
+
# doesn’t match the checksum type that was specified for the object
|
393
|
+
# during the `CreateMultipartUpload` request, it’ll result in a
|
394
|
+
# `BadDigest` error. For more information, see Checking object integrity
|
395
|
+
# in the Amazon S3 User Guide.
|
396
|
+
# @option options [Integer] :mpu_object_size
|
397
|
+
# The expected total object size of the multipart upload request. If
|
398
|
+
# there’s a mismatch between the specified object size value and the
|
399
|
+
# actual object size value, it results in an `HTTP 400 InvalidRequest`
|
400
|
+
# error.
|
359
401
|
# @option options [String] :request_payer
|
360
402
|
# Confirms that the requester knows that they will be charged for the
|
361
403
|
# request. Bucket owners need not specify this parameter in their
|
@@ -76,11 +76,10 @@ module Aws::S3
|
|
76
76
|
data[:size]
|
77
77
|
end
|
78
78
|
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
# *Amazon S3 User Guide*.
|
79
|
+
# The Base64 encoded, 32-bit `CRC-32` checksum of the part. This
|
80
|
+
# checksum is present if the object was uploaded with the `CRC-32`
|
81
|
+
# checksum algorithm. For more information, see [Checking object
|
82
|
+
# integrity][1] in the *Amazon S3 User Guide*.
|
84
83
|
#
|
85
84
|
#
|
86
85
|
#
|
@@ -90,45 +89,51 @@ module Aws::S3
|
|
90
89
|
data[:checksum_crc32]
|
91
90
|
end
|
92
91
|
|
93
|
-
# The
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
# Instead, it's a calculation based on the checksum values of each
|
98
|
-
# individual part. For more information about how checksums are
|
99
|
-
# calculated with multipart uploads, see [ Checking object integrity][1]
|
100
|
-
# in the *Amazon S3 User Guide*.
|
92
|
+
# The Base64 encoded, 32-bit `CRC-32C` checksum of the part. This
|
93
|
+
# checksum is present if the object was uploaded with the `CRC-32C`
|
94
|
+
# checksum algorithm. For more information, see [Checking object
|
95
|
+
# integrity][1] in the *Amazon S3 User Guide*.
|
101
96
|
#
|
102
97
|
#
|
103
98
|
#
|
104
|
-
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
99
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
105
100
|
# @return [String]
|
106
101
|
def checksum_crc32c
|
107
102
|
data[:checksum_crc32c]
|
108
103
|
end
|
109
104
|
|
110
|
-
# The
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
114
|
-
#
|
115
|
-
#
|
116
|
-
# multipart uploads, see [ Checking object integrity][1] in the *Amazon
|
117
|
-
# S3 User Guide*.
|
105
|
+
# The Base64 encoded, 64-bit `CRC-64NVME` checksum of the part. This
|
106
|
+
# checksum is present if the multipart upload request was created with
|
107
|
+
# the `CRC-64NVME` checksum algorithm, or if the object was uploaded
|
108
|
+
# without a checksum (and Amazon S3 added the default checksum,
|
109
|
+
# `CRC-64NVME`, to the uploaded object). For more information, see
|
110
|
+
# [Checking object integrity][1] in the *Amazon S3 User Guide*.
|
118
111
|
#
|
119
112
|
#
|
120
113
|
#
|
121
|
-
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
114
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
115
|
+
# @return [String]
|
116
|
+
def checksum_crc64nvme
|
117
|
+
data[:checksum_crc64nvme]
|
118
|
+
end
|
119
|
+
|
120
|
+
# The Base64 encoded, 160-bit `SHA-1` checksum of the part. This
|
121
|
+
# checksum is present if the object was uploaded with the `SHA-1`
|
122
|
+
# checksum algorithm. For more information, see [Checking object
|
123
|
+
# integrity][1] in the *Amazon S3 User Guide*.
|
124
|
+
#
|
125
|
+
#
|
126
|
+
#
|
127
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
122
128
|
# @return [String]
|
123
129
|
def checksum_sha1
|
124
130
|
data[:checksum_sha1]
|
125
131
|
end
|
126
132
|
|
127
|
-
#
|
128
|
-
#
|
129
|
-
#
|
130
|
-
#
|
131
|
-
# *Amazon S3 User Guide*.
|
133
|
+
# The Base64 encoded, 256-bit `SHA-256` checksum of the part. This
|
134
|
+
# checksum is present if the object was uploaded with the `SHA-256`
|
135
|
+
# checksum algorithm. For more information, see [Checking object
|
136
|
+
# integrity][1] in the *Amazon S3 User Guide*.
|
132
137
|
#
|
133
138
|
#
|
134
139
|
#
|
@@ -512,9 +517,10 @@ module Aws::S3
|
|
512
517
|
# body: source_file,
|
513
518
|
# content_length: 1,
|
514
519
|
# content_md5: "ContentMD5",
|
515
|
-
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
|
520
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
|
516
521
|
# checksum_crc32: "ChecksumCRC32",
|
517
522
|
# checksum_crc32c: "ChecksumCRC32C",
|
523
|
+
# checksum_crc64nvme: "ChecksumCRC64NVME",
|
518
524
|
# checksum_sha1: "ChecksumSHA1",
|
519
525
|
# checksum_sha256: "ChecksumSHA256",
|
520
526
|
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
@@ -530,7 +536,7 @@ module Aws::S3
|
|
530
536
|
# Size of the body in bytes. This parameter is useful when the size of
|
531
537
|
# the body cannot be determined automatically.
|
532
538
|
# @option options [String] :content_md5
|
533
|
-
# The
|
539
|
+
# The Base64 encoded 128-bit MD5 digest of the part data. This parameter
|
534
540
|
# is auto-populated when using the command from the CLI. This parameter
|
535
541
|
# is required if object lock parameters are specified.
|
536
542
|
#
|
@@ -558,7 +564,7 @@ module Aws::S3
|
|
558
564
|
# @option options [String] :checksum_crc32
|
559
565
|
# This header can be used as a data integrity check to verify that the
|
560
566
|
# data received is the same data that was originally sent. This header
|
561
|
-
# specifies the
|
567
|
+
# specifies the Base64 encoded, 32-bit `CRC-32` checksum of the object.
|
562
568
|
# For more information, see [Checking object integrity][1] in the
|
563
569
|
# *Amazon S3 User Guide*.
|
564
570
|
#
|
@@ -568,19 +574,29 @@ module Aws::S3
|
|
568
574
|
# @option options [String] :checksum_crc32c
|
569
575
|
# This header can be used as a data integrity check to verify that the
|
570
576
|
# data received is the same data that was originally sent. This header
|
571
|
-
# specifies the
|
577
|
+
# specifies the Base64 encoded, 32-bit `CRC-32C` checksum of the object.
|
572
578
|
# For more information, see [Checking object integrity][1] in the
|
573
579
|
# *Amazon S3 User Guide*.
|
574
580
|
#
|
575
581
|
#
|
576
582
|
#
|
577
583
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
584
|
+
# @option options [String] :checksum_crc64nvme
|
585
|
+
# This header can be used as a data integrity check to verify that the
|
586
|
+
# data received is the same data that was originally sent. This header
|
587
|
+
# specifies the Base64 encoded, 64-bit `CRC-64NVME` checksum of the
|
588
|
+
# part. For more information, see [Checking object integrity][1] in the
|
589
|
+
# *Amazon S3 User Guide*.
|
590
|
+
#
|
591
|
+
#
|
592
|
+
#
|
593
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
578
594
|
# @option options [String] :checksum_sha1
|
579
595
|
# This header can be used as a data integrity check to verify that the
|
580
596
|
# data received is the same data that was originally sent. This header
|
581
|
-
# specifies the
|
582
|
-
# more information, see [Checking object integrity][1] in the
|
583
|
-
# User Guide*.
|
597
|
+
# specifies the Base64 encoded, 160-bit `SHA-1` digest of the object.
|
598
|
+
# For more information, see [Checking object integrity][1] in the
|
599
|
+
# *Amazon S3 User Guide*.
|
584
600
|
#
|
585
601
|
#
|
586
602
|
#
|
@@ -588,7 +604,7 @@ module Aws::S3
|
|
588
604
|
# @option options [String] :checksum_sha256
|
589
605
|
# This header can be used as a data integrity check to verify that the
|
590
606
|
# data received is the same data that was originally sent. This header
|
591
|
-
# specifies the
|
607
|
+
# specifies the Base64 encoded, 256-bit `SHA-256` digest of the object.
|
592
608
|
# For more information, see [Checking object integrity][1] in the
|
593
609
|
# *Amazon S3 User Guide*.
|
594
610
|
#
|