aws-sdk-s3 1.176.1 → 1.183.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 +37 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-s3/bucket.rb +43 -31
- data/lib/aws-sdk-s3/bucket_acl.rb +6 -5
- data/lib/aws-sdk-s3/bucket_cors.rb +6 -5
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +2 -2
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +3 -3
- data/lib/aws-sdk-s3/bucket_logging.rb +2 -2
- data/lib/aws-sdk-s3/bucket_policy.rb +6 -5
- data/lib/aws-sdk-s3/bucket_request_payment.rb +3 -3
- data/lib/aws-sdk-s3/bucket_tagging.rb +3 -3
- data/lib/aws-sdk-s3/bucket_versioning.rb +9 -9
- data/lib/aws-sdk-s3/bucket_website.rb +3 -3
- data/lib/aws-sdk-s3/client.rb +1066 -862
- data/lib/aws-sdk-s3/client_api.rb +35 -2
- data/lib/aws-sdk-s3/endpoint_provider.rb +369 -281
- 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 +50 -6
- data/lib/aws-sdk-s3/multipart_upload_part.rb +50 -34
- data/lib/aws-sdk-s3/object.rb +159 -113
- data/lib/aws-sdk-s3/object_acl.rb +4 -4
- data/lib/aws-sdk-s3/object_summary.rb +107 -83
- data/lib/aws-sdk-s3/object_version.rb +18 -14
- 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 +4 -5
- data/lib/aws-sdk-s3/resource.rb +1 -1
- data/lib/aws-sdk-s3/types.rb +1259 -820
- data/lib/aws-sdk-s3.rb +1 -1
- data/sig/bucket.rbs +4 -3
- 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 +53 -31
- data/sig/multipart_upload.rbs +8 -1
- data/sig/multipart_upload_part.rbs +5 -1
- data/sig/object.rbs +16 -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 +3 -1
- data/sig/types.rbs +64 -34
- metadata +5 -5
- data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +0 -31
@@ -84,6 +84,18 @@ module Aws::S3
|
|
84
84
|
data[:checksum_algorithm]
|
85
85
|
end
|
86
86
|
|
87
|
+
# The checksum type that is used to calculate the object’s checksum
|
88
|
+
# value. For more information, see [Checking object integrity][1] in the
|
89
|
+
# *Amazon S3 User Guide*.
|
90
|
+
#
|
91
|
+
#
|
92
|
+
#
|
93
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
94
|
+
# @return [String]
|
95
|
+
def checksum_type
|
96
|
+
data[:checksum_type]
|
97
|
+
end
|
98
|
+
|
87
99
|
# Size in bytes of the object
|
88
100
|
# @return [Integer]
|
89
101
|
def size
|
@@ -92,8 +104,10 @@ module Aws::S3
|
|
92
104
|
|
93
105
|
# The class of storage used to store the object.
|
94
106
|
#
|
95
|
-
# <note markdown="1"> **Directory buckets** -
|
96
|
-
#
|
107
|
+
# <note markdown="1"> **Directory buckets** - Directory buckets only support
|
108
|
+
# `EXPRESS_ONEZONE` (the S3 Express One Zone storage class) in
|
109
|
+
# Availability Zones and `ONEZONE_IA` (the S3 One Zone-Infrequent Access
|
110
|
+
# storage class) in Dedicated Local Zones.
|
97
111
|
#
|
98
112
|
# </note>
|
99
113
|
# @return [String]
|
@@ -118,9 +132,10 @@ module Aws::S3
|
|
118
132
|
# archived objects, see [ Working with archived objects][1] in the
|
119
133
|
# *Amazon S3 User Guide*.
|
120
134
|
#
|
121
|
-
# <note markdown="1"> This functionality is not supported for directory buckets.
|
122
|
-
#
|
123
|
-
#
|
135
|
+
# <note markdown="1"> This functionality is not supported for directory buckets. Directory
|
136
|
+
# buckets only support `EXPRESS_ONEZONE` (the S3 Express One Zone
|
137
|
+
# storage class) in Availability Zones and `ONEZONE_IA` (the S3 One
|
138
|
+
# Zone-Infrequent Access storage class) in Dedicated Local Zones.
|
124
139
|
#
|
125
140
|
# </note>
|
126
141
|
#
|
@@ -324,7 +339,7 @@ module Aws::S3
|
|
324
339
|
# object_summary.copy_from({
|
325
340
|
# acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control
|
326
341
|
# cache_control: "CacheControl",
|
327
|
-
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
|
342
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
|
328
343
|
# content_disposition: "ContentDisposition",
|
329
344
|
# content_encoding: "ContentEncoding",
|
330
345
|
# content_language: "ContentLanguage",
|
@@ -749,10 +764,12 @@ module Aws::S3
|
|
749
764
|
# availability. Depending on performance needs, you can specify a
|
750
765
|
# different Storage Class.
|
751
766
|
#
|
752
|
-
# <note markdown="1"> * <b>Directory buckets </b> -
|
753
|
-
# Express One Zone storage class
|
754
|
-
#
|
755
|
-
#
|
767
|
+
# <note markdown="1"> * <b>Directory buckets </b> - Directory buckets only support
|
768
|
+
# `EXPRESS_ONEZONE` (the S3 Express One Zone storage class) in
|
769
|
+
# Availability Zones and `ONEZONE_IA` (the S3 One Zone-Infrequent
|
770
|
+
# Access storage class) in Dedicated Local Zones. Unsupported storage
|
771
|
+
# class values won't write a destination object and will respond with
|
772
|
+
# the HTTP status code `400 Bad Request`.
|
756
773
|
#
|
757
774
|
# * <b>Amazon S3 on Outposts </b> - S3 on Outposts only uses the
|
758
775
|
# `OUTPOSTS` Storage Class.
|
@@ -840,20 +857,17 @@ module Aws::S3
|
|
840
857
|
# Signature Version in Request Authentication][1] in the *Amazon S3 User
|
841
858
|
# Guide*.
|
842
859
|
#
|
843
|
-
# **Directory buckets** -
|
844
|
-
#
|
845
|
-
#
|
846
|
-
#
|
847
|
-
#
|
848
|
-
# x-amz-server-side-encryption-aws-kms-key-id` header
|
849
|
-
#
|
850
|
-
#
|
851
|
-
#
|
852
|
-
#
|
853
|
-
#
|
854
|
-
# support 1 [customer managed key][2] per directory bucket for the
|
855
|
-
# lifetime of the bucket. The [Amazon Web Services managed key][3]
|
856
|
-
# (`aws/s3`) isn't supported.
|
860
|
+
# **Directory buckets** - To encrypt data using SSE-KMS, it's
|
861
|
+
# recommended to specify the `x-amz-server-side-encryption` header to
|
862
|
+
# `aws:kms`. Then, the `x-amz-server-side-encryption-aws-kms-key-id`
|
863
|
+
# header implicitly uses the bucket's default KMS customer managed key
|
864
|
+
# ID. If you want to explicitly set the `
|
865
|
+
# x-amz-server-side-encryption-aws-kms-key-id` header, it must match the
|
866
|
+
# bucket's default customer managed key (using key ID or ARN, not
|
867
|
+
# alias). Your SSE-KMS configuration can only support 1 [customer
|
868
|
+
# managed key][2] per directory bucket's lifetime. The [Amazon Web
|
869
|
+
# Services managed key][3] (`aws/s3`) isn't supported. Incorrect key
|
870
|
+
# specification results in an HTTP `400 Bad Request` error.
|
857
871
|
#
|
858
872
|
#
|
859
873
|
#
|
@@ -1124,7 +1138,7 @@ module Aws::S3
|
|
1124
1138
|
#
|
1125
1139
|
#
|
1126
1140
|
#
|
1127
|
-
# [1]: https://
|
1141
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
1128
1142
|
# @option options [Time,DateTime,Date,Integer,String] :if_match_last_modified_time
|
1129
1143
|
# If present, the object is deleted only if its modification times
|
1130
1144
|
# matches the provided `Timestamp`. If the `Timestamp` values do not
|
@@ -1405,15 +1419,6 @@ module Aws::S3
|
|
1405
1419
|
# fails with the HTTP status code `403 Forbidden` (access denied).
|
1406
1420
|
# @option options [String] :checksum_mode
|
1407
1421
|
# To retrieve the checksum, this mode must be enabled.
|
1408
|
-
#
|
1409
|
-
# **General purpose buckets** - In addition, if you enable checksum mode
|
1410
|
-
# and the object is uploaded with a [checksum][1] and encrypted with an
|
1411
|
-
# Key Management Service (KMS) key, you must have permission to use the
|
1412
|
-
# `kms:Decrypt` action to retrieve the checksum.
|
1413
|
-
#
|
1414
|
-
#
|
1415
|
-
#
|
1416
|
-
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html
|
1417
1422
|
# @return [Types::GetObjectOutput]
|
1418
1423
|
def get(options = {}, &block)
|
1419
1424
|
options = options.merge(
|
@@ -1458,7 +1463,8 @@ module Aws::S3
|
|
1458
1463
|
# object_lock_retain_until_date: Time.now,
|
1459
1464
|
# object_lock_legal_hold_status: "ON", # accepts ON, OFF
|
1460
1465
|
# expected_bucket_owner: "AccountId",
|
1461
|
-
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
|
1466
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
|
1467
|
+
# checksum_type: "COMPOSITE", # accepts COMPOSITE, FULL_OBJECT
|
1462
1468
|
# })
|
1463
1469
|
# @param [Hash] options ({})
|
1464
1470
|
# @option options [String] :acl
|
@@ -1815,8 +1821,9 @@ module Aws::S3
|
|
1815
1821
|
# a different Storage Class. For more information, see [Storage
|
1816
1822
|
# Classes][1] in the *Amazon S3 User Guide*.
|
1817
1823
|
#
|
1818
|
-
# <note markdown="1"> *
|
1819
|
-
#
|
1824
|
+
# <note markdown="1"> * Directory buckets only support `EXPRESS_ONEZONE` (the S3 Express One
|
1825
|
+
# Zone storage class) in Availability Zones and `ONEZONE_IA` (the S3
|
1826
|
+
# One Zone-Infrequent Access storage class) in Dedicated Local Zones.
|
1820
1827
|
#
|
1821
1828
|
# * Amazon S3 on Outposts only uses the OUTPOSTS Storage Class.
|
1822
1829
|
#
|
@@ -1873,20 +1880,17 @@ module Aws::S3
|
|
1873
1880
|
# `x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the
|
1874
1881
|
# Amazon Web Services managed key (`aws/s3`) to protect the data.
|
1875
1882
|
#
|
1876
|
-
# **Directory buckets** -
|
1877
|
-
#
|
1878
|
-
#
|
1879
|
-
#
|
1880
|
-
#
|
1881
|
-
# x-amz-server-side-encryption-aws-kms-key-id` header
|
1882
|
-
#
|
1883
|
-
#
|
1884
|
-
#
|
1885
|
-
#
|
1886
|
-
#
|
1887
|
-
# support 1 [customer managed key][1] per directory bucket for the
|
1888
|
-
# lifetime of the bucket. The [Amazon Web Services managed key][2]
|
1889
|
-
# (`aws/s3`) isn't supported.
|
1883
|
+
# **Directory buckets** - To encrypt data using SSE-KMS, it's
|
1884
|
+
# recommended to specify the `x-amz-server-side-encryption` header to
|
1885
|
+
# `aws:kms`. Then, the `x-amz-server-side-encryption-aws-kms-key-id`
|
1886
|
+
# header implicitly uses the bucket's default KMS customer managed key
|
1887
|
+
# ID. If you want to explicitly set the `
|
1888
|
+
# x-amz-server-side-encryption-aws-kms-key-id` header, it must match the
|
1889
|
+
# bucket's default customer managed key (using key ID or ARN, not
|
1890
|
+
# alias). Your SSE-KMS configuration can only support 1 [customer
|
1891
|
+
# managed key][1] per directory bucket's lifetime. The [Amazon Web
|
1892
|
+
# Services managed key][2] (`aws/s3`) isn't supported. Incorrect key
|
1893
|
+
# specification results in an HTTP `400 Bad Request` error.
|
1890
1894
|
#
|
1891
1895
|
#
|
1892
1896
|
#
|
@@ -1894,7 +1898,7 @@ module Aws::S3
|
|
1894
1898
|
# [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
|
1895
1899
|
# @option options [String] :ssekms_encryption_context
|
1896
1900
|
# Specifies the Amazon Web Services KMS Encryption Context to use for
|
1897
|
-
# object encryption. The value of this header is a Base64
|
1901
|
+
# object encryption. The value of this header is a Base64 encoded string
|
1898
1902
|
# of a UTF-8 encoded JSON, which contains the encryption context as
|
1899
1903
|
# key-value pairs.
|
1900
1904
|
#
|
@@ -1983,6 +1987,14 @@ module Aws::S3
|
|
1983
1987
|
#
|
1984
1988
|
#
|
1985
1989
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
1990
|
+
# @option options [String] :checksum_type
|
1991
|
+
# Indicates the checksum type that you want Amazon S3 to use to
|
1992
|
+
# calculate the object’s checksum value. For more information, see
|
1993
|
+
# [Checking object integrity in the Amazon S3 User Guide][1].
|
1994
|
+
#
|
1995
|
+
#
|
1996
|
+
#
|
1997
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
1986
1998
|
# @return [MultipartUpload]
|
1987
1999
|
def initiate_multipart_upload(options = {})
|
1988
2000
|
options = options.merge(
|
@@ -2012,9 +2024,10 @@ module Aws::S3
|
|
2012
2024
|
# content_length: 1,
|
2013
2025
|
# content_md5: "ContentMD5",
|
2014
2026
|
# content_type: "ContentType",
|
2015
|
-
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
|
2027
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
|
2016
2028
|
# checksum_crc32: "ChecksumCRC32",
|
2017
2029
|
# checksum_crc32c: "ChecksumCRC32C",
|
2030
|
+
# checksum_crc64nvme: "ChecksumCRC64NVME",
|
2018
2031
|
# checksum_sha1: "ChecksumSHA1",
|
2019
2032
|
# checksum_sha256: "ChecksumSHA256",
|
2020
2033
|
# expires: Time.now,
|
@@ -2120,7 +2133,7 @@ module Aws::S3
|
|
2120
2133
|
#
|
2121
2134
|
# [1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length
|
2122
2135
|
# @option options [String] :content_md5
|
2123
|
-
# The
|
2136
|
+
# The Base64 encoded 128-bit `MD5` digest of the message (without the
|
2124
2137
|
# headers) according to RFC 1864. This header can be used as a message
|
2125
2138
|
# integrity check to verify that the data is the same data that was
|
2126
2139
|
# originally sent. Although it is optional, we recommend using the
|
@@ -2167,6 +2180,8 @@ module Aws::S3
|
|
2167
2180
|
#
|
2168
2181
|
# * `CRC32C`
|
2169
2182
|
#
|
2183
|
+
# * `CRC64NVME`
|
2184
|
+
#
|
2170
2185
|
# * `SHA1`
|
2171
2186
|
#
|
2172
2187
|
# * `SHA256`
|
@@ -2176,9 +2191,8 @@ module Aws::S3
|
|
2176
2191
|
#
|
2177
2192
|
# If the individual checksum value you provide through
|
2178
2193
|
# `x-amz-checksum-algorithm ` doesn't match the checksum algorithm you
|
2179
|
-
# set through `x-amz-sdk-checksum-algorithm`, Amazon S3
|
2180
|
-
#
|
2181
|
-
# that matches the provided value in `x-amz-checksum-algorithm `.
|
2194
|
+
# set through `x-amz-sdk-checksum-algorithm`, Amazon S3 fails the
|
2195
|
+
# request with a `BadDigest` error.
|
2182
2196
|
#
|
2183
2197
|
# <note markdown="1"> The `Content-MD5` or `x-amz-sdk-checksum-algorithm` header is required
|
2184
2198
|
# for any request to upload an object with a retention period configured
|
@@ -2198,7 +2212,7 @@ module Aws::S3
|
|
2198
2212
|
# @option options [String] :checksum_crc32
|
2199
2213
|
# This header can be used as a data integrity check to verify that the
|
2200
2214
|
# data received is the same data that was originally sent. This header
|
2201
|
-
# specifies the
|
2215
|
+
# specifies the Base64 encoded, 32-bit `CRC32` checksum of the object.
|
2202
2216
|
# For more information, see [Checking object integrity][1] in the
|
2203
2217
|
# *Amazon S3 User Guide*.
|
2204
2218
|
#
|
@@ -2208,17 +2222,28 @@ module Aws::S3
|
|
2208
2222
|
# @option options [String] :checksum_crc32c
|
2209
2223
|
# This header can be used as a data integrity check to verify that the
|
2210
2224
|
# data received is the same data that was originally sent. This header
|
2211
|
-
# specifies the
|
2225
|
+
# specifies the Base64 encoded, 32-bit `CRC32C` checksum of the object.
|
2212
2226
|
# For more information, see [Checking object integrity][1] in the
|
2213
2227
|
# *Amazon S3 User Guide*.
|
2214
2228
|
#
|
2215
2229
|
#
|
2216
2230
|
#
|
2217
2231
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
2232
|
+
# @option options [String] :checksum_crc64nvme
|
2233
|
+
# This header can be used as a data integrity check to verify that the
|
2234
|
+
# data received is the same data that was originally sent. This header
|
2235
|
+
# specifies the Base64 encoded, 64-bit `CRC64NVME` checksum of the
|
2236
|
+
# object. The `CRC64NVME` checksum is always a full object checksum. For
|
2237
|
+
# more information, see [Checking object integrity in the Amazon S3 User
|
2238
|
+
# Guide][1].
|
2239
|
+
#
|
2240
|
+
#
|
2241
|
+
#
|
2242
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
2218
2243
|
# @option options [String] :checksum_sha1
|
2219
2244
|
# This header can be used as a data integrity check to verify that the
|
2220
2245
|
# data received is the same data that was originally sent. This header
|
2221
|
-
# specifies the
|
2246
|
+
# specifies the Base64 encoded, 160-bit `SHA1` digest of the object. For
|
2222
2247
|
# more information, see [Checking object integrity][1] in the *Amazon S3
|
2223
2248
|
# User Guide*.
|
2224
2249
|
#
|
@@ -2228,7 +2253,7 @@ module Aws::S3
|
|
2228
2253
|
# @option options [String] :checksum_sha256
|
2229
2254
|
# This header can be used as a data integrity check to verify that the
|
2230
2255
|
# data received is the same data that was originally sent. This header
|
2231
|
-
# specifies the
|
2256
|
+
# specifies the Base64 encoded, 256-bit `SHA256` digest of the object.
|
2232
2257
|
# For more information, see [Checking object integrity][1] in the
|
2233
2258
|
# *Amazon S3 User Guide*.
|
2234
2259
|
#
|
@@ -2396,8 +2421,9 @@ module Aws::S3
|
|
2396
2421
|
# a different Storage Class. For more information, see [Storage
|
2397
2422
|
# Classes][1] in the *Amazon S3 User Guide*.
|
2398
2423
|
#
|
2399
|
-
# <note markdown="1"> *
|
2400
|
-
#
|
2424
|
+
# <note markdown="1"> * Directory buckets only support `EXPRESS_ONEZONE` (the S3 Express One
|
2425
|
+
# Zone storage class) in Availability Zones and `ONEZONE_IA` (the S3
|
2426
|
+
# One Zone-Infrequent Access storage class) in Dedicated Local Zones.
|
2401
2427
|
#
|
2402
2428
|
# * Amazon S3 on Outposts only uses the OUTPOSTS Storage Class.
|
2403
2429
|
#
|
@@ -2475,20 +2501,17 @@ module Aws::S3
|
|
2475
2501
|
# `x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the
|
2476
2502
|
# Amazon Web Services managed key (`aws/s3`) to protect the data.
|
2477
2503
|
#
|
2478
|
-
# **Directory buckets** -
|
2479
|
-
#
|
2480
|
-
#
|
2481
|
-
#
|
2482
|
-
#
|
2483
|
-
# x-amz-server-side-encryption-aws-kms-key-id` header
|
2484
|
-
#
|
2485
|
-
#
|
2486
|
-
#
|
2487
|
-
#
|
2488
|
-
#
|
2489
|
-
# support 1 [customer managed key][1] per directory bucket for the
|
2490
|
-
# lifetime of the bucket. The [Amazon Web Services managed key][2]
|
2491
|
-
# (`aws/s3`) isn't supported.
|
2504
|
+
# **Directory buckets** - To encrypt data using SSE-KMS, it's
|
2505
|
+
# recommended to specify the `x-amz-server-side-encryption` header to
|
2506
|
+
# `aws:kms`. Then, the `x-amz-server-side-encryption-aws-kms-key-id`
|
2507
|
+
# header implicitly uses the bucket's default KMS customer managed key
|
2508
|
+
# ID. If you want to explicitly set the `
|
2509
|
+
# x-amz-server-side-encryption-aws-kms-key-id` header, it must match the
|
2510
|
+
# bucket's default customer managed key (using key ID or ARN, not
|
2511
|
+
# alias). Your SSE-KMS configuration can only support 1 [customer
|
2512
|
+
# managed key][1] per directory bucket's lifetime. The [Amazon Web
|
2513
|
+
# Services managed key][2] (`aws/s3`) isn't supported. Incorrect key
|
2514
|
+
# specification results in an HTTP `400 Bad Request` error.
|
2492
2515
|
#
|
2493
2516
|
#
|
2494
2517
|
#
|
@@ -2497,7 +2520,7 @@ module Aws::S3
|
|
2497
2520
|
# @option options [String] :ssekms_encryption_context
|
2498
2521
|
# Specifies the Amazon Web Services KMS Encryption Context as an
|
2499
2522
|
# additional encryption context to use for object encryption. The value
|
2500
|
-
# of this header is a Base64
|
2523
|
+
# of this header is a Base64 encoded string of a UTF-8 encoded JSON,
|
2501
2524
|
# which contains the encryption context as key-value pairs. This value
|
2502
2525
|
# is stored as object metadata and automatically gets passed on to
|
2503
2526
|
# Amazon Web Services KMS for future `GetObject` operations on this
|
@@ -2692,7 +2715,7 @@ module Aws::S3
|
|
2692
2715
|
# },
|
2693
2716
|
# },
|
2694
2717
|
# request_payer: "requester", # accepts requester
|
2695
|
-
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
|
2718
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
|
2696
2719
|
# expected_bucket_owner: "AccountId",
|
2697
2720
|
# })
|
2698
2721
|
# @param [Hash] options ({})
|
@@ -2869,7 +2892,7 @@ module Aws::S3
|
|
2869
2892
|
# request_payer: "requester", # accepts requester
|
2870
2893
|
# bypass_governance_retention: false,
|
2871
2894
|
# expected_bucket_owner: "AccountId",
|
2872
|
-
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
|
2895
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
|
2873
2896
|
# })
|
2874
2897
|
# @param options ({})
|
2875
2898
|
# @option options [String] :mfa
|
@@ -2937,6 +2960,8 @@ module Aws::S3
|
|
2937
2960
|
#
|
2938
2961
|
# * `CRC32C`
|
2939
2962
|
#
|
2963
|
+
# * `CRC64NVME`
|
2964
|
+
#
|
2940
2965
|
# * `SHA1`
|
2941
2966
|
#
|
2942
2967
|
# * `SHA256`
|
@@ -2946,9 +2971,8 @@ module Aws::S3
|
|
2946
2971
|
#
|
2947
2972
|
# If the individual checksum value you provide through
|
2948
2973
|
# `x-amz-checksum-algorithm ` doesn't match the checksum algorithm you
|
2949
|
-
# set through `x-amz-sdk-checksum-algorithm`, Amazon S3
|
2950
|
-
#
|
2951
|
-
# that matches the provided value in `x-amz-checksum-algorithm `.
|
2974
|
+
# set through `x-amz-sdk-checksum-algorithm`, Amazon S3 fails the
|
2975
|
+
# request with a `BadDigest` error.
|
2952
2976
|
#
|
2953
2977
|
# If you provide an individual checksum, Amazon S3 ignores any provided
|
2954
2978
|
# `ChecksumAlgorithm` parameter.
|
@@ -62,6 +62,18 @@ module Aws::S3
|
|
62
62
|
data[:checksum_algorithm]
|
63
63
|
end
|
64
64
|
|
65
|
+
# The checksum type that is used to calculate the object’s checksum
|
66
|
+
# value. For more information, see [Checking object integrity][1] in the
|
67
|
+
# *Amazon S3 User Guide*.
|
68
|
+
#
|
69
|
+
#
|
70
|
+
#
|
71
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
72
|
+
# @return [String]
|
73
|
+
def checksum_type
|
74
|
+
data[:checksum_type]
|
75
|
+
end
|
76
|
+
|
65
77
|
# Size in bytes of the object.
|
66
78
|
# @return [Integer]
|
67
79
|
def size
|
@@ -314,7 +326,7 @@ module Aws::S3
|
|
314
326
|
#
|
315
327
|
#
|
316
328
|
#
|
317
|
-
# [1]: https://
|
329
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
318
330
|
# @option options [Time,DateTime,Date,Integer,String] :if_match_last_modified_time
|
319
331
|
# If present, the object is deleted only if its modification times
|
320
332
|
# matches the provided `Timestamp`. If the `Timestamp` values do not
|
@@ -566,15 +578,6 @@ module Aws::S3
|
|
566
578
|
# fails with the HTTP status code `403 Forbidden` (access denied).
|
567
579
|
# @option options [String] :checksum_mode
|
568
580
|
# To retrieve the checksum, this mode must be enabled.
|
569
|
-
#
|
570
|
-
# **General purpose buckets** - In addition, if you enable checksum mode
|
571
|
-
# and the object is uploaded with a [checksum][1] and encrypted with an
|
572
|
-
# Key Management Service (KMS) key, you must have permission to use the
|
573
|
-
# `kms:Decrypt` action to retrieve the checksum.
|
574
|
-
#
|
575
|
-
#
|
576
|
-
#
|
577
|
-
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html
|
578
581
|
# @return [Types::GetObjectOutput]
|
579
582
|
def get(options = {}, &block)
|
580
583
|
options = options.merge(
|
@@ -848,7 +851,7 @@ module Aws::S3
|
|
848
851
|
# request_payer: "requester", # accepts requester
|
849
852
|
# bypass_governance_retention: false,
|
850
853
|
# expected_bucket_owner: "AccountId",
|
851
|
-
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
|
854
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
|
852
855
|
# })
|
853
856
|
# @param options ({})
|
854
857
|
# @option options [String] :mfa
|
@@ -916,6 +919,8 @@ module Aws::S3
|
|
916
919
|
#
|
917
920
|
# * `CRC32C`
|
918
921
|
#
|
922
|
+
# * `CRC64NVME`
|
923
|
+
#
|
919
924
|
# * `SHA1`
|
920
925
|
#
|
921
926
|
# * `SHA256`
|
@@ -925,9 +930,8 @@ module Aws::S3
|
|
925
930
|
#
|
926
931
|
# If the individual checksum value you provide through
|
927
932
|
# `x-amz-checksum-algorithm ` doesn't match the checksum algorithm you
|
928
|
-
# set through `x-amz-sdk-checksum-algorithm`, Amazon S3
|
929
|
-
#
|
930
|
-
# that matches the provided value in `x-amz-checksum-algorithm `.
|
933
|
+
# set through `x-amz-sdk-checksum-algorithm`, Amazon S3 fails the
|
934
|
+
# request with a `BadDigest` error.
|
931
935
|
#
|
932
936
|
# If you provide an individual checksum, Amazon S3 ignores any provided
|
933
937
|
# `ChecksumAlgorithm` parameter.
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
module S3
|
5
|
+
module Plugins
|
6
|
+
# @api private
|
7
|
+
class ChecksumAlgorithm < Seahorse::Client::Plugin
|
8
|
+
|
9
|
+
# S3 GetObject results for whole Multipart Objects contain a checksum
|
10
|
+
# that cannot be validated. These should be skipped by the
|
11
|
+
# ChecksumAlgorithm plugin.
|
12
|
+
class SkipWholeMultipartGetChecksumsHandler < Seahorse::Client::Handler
|
13
|
+
def call(context)
|
14
|
+
context[:http_checksum] ||= {}
|
15
|
+
context[:http_checksum][:skip_on_suffix] = true
|
16
|
+
|
17
|
+
@handler.call(context)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def add_handlers(handlers, _config)
|
22
|
+
handlers.add(
|
23
|
+
SkipWholeMultipartGetChecksumsHandler,
|
24
|
+
step: :initialize,
|
25
|
+
operations: [:get_object]
|
26
|
+
)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -29,24 +29,17 @@ for different buckets.
|
|
29
29
|
# @api private
|
30
30
|
class Handler < Seahorse::Client::Handler
|
31
31
|
def call(context)
|
32
|
-
if (
|
33
|
-
# S3 Express endpoint - turn off md5 and enable crc32 default
|
34
|
-
if props['backend'] == 'S3Express'
|
35
|
-
if context.operation_name == :put_object || checksum_required?(context)
|
36
|
-
context[:default_request_checksum_algorithm] = 'CRC32'
|
37
|
-
end
|
38
|
-
context[:s3_express_endpoint] = true
|
39
|
-
end
|
32
|
+
context[:s3_express_endpoint] = true if s3_express_endpoint?(context)
|
40
33
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
end
|
34
|
+
# if s3 express auth, use new credentials and sign additional header
|
35
|
+
if context[:auth_scheme]['name'] == 'sigv4-s3express' &&
|
36
|
+
!context.config.disable_s3_express_session_auth
|
37
|
+
bucket = context.params[:bucket]
|
38
|
+
credentials_provider = context.config.express_credentials_provider
|
39
|
+
credentials = credentials_provider.express_credentials_for(bucket)
|
40
|
+
context[:sigv4_credentials] = credentials # Sign will use this
|
49
41
|
end
|
42
|
+
|
50
43
|
with_metric(credentials) { @handler.call(context) }
|
51
44
|
end
|
52
45
|
|
@@ -58,10 +51,8 @@ for different buckets.
|
|
58
51
|
Aws::Plugins::UserAgent.metric('S3_EXPRESS_BUCKET', &block)
|
59
52
|
end
|
60
53
|
|
61
|
-
def
|
62
|
-
context
|
63
|
-
(context.operation.http_checksum &&
|
64
|
-
context.operation.http_checksum['requestChecksumRequired'])
|
54
|
+
def s3_express_endpoint?(context)
|
55
|
+
context[:endpoint_properties]['backend'] == 'S3Express'
|
65
56
|
end
|
66
57
|
end
|
67
58
|
|
@@ -6,81 +6,20 @@ module Aws
|
|
6
6
|
module S3
|
7
7
|
module Plugins
|
8
8
|
# @api private
|
9
|
-
# This plugin is
|
9
|
+
# This plugin is deprecated in favor of modeled
|
10
10
|
# httpChecksumRequired traits.
|
11
11
|
class Md5s < Seahorse::Client::Plugin
|
12
|
-
# These operations allow Content MD5 but are not required by
|
13
|
-
# httpChecksumRequired. This list should not grow.
|
14
|
-
OPTIONAL_OPERATIONS = [
|
15
|
-
:put_object,
|
16
|
-
:upload_part
|
17
|
-
]
|
18
|
-
|
19
|
-
# @api private
|
20
|
-
class Handler < Seahorse::Client::Handler
|
21
|
-
|
22
|
-
CHUNK_SIZE = 1 * 1024 * 1024 # one MB
|
23
|
-
|
24
|
-
def call(context)
|
25
|
-
if !context[:checksum_algorithms] && # skip in favor of flexible checksum
|
26
|
-
!context[:s3_express_endpoint] # s3 express endpoints do not support md5
|
27
|
-
body = context.http_request.body
|
28
|
-
if body.respond_to?(:size) && body.size > 0
|
29
|
-
context.http_request.headers['Content-Md5'] ||= md5(body)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
@handler.call(context)
|
33
|
-
end
|
34
|
-
|
35
|
-
private
|
36
|
-
|
37
|
-
# @param [File, Tempfile, IO#read, String] value
|
38
|
-
# @return [String<MD5>]
|
39
|
-
def md5(value)
|
40
|
-
if (File === value || Tempfile === value) && !value.path.nil? && File.exist?(value.path)
|
41
|
-
OpenSSL::Digest::MD5.file(value).base64digest
|
42
|
-
elsif value.respond_to?(:read)
|
43
|
-
md5 = OpenSSL::Digest::MD5.new
|
44
|
-
update_in_chunks(md5, value)
|
45
|
-
md5.base64digest
|
46
|
-
else
|
47
|
-
OpenSSL::Digest::MD5.digest(value).base64digest
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
def update_in_chunks(digest, io)
|
52
|
-
loop do
|
53
|
-
chunk = io.read(CHUNK_SIZE)
|
54
|
-
break unless chunk
|
55
|
-
digest.update(chunk)
|
56
|
-
end
|
57
|
-
io.rewind
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
61
|
-
|
62
12
|
option(:compute_checksums,
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
def add_handlers(handlers, config)
|
74
|
-
if config.compute_checksums
|
75
|
-
# priority set low to ensure md5 is computed AFTER the request is
|
76
|
-
# built but before it is signed
|
77
|
-
handlers.add(
|
78
|
-
Handler,
|
79
|
-
priority: 10, step: :build, operations: OPTIONAL_OPERATIONS
|
80
|
-
)
|
81
|
-
end
|
13
|
+
default: true,
|
14
|
+
doc_type: 'Boolean',
|
15
|
+
docstring: <<~DOCS)
|
16
|
+
This option is deprecated. Please use `:request_checksum_calculation` instead.
|
17
|
+
When `false`, `request_checksum_calculation` is overridden to `when_required`.
|
18
|
+
DOCS
|
19
|
+
|
20
|
+
def after_initialize(client)
|
21
|
+
client.config.request_checksum_calculation = 'when_required' unless client.config.compute_checksums
|
82
22
|
end
|
83
|
-
|
84
23
|
end
|
85
24
|
end
|
86
25
|
end
|
data/lib/aws-sdk-s3/presigner.rb
CHANGED
@@ -193,15 +193,14 @@ module Aws
|
|
193
193
|
req, expires_in, secure, time, unsigned_headers, hoist = true
|
194
194
|
)
|
195
195
|
x_amz_headers = {}
|
196
|
-
|
197
196
|
http_req = req.context.http_request
|
198
|
-
|
199
|
-
req.handlers.remove(Aws::S3::Plugins::S3Signer::LegacyHandler)
|
200
|
-
req.handlers.remove(Aws::Plugins::Sign::Handler)
|
201
197
|
req.handlers.remove(Seahorse::Client::Plugins::ContentLength::Handler)
|
202
198
|
req.handlers.remove(Aws::Rest::ContentTypeHandler)
|
199
|
+
req.handlers.remove(Aws::Plugins::ChecksumAlgorithm::OptionHandler)
|
200
|
+
req.handlers.remove(Aws::Plugins::ChecksumAlgorithm::ChecksumHandler)
|
203
201
|
req.handlers.remove(Aws::Plugins::InvocationId::Handler)
|
204
|
-
|
202
|
+
req.handlers.remove(Aws::Plugins::Sign::Handler)
|
203
|
+
req.handlers.remove(Aws::S3::Plugins::S3Signer::LegacyHandler)
|
205
204
|
req.handle(step: :send) do |context|
|
206
205
|
# if an endpoint was not provided, force secure or insecure
|
207
206
|
if context.config.regional_endpoint
|