aws-sdk-s3 1.196.1 → 1.213.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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +116 -0
  3. data/VERSION +1 -1
  4. data/lib/aws-sdk-s3/bucket.rb +17 -17
  5. data/lib/aws-sdk-s3/bucket_acl.rb +1 -1
  6. data/lib/aws-sdk-s3/bucket_versioning.rb +33 -0
  7. data/lib/aws-sdk-s3/client.rb +1271 -453
  8. data/lib/aws-sdk-s3/client_api.rb +115 -0
  9. data/lib/aws-sdk-s3/customizations/object.rb +39 -24
  10. data/lib/aws-sdk-s3/customizations.rb +3 -1
  11. data/lib/aws-sdk-s3/default_executor.rb +103 -0
  12. data/lib/aws-sdk-s3/encryption/client.rb +2 -2
  13. data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +2 -0
  14. data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +2 -0
  15. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +2 -0
  16. data/lib/aws-sdk-s3/encryptionV2/client.rb +98 -23
  17. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +7 -162
  18. data/lib/aws-sdk-s3/encryptionV2/decryption.rb +205 -0
  19. data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +17 -0
  20. data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +2 -0
  21. data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +2 -0
  22. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +8 -0
  23. data/lib/aws-sdk-s3/encryptionV2/utils.rb +5 -0
  24. data/lib/aws-sdk-s3/encryptionV3/client.rb +885 -0
  25. data/lib/aws-sdk-s3/encryptionV3/decrypt_handler.rb +98 -0
  26. data/lib/aws-sdk-s3/encryptionV3/decryption.rb +244 -0
  27. data/lib/aws-sdk-s3/encryptionV3/default_cipher_provider.rb +159 -0
  28. data/lib/aws-sdk-s3/encryptionV3/default_key_provider.rb +35 -0
  29. data/lib/aws-sdk-s3/encryptionV3/encrypt_handler.rb +98 -0
  30. data/lib/aws-sdk-s3/encryptionV3/errors.rb +47 -0
  31. data/lib/aws-sdk-s3/encryptionV3/io_auth_decrypter.rb +60 -0
  32. data/lib/aws-sdk-s3/encryptionV3/io_decrypter.rb +35 -0
  33. data/lib/aws-sdk-s3/encryptionV3/io_encrypter.rb +84 -0
  34. data/lib/aws-sdk-s3/encryptionV3/key_provider.rb +28 -0
  35. data/lib/aws-sdk-s3/encryptionV3/kms_cipher_provider.rb +159 -0
  36. data/lib/aws-sdk-s3/encryptionV3/materials.rb +58 -0
  37. data/lib/aws-sdk-s3/encryptionV3/utils.rb +321 -0
  38. data/lib/aws-sdk-s3/encryption_v2.rb +1 -0
  39. data/lib/aws-sdk-s3/encryption_v3.rb +24 -0
  40. data/lib/aws-sdk-s3/endpoint_parameters.rb +17 -17
  41. data/lib/aws-sdk-s3/endpoint_provider.rb +241 -68
  42. data/lib/aws-sdk-s3/endpoints.rb +39 -0
  43. data/lib/aws-sdk-s3/errors.rb +11 -0
  44. data/lib/aws-sdk-s3/file_downloader.rb +192 -104
  45. data/lib/aws-sdk-s3/file_uploader.rb +17 -13
  46. data/lib/aws-sdk-s3/multipart_file_uploader.rb +82 -69
  47. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +96 -107
  48. data/lib/aws-sdk-s3/multipart_upload.rb +12 -12
  49. data/lib/aws-sdk-s3/multipart_upload_part.rb +8 -8
  50. data/lib/aws-sdk-s3/object.rb +88 -59
  51. data/lib/aws-sdk-s3/object_acl.rb +5 -5
  52. data/lib/aws-sdk-s3/object_summary.rb +70 -41
  53. data/lib/aws-sdk-s3/object_version.rb +23 -25
  54. data/lib/aws-sdk-s3/plugins/checksum_algorithm.rb +18 -5
  55. data/lib/aws-sdk-s3/plugins/endpoints.rb +1 -1
  56. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +58 -34
  57. data/lib/aws-sdk-s3/transfer_manager.rb +321 -0
  58. data/lib/aws-sdk-s3/types.rb +687 -330
  59. data/lib/aws-sdk-s3.rb +1 -1
  60. data/sig/bucket.rbs +1 -1
  61. data/sig/client.rbs +62 -12
  62. data/sig/errors.rbs +2 -0
  63. data/sig/multipart_upload.rbs +1 -1
  64. data/sig/object.rbs +7 -5
  65. data/sig/object_summary.rbs +7 -5
  66. data/sig/types.rbs +84 -14
  67. metadata +21 -3
@@ -14,6 +14,7 @@ module Aws::S3
14
14
 
15
15
  include Seahorse::Model
16
16
 
17
+ AbacStatus = Shapes::StructureShape.new(name: 'AbacStatus')
17
18
  AbortDate = Shapes::TimestampShape.new(name: 'AbortDate')
18
19
  AbortIncompleteMultipartUpload = Shapes::StructureShape.new(name: 'AbortIncompleteMultipartUpload')
19
20
  AbortMultipartUploadOutput = Shapes::StructureShape.new(name: 'AbortMultipartUploadOutput')
@@ -23,6 +24,7 @@ module Aws::S3
23
24
  AcceptRanges = Shapes::StringShape.new(name: 'AcceptRanges')
24
25
  AccessControlPolicy = Shapes::StructureShape.new(name: 'AccessControlPolicy')
25
26
  AccessControlTranslation = Shapes::StructureShape.new(name: 'AccessControlTranslation')
27
+ AccessDenied = Shapes::StructureShape.new(name: 'AccessDenied')
26
28
  AccessKeyIdValue = Shapes::StringShape.new(name: 'AccessKeyIdValue')
27
29
  AccessPointAlias = Shapes::BooleanShape.new(name: 'AccessPointAlias')
28
30
  AccessPointArn = Shapes::StringShape.new(name: 'AccessPointArn')
@@ -43,8 +45,10 @@ module Aws::S3
43
45
  AnalyticsS3BucketDestination = Shapes::StructureShape.new(name: 'AnalyticsS3BucketDestination')
44
46
  AnalyticsS3ExportFileFormat = Shapes::StringShape.new(name: 'AnalyticsS3ExportFileFormat')
45
47
  ArchiveStatus = Shapes::StringShape.new(name: 'ArchiveStatus')
48
+ BlockedEncryptionTypes = Shapes::StructureShape.new(name: 'BlockedEncryptionTypes')
46
49
  Body = Shapes::BlobShape.new(name: 'Body')
47
50
  Bucket = Shapes::StructureShape.new(name: 'Bucket')
51
+ BucketAbacStatus = Shapes::StringShape.new(name: 'BucketAbacStatus')
48
52
  BucketAccelerateStatus = Shapes::StringShape.new(name: 'BucketAccelerateStatus')
49
53
  BucketAlreadyExists = Shapes::StructureShape.new(name: 'BucketAlreadyExists')
50
54
  BucketAlreadyOwnedByYou = Shapes::StructureShape.new(name: 'BucketAlreadyOwnedByYou')
@@ -177,6 +181,8 @@ module Aws::S3
177
181
  EncodingType = Shapes::StringShape.new(name: 'EncodingType')
178
182
  Encryption = Shapes::StructureShape.new(name: 'Encryption')
179
183
  EncryptionConfiguration = Shapes::StructureShape.new(name: 'EncryptionConfiguration')
184
+ EncryptionType = Shapes::StringShape.new(name: 'EncryptionType')
185
+ EncryptionTypeList = Shapes::ListShape.new(name: 'EncryptionTypeList', flattened: true)
180
186
  EncryptionTypeMismatch = Shapes::StructureShape.new(name: 'EncryptionTypeMismatch')
181
187
  End = Shapes::IntegerShape.new(name: 'End')
182
188
  EndEvent = Shapes::StructureShape.new(name: 'EndEvent')
@@ -208,6 +214,8 @@ module Aws::S3
208
214
  FilterRuleList = Shapes::ListShape.new(name: 'FilterRuleList', flattened: true)
209
215
  FilterRuleName = Shapes::StringShape.new(name: 'FilterRuleName')
210
216
  FilterRuleValue = Shapes::StringShape.new(name: 'FilterRuleValue')
217
+ GetBucketAbacOutput = Shapes::StructureShape.new(name: 'GetBucketAbacOutput')
218
+ GetBucketAbacRequest = Shapes::StructureShape.new(name: 'GetBucketAbacRequest')
211
219
  GetBucketAccelerateConfigurationOutput = Shapes::StructureShape.new(name: 'GetBucketAccelerateConfigurationOutput')
212
220
  GetBucketAccelerateConfigurationRequest = Shapes::StructureShape.new(name: 'GetBucketAccelerateConfigurationRequest')
213
221
  GetBucketAclOutput = Shapes::StructureShape.new(name: 'GetBucketAclOutput')
@@ -431,6 +439,7 @@ module Aws::S3
431
439
  NoSuchBucket = Shapes::StructureShape.new(name: 'NoSuchBucket')
432
440
  NoSuchKey = Shapes::StructureShape.new(name: 'NoSuchKey')
433
441
  NoSuchUpload = Shapes::StructureShape.new(name: 'NoSuchUpload')
442
+ NonEmptyKmsKeyArnString = Shapes::StringShape.new(name: 'NonEmptyKmsKeyArnString')
434
443
  NoncurrentVersionExpiration = Shapes::StructureShape.new(name: 'NoncurrentVersionExpiration')
435
444
  NoncurrentVersionTransition = Shapes::StructureShape.new(name: 'NoncurrentVersionTransition')
436
445
  NoncurrentVersionTransitionList = Shapes::ListShape.new(name: 'NoncurrentVersionTransitionList', flattened: true)
@@ -443,6 +452,7 @@ module Aws::S3
443
452
  ObjectAttributes = Shapes::StringShape.new(name: 'ObjectAttributes')
444
453
  ObjectAttributesList = Shapes::ListShape.new(name: 'ObjectAttributesList')
445
454
  ObjectCannedACL = Shapes::StringShape.new(name: 'ObjectCannedACL')
455
+ ObjectEncryption = Shapes::UnionShape.new(name: 'ObjectEncryption')
446
456
  ObjectIdentifier = Shapes::StructureShape.new(name: 'ObjectIdentifier')
447
457
  ObjectIdentifierList = Shapes::ListShape.new(name: 'ObjectIdentifierList', flattened: true)
448
458
  ObjectKey = Shapes::StringShape.new(name: 'ObjectKey')
@@ -497,6 +507,7 @@ module Aws::S3
497
507
  ProgressEvent = Shapes::StructureShape.new(name: 'ProgressEvent')
498
508
  Protocol = Shapes::StringShape.new(name: 'Protocol')
499
509
  PublicAccessBlockConfiguration = Shapes::StructureShape.new(name: 'PublicAccessBlockConfiguration')
510
+ PutBucketAbacRequest = Shapes::StructureShape.new(name: 'PutBucketAbacRequest')
500
511
  PutBucketAccelerateConfigurationRequest = Shapes::StructureShape.new(name: 'PutBucketAccelerateConfigurationRequest')
501
512
  PutBucketAclRequest = Shapes::StructureShape.new(name: 'PutBucketAclRequest')
502
513
  PutBucketAnalyticsConfigurationRequest = Shapes::StructureShape.new(name: 'PutBucketAnalyticsConfigurationRequest')
@@ -608,6 +619,7 @@ module Aws::S3
608
619
  SSECustomerKey = Shapes::StringShape.new(name: 'SSECustomerKey')
609
620
  SSECustomerKeyMD5 = Shapes::StringShape.new(name: 'SSECustomerKeyMD5')
610
621
  SSEKMS = Shapes::StructureShape.new(name: 'SSEKMS', locationName: "SSE-KMS")
622
+ SSEKMSEncryption = Shapes::StructureShape.new(name: 'SSEKMSEncryption', locationName: "SSE-KMS")
611
623
  SSEKMSEncryptionContext = Shapes::StringShape.new(name: 'SSEKMSEncryptionContext')
612
624
  SSEKMSKeyId = Shapes::StringShape.new(name: 'SSEKMSKeyId')
613
625
  SSES3 = Shapes::StructureShape.new(name: 'SSES3', locationName: "SSE-S3")
@@ -670,6 +682,8 @@ module Aws::S3
670
682
  URI = Shapes::StringShape.new(name: 'URI')
671
683
  UpdateBucketMetadataInventoryTableConfigurationRequest = Shapes::StructureShape.new(name: 'UpdateBucketMetadataInventoryTableConfigurationRequest')
672
684
  UpdateBucketMetadataJournalTableConfigurationRequest = Shapes::StructureShape.new(name: 'UpdateBucketMetadataJournalTableConfigurationRequest')
685
+ UpdateObjectEncryptionRequest = Shapes::StructureShape.new(name: 'UpdateObjectEncryptionRequest')
686
+ UpdateObjectEncryptionResponse = Shapes::StructureShape.new(name: 'UpdateObjectEncryptionResponse')
673
687
  UploadIdMarker = Shapes::StringShape.new(name: 'UploadIdMarker')
674
688
  UploadPartCopyOutput = Shapes::StructureShape.new(name: 'UploadPartCopyOutput')
675
689
  UploadPartCopyRequest = Shapes::StructureShape.new(name: 'UploadPartCopyRequest')
@@ -686,6 +700,9 @@ module Aws::S3
686
700
  WriteOffsetBytes = Shapes::IntegerShape.new(name: 'WriteOffsetBytes')
687
701
  Years = Shapes::IntegerShape.new(name: 'Years')
688
702
 
703
+ AbacStatus.add_member(:status, Shapes::ShapeRef.new(shape: BucketAbacStatus, location_name: "Status"))
704
+ AbacStatus.struct_class = Types::AbacStatus
705
+
689
706
  AbortIncompleteMultipartUpload.add_member(:days_after_initiation, Shapes::ShapeRef.new(shape: DaysAfterInitiation, location_name: "DaysAfterInitiation"))
690
707
  AbortIncompleteMultipartUpload.struct_class = Types::AbortIncompleteMultipartUpload
691
708
 
@@ -710,6 +727,8 @@ module Aws::S3
710
727
  AccessControlTranslation.add_member(:owner, Shapes::ShapeRef.new(shape: OwnerOverride, required: true, location_name: "Owner"))
711
728
  AccessControlTranslation.struct_class = Types::AccessControlTranslation
712
729
 
730
+ AccessDenied.struct_class = Types::AccessDenied
731
+
713
732
  AllowedHeaders.member = Shapes::ShapeRef.new(shape: AllowedHeader)
714
733
 
715
734
  AllowedMethods.member = Shapes::ShapeRef.new(shape: AllowedMethod)
@@ -741,6 +760,9 @@ module Aws::S3
741
760
  AnalyticsS3BucketDestination.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix"))
742
761
  AnalyticsS3BucketDestination.struct_class = Types::AnalyticsS3BucketDestination
743
762
 
763
+ BlockedEncryptionTypes.add_member(:encryption_type, Shapes::ShapeRef.new(shape: EncryptionTypeList, location_name: "EncryptionType"))
764
+ BlockedEncryptionTypes.struct_class = Types::BlockedEncryptionTypes
765
+
744
766
  Bucket.add_member(:name, Shapes::ShapeRef.new(shape: BucketName, location_name: "Name"))
745
767
  Bucket.add_member(:creation_date, Shapes::ShapeRef.new(shape: CreationDate, location_name: "CreationDate"))
746
768
  Bucket.add_member(:bucket_region, Shapes::ShapeRef.new(shape: BucketRegion, location_name: "BucketRegion"))
@@ -907,6 +929,8 @@ module Aws::S3
907
929
  CopyObjectRequest.add_member(:grant_read, Shapes::ShapeRef.new(shape: GrantRead, location: "header", location_name: "x-amz-grant-read"))
908
930
  CopyObjectRequest.add_member(:grant_read_acp, Shapes::ShapeRef.new(shape: GrantReadACP, location: "header", location_name: "x-amz-grant-read-acp"))
909
931
  CopyObjectRequest.add_member(:grant_write_acp, Shapes::ShapeRef.new(shape: GrantWriteACP, location: "header", location_name: "x-amz-grant-write-acp"))
932
+ CopyObjectRequest.add_member(:if_match, Shapes::ShapeRef.new(shape: IfMatch, location: "header", location_name: "If-Match"))
933
+ CopyObjectRequest.add_member(:if_none_match, Shapes::ShapeRef.new(shape: IfNoneMatch, location: "header", location_name: "If-None-Match"))
910
934
  CopyObjectRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key", metadata: {"contextParam" => {"name" => "Key"}}))
911
935
  CopyObjectRequest.add_member(:metadata, Shapes::ShapeRef.new(shape: Metadata, location: "headers", location_name: "x-amz-meta-"))
912
936
  CopyObjectRequest.add_member(:metadata_directive, Shapes::ShapeRef.new(shape: MetadataDirective, location: "header", location_name: "x-amz-metadata-directive"))
@@ -1218,6 +1242,8 @@ module Aws::S3
1218
1242
  EncryptionConfiguration.add_member(:replica_kms_key_id, Shapes::ShapeRef.new(shape: ReplicaKmsKeyID, location_name: "ReplicaKmsKeyID"))
1219
1243
  EncryptionConfiguration.struct_class = Types::EncryptionConfiguration
1220
1244
 
1245
+ EncryptionTypeList.member = Shapes::ShapeRef.new(shape: EncryptionType, location_name: "EncryptionType")
1246
+
1221
1247
  EncryptionTypeMismatch.struct_class = Types::EncryptionTypeMismatch
1222
1248
 
1223
1249
  EndEvent.struct_class = Types::EndEvent
@@ -1252,6 +1278,15 @@ module Aws::S3
1252
1278
 
1253
1279
  FilterRuleList.member = Shapes::ShapeRef.new(shape: FilterRule)
1254
1280
 
1281
+ GetBucketAbacOutput.add_member(:abac_status, Shapes::ShapeRef.new(shape: AbacStatus, location_name: "AbacStatus"))
1282
+ GetBucketAbacOutput.struct_class = Types::GetBucketAbacOutput
1283
+ GetBucketAbacOutput[:payload] = :abac_status
1284
+ GetBucketAbacOutput[:payload_member] = GetBucketAbacOutput.member(:abac_status)
1285
+
1286
+ GetBucketAbacRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket", metadata: {"contextParam" => {"name" => "Bucket"}}))
1287
+ GetBucketAbacRequest.add_member(:expected_bucket_owner, Shapes::ShapeRef.new(shape: AccountId, location: "header", location_name: "x-amz-expected-bucket-owner"))
1288
+ GetBucketAbacRequest.struct_class = Types::GetBucketAbacRequest
1289
+
1255
1290
  GetBucketAccelerateConfigurationOutput.add_member(:status, Shapes::ShapeRef.new(shape: BucketAccelerateStatus, location_name: "Status"))
1256
1291
  GetBucketAccelerateConfigurationOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged"))
1257
1292
  GetBucketAccelerateConfigurationOutput.struct_class = Types::GetBucketAccelerateConfigurationOutput
@@ -2183,6 +2218,12 @@ module Aws::S3
2183
2218
 
2184
2219
  ObjectAttributesList.member = Shapes::ShapeRef.new(shape: ObjectAttributes)
2185
2220
 
2221
+ ObjectEncryption.add_member(:ssekms, Shapes::ShapeRef.new(shape: SSEKMSEncryption, location_name: "SSE-KMS"))
2222
+ ObjectEncryption.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
2223
+ ObjectEncryption.add_member_subclass(:ssekms, Types::ObjectEncryption::Ssekms)
2224
+ ObjectEncryption.add_member_subclass(:unknown, Types::ObjectEncryption::Unknown)
2225
+ ObjectEncryption.struct_class = Types::ObjectEncryption
2226
+
2186
2227
  ObjectIdentifier.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location_name: "Key"))
2187
2228
  ObjectIdentifier.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location_name: "VersionId"))
2188
2229
  ObjectIdentifier.add_member(:etag, Shapes::ShapeRef.new(shape: ETag, location_name: "ETag"))
@@ -2292,6 +2333,15 @@ module Aws::S3
2292
2333
  PublicAccessBlockConfiguration.add_member(:restrict_public_buckets, Shapes::ShapeRef.new(shape: Setting, location_name: "RestrictPublicBuckets"))
2293
2334
  PublicAccessBlockConfiguration.struct_class = Types::PublicAccessBlockConfiguration
2294
2335
 
2336
+ PutBucketAbacRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket", metadata: {"contextParam" => {"name" => "Bucket"}}))
2337
+ PutBucketAbacRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5"))
2338
+ PutBucketAbacRequest.add_member(:checksum_algorithm, Shapes::ShapeRef.new(shape: ChecksumAlgorithm, location: "header", location_name: "x-amz-sdk-checksum-algorithm"))
2339
+ PutBucketAbacRequest.add_member(:expected_bucket_owner, Shapes::ShapeRef.new(shape: AccountId, location: "header", location_name: "x-amz-expected-bucket-owner"))
2340
+ PutBucketAbacRequest.add_member(:abac_status, Shapes::ShapeRef.new(shape: AbacStatus, required: true, location_name: "AbacStatus", metadata: {"xmlNamespace" => {"uri" => "http://s3.amazonaws.com/doc/2006-03-01/"}}))
2341
+ PutBucketAbacRequest.struct_class = Types::PutBucketAbacRequest
2342
+ PutBucketAbacRequest[:payload] = :abac_status
2343
+ PutBucketAbacRequest[:payload_member] = PutBucketAbacRequest.member(:abac_status)
2344
+
2295
2345
  PutBucketAccelerateConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket", metadata: {"contextParam" => {"name" => "Bucket"}}))
2296
2346
  PutBucketAccelerateConfigurationRequest.add_member(:accelerate_configuration, Shapes::ShapeRef.new(shape: AccelerateConfiguration, required: true, location_name: "AccelerateConfiguration", metadata: {"xmlNamespace" => {"uri" => "http://s3.amazonaws.com/doc/2006-03-01/"}}))
2297
2347
  PutBucketAccelerateConfigurationRequest.add_member(:expected_bucket_owner, Shapes::ShapeRef.new(shape: AccountId, location: "header", location_name: "x-amz-expected-bucket-owner"))
@@ -2794,6 +2844,10 @@ module Aws::S3
2794
2844
  SSEKMS.add_member(:key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, required: true, location_name: "KeyId"))
2795
2845
  SSEKMS.struct_class = Types::SSEKMS
2796
2846
 
2847
+ SSEKMSEncryption.add_member(:kms_key_arn, Shapes::ShapeRef.new(shape: NonEmptyKmsKeyArnString, required: true, location_name: "KMSKeyArn"))
2848
+ SSEKMSEncryption.add_member(:bucket_key_enabled, Shapes::ShapeRef.new(shape: BucketKeyEnabled, location_name: "BucketKeyEnabled"))
2849
+ SSEKMSEncryption.struct_class = Types::SSEKMSEncryption
2850
+
2797
2851
  SSES3.struct_class = Types::SSES3
2798
2852
 
2799
2853
  ScanRange.add_member(:start, Shapes::ShapeRef.new(shape: Start, location_name: "Start"))
@@ -2841,6 +2895,7 @@ module Aws::S3
2841
2895
 
2842
2896
  ServerSideEncryptionRule.add_member(:apply_server_side_encryption_by_default, Shapes::ShapeRef.new(shape: ServerSideEncryptionByDefault, location_name: "ApplyServerSideEncryptionByDefault"))
2843
2897
  ServerSideEncryptionRule.add_member(:bucket_key_enabled, Shapes::ShapeRef.new(shape: BucketKeyEnabled, location_name: "BucketKeyEnabled"))
2898
+ ServerSideEncryptionRule.add_member(:blocked_encryption_types, Shapes::ShapeRef.new(shape: BlockedEncryptionTypes, location_name: "BlockedEncryptionTypes"))
2844
2899
  ServerSideEncryptionRule.struct_class = Types::ServerSideEncryptionRule
2845
2900
 
2846
2901
  ServerSideEncryptionRules.member = Shapes::ShapeRef.new(shape: ServerSideEncryptionRule)
@@ -2941,6 +2996,21 @@ module Aws::S3
2941
2996
  UpdateBucketMetadataJournalTableConfigurationRequest[:payload] = :journal_table_configuration
2942
2997
  UpdateBucketMetadataJournalTableConfigurationRequest[:payload_member] = UpdateBucketMetadataJournalTableConfigurationRequest.member(:journal_table_configuration)
2943
2998
 
2999
+ UpdateObjectEncryptionRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket", metadata: {"contextParam" => {"name" => "Bucket"}}))
3000
+ UpdateObjectEncryptionRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key"))
3001
+ UpdateObjectEncryptionRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "querystring", location_name: "versionId"))
3002
+ UpdateObjectEncryptionRequest.add_member(:object_encryption, Shapes::ShapeRef.new(shape: ObjectEncryption, required: true, location_name: "ObjectEncryption", metadata: {"xmlNamespace" => {"uri" => "http://s3.amazonaws.com/doc/2006-03-01/"}}))
3003
+ UpdateObjectEncryptionRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer"))
3004
+ UpdateObjectEncryptionRequest.add_member(:expected_bucket_owner, Shapes::ShapeRef.new(shape: AccountId, location: "header", location_name: "x-amz-expected-bucket-owner"))
3005
+ UpdateObjectEncryptionRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5"))
3006
+ UpdateObjectEncryptionRequest.add_member(:checksum_algorithm, Shapes::ShapeRef.new(shape: ChecksumAlgorithm, location: "header", location_name: "x-amz-sdk-checksum-algorithm"))
3007
+ UpdateObjectEncryptionRequest.struct_class = Types::UpdateObjectEncryptionRequest
3008
+ UpdateObjectEncryptionRequest[:payload] = :object_encryption
3009
+ UpdateObjectEncryptionRequest[:payload_member] = UpdateObjectEncryptionRequest.member(:object_encryption)
3010
+
3011
+ UpdateObjectEncryptionResponse.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged"))
3012
+ UpdateObjectEncryptionResponse.struct_class = Types::UpdateObjectEncryptionResponse
3013
+
2944
3014
  UploadPartCopyOutput.add_member(:copy_source_version_id, Shapes::ShapeRef.new(shape: CopySourceVersionId, location: "header", location_name: "x-amz-copy-source-version-id"))
2945
3015
  UploadPartCopyOutput.add_member(:copy_part_result, Shapes::ShapeRef.new(shape: CopyPartResult, location_name: "CopyPartResult"))
2946
3016
  UploadPartCopyOutput.add_member(:server_side_encryption, Shapes::ShapeRef.new(shape: ServerSideEncryption, location: "header", location_name: "x-amz-server-side-encryption"))
@@ -3332,6 +3402,14 @@ module Aws::S3
3332
3402
  o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
3333
3403
  end)
3334
3404
 
3405
+ api.add_operation(:get_bucket_abac, Seahorse::Model::Operation.new.tap do |o|
3406
+ o.name = "GetBucketAbac"
3407
+ o.http_method = "GET"
3408
+ o.http_request_uri = "/?abac"
3409
+ o.input = Shapes::ShapeRef.new(shape: GetBucketAbacRequest)
3410
+ o.output = Shapes::ShapeRef.new(shape: GetBucketAbacOutput)
3411
+ end)
3412
+
3335
3413
  api.add_operation(:get_bucket_accelerate_configuration, Seahorse::Model::Operation.new.tap do |o|
3336
3414
  o.name = "GetBucketAccelerateConfiguration"
3337
3415
  o.http_method = "GET"
@@ -3766,6 +3844,22 @@ module Aws::S3
3766
3844
  )
3767
3845
  end)
3768
3846
 
3847
+ api.add_operation(:put_bucket_abac, Seahorse::Model::Operation.new.tap do |o|
3848
+ o.name = "PutBucketAbac"
3849
+ o.http_method = "PUT"
3850
+ o.http_request_uri = "/?abac"
3851
+ o.http_checksum = {
3852
+ "requestAlgorithmMember" => "checksum_algorithm",
3853
+ "requestChecksumRequired" => false,
3854
+ }
3855
+ o.http_checksum = {
3856
+ "requestAlgorithmMember" => "checksum_algorithm",
3857
+ "requestChecksumRequired" => false,
3858
+ }
3859
+ o.input = Shapes::ShapeRef.new(shape: PutBucketAbacRequest)
3860
+ o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
3861
+ end)
3862
+
3769
3863
  api.add_operation(:put_bucket_accelerate_configuration, Seahorse::Model::Operation.new.tap do |o|
3770
3864
  o.name = "PutBucketAccelerateConfiguration"
3771
3865
  o.http_method = "PUT"
@@ -4060,6 +4154,7 @@ module Aws::S3
4060
4154
  "requestAlgorithmMember" => "checksum_algorithm",
4061
4155
  "requestChecksumRequired" => false,
4062
4156
  }
4157
+ o['unsignedPayload'] = true
4063
4158
  o.input = Shapes::ShapeRef.new(shape: PutObjectRequest)
4064
4159
  o.output = Shapes::ShapeRef.new(shape: PutObjectOutput)
4065
4160
  o.errors << Shapes::ShapeRef.new(shape: InvalidRequest)
@@ -4236,6 +4331,25 @@ module Aws::S3
4236
4331
  o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
4237
4332
  end)
4238
4333
 
4334
+ api.add_operation(:update_object_encryption, Seahorse::Model::Operation.new.tap do |o|
4335
+ o.name = "UpdateObjectEncryption"
4336
+ o.http_method = "PUT"
4337
+ o.http_request_uri = "/{Key+}?encryption"
4338
+ o.http_checksum = {
4339
+ "requestAlgorithmMember" => "checksum_algorithm",
4340
+ "requestChecksumRequired" => true,
4341
+ }
4342
+ o.http_checksum = {
4343
+ "requestAlgorithmMember" => "checksum_algorithm",
4344
+ "requestChecksumRequired" => true,
4345
+ }
4346
+ o.input = Shapes::ShapeRef.new(shape: UpdateObjectEncryptionRequest)
4347
+ o.output = Shapes::ShapeRef.new(shape: UpdateObjectEncryptionResponse)
4348
+ o.errors << Shapes::ShapeRef.new(shape: NoSuchKey)
4349
+ o.errors << Shapes::ShapeRef.new(shape: InvalidRequest)
4350
+ o.errors << Shapes::ShapeRef.new(shape: AccessDenied)
4351
+ end)
4352
+
4239
4353
  api.add_operation(:upload_part, Seahorse::Model::Operation.new.tap do |o|
4240
4354
  o.name = "UploadPart"
4241
4355
  o.http_method = "PUT"
@@ -4248,6 +4362,7 @@ module Aws::S3
4248
4362
  "requestAlgorithmMember" => "checksum_algorithm",
4249
4363
  "requestChecksumRequired" => false,
4250
4364
  }
4365
+ o['unsignedPayload'] = true
4251
4366
  o.input = Shapes::ShapeRef.new(shape: UploadPartRequest)
4252
4367
  o.output = Shapes::ShapeRef.new(shape: UploadPartOutput)
4253
4368
  end)
@@ -358,8 +358,8 @@ module Aws
358
358
  # {Client#complete_multipart_upload},
359
359
  # and {Client#upload_part} can be provided.
360
360
  #
361
- # @option options [Integer] :thread_count (10) The number of parallel
362
- # multipart uploads
361
+ # @option options [Integer] :thread_count (10) The number of parallel multipart uploads.
362
+ # An additional thread is used internally for task coordination.
363
363
  #
364
364
  # @option options [Boolean] :tempfile (false) Normally read data is stored
365
365
  # in memory when building the parts in order to complete the underlying
@@ -383,21 +383,21 @@ module Aws
383
383
  # @see Client#complete_multipart_upload
384
384
  # @see Client#upload_part
385
385
  def upload_stream(options = {}, &block)
386
- uploading_options = options.dup
386
+ upload_opts = options.merge(bucket: bucket_name, key: key)
387
+ executor = DefaultExecutor.new(max_threads: upload_opts.delete(:thread_count))
387
388
  uploader = MultipartStreamUploader.new(
388
389
  client: client,
389
- thread_count: uploading_options.delete(:thread_count),
390
- tempfile: uploading_options.delete(:tempfile),
391
- part_size: uploading_options.delete(:part_size)
390
+ executor: executor,
391
+ tempfile: upload_opts.delete(:tempfile),
392
+ part_size: upload_opts.delete(:part_size)
392
393
  )
393
394
  Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
394
- uploader.upload(
395
- uploading_options.merge(bucket: bucket_name, key: key),
396
- &block
397
- )
395
+ uploader.upload(upload_opts, &block)
398
396
  end
397
+ executor.shutdown
399
398
  true
400
399
  end
400
+ deprecated(:upload_stream, use: 'Aws::S3::TransferManager#upload_stream', version: 'next major version')
401
401
 
402
402
  # Uploads a file from disk to the current object in S3.
403
403
  #
@@ -457,14 +457,21 @@ module Aws
457
457
  # @see Client#complete_multipart_upload
458
458
  # @see Client#upload_part
459
459
  def upload_file(source, options = {})
460
- uploading_options = options.dup
461
- uploader = FileUploader.new(multipart_threshold: uploading_options.delete(:multipart_threshold), client: client)
460
+ upload_opts = options.merge(bucket: bucket_name, key: key)
461
+ executor = DefaultExecutor.new(max_threads: upload_opts.delete(:thread_count))
462
+ uploader = FileUploader.new(
463
+ client: client,
464
+ executor: executor,
465
+ multipart_threshold: upload_opts.delete(:multipart_threshold)
466
+ )
462
467
  response = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
463
- uploader.upload(source, uploading_options.merge(bucket: bucket_name, key: key))
468
+ uploader.upload(source, upload_opts)
464
469
  end
465
470
  yield response if block_given?
471
+ executor.shutdown
466
472
  true
467
473
  end
474
+ deprecated(:upload_file, use: 'Aws::S3::TransferManager#upload_file', version: 'next major version')
468
475
 
469
476
  # Downloads a file in S3 to a path on disk.
470
477
  #
@@ -486,7 +493,16 @@ module Aws
486
493
  # end
487
494
  # obj.download_file('/path/to/file', progress_callback: progress)
488
495
  #
489
- # @param [String] destination Where to download the file to.
496
+ # @param [String, Pathname, File, Tempfile] destination
497
+ # Where to download the file to. This can either be a String or Pathname to the file, an open File object,
498
+ # or an open Tempfile object. If you pass an open File or Tempfile object, then you are responsible for
499
+ # closing it after the download completes. Download behavior varies by destination type:
500
+ #
501
+ # * **String/Pathname paths**: Downloads to a temporary file first, then atomically moves to the final
502
+ # destination. This prevents corruption of any existing file if the download fails.
503
+ # * **File/Tempfile objects**: Downloads directly to the file object without using temporary files.
504
+ # You are responsible for managing the file object's state and closing it after the download completes.
505
+ # If the download fails, the file object may contain partial data.
490
506
  #
491
507
  # @param [Hash] options
492
508
  # Additional options for {Client#get_object} and #{Client#head_object} may be provided.
@@ -501,15 +517,10 @@ module Aws
501
517
  #
502
518
  # @option options [Integer] :thread_count (10) Customize threads used in the multipart download.
503
519
  #
504
- # @option options [String] :version_id The object version id used to retrieve the object.
505
- #
506
- # @see https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectVersioning.html ObjectVersioning
507
- #
508
520
  # @option options [String] :checksum_mode ("ENABLED")
509
- # When `"ENABLED"` and the object has a stored checksum, it will be used to validate the download and will
510
- # raise an `Aws::Errors::ChecksumError` if checksum validation fails. You may provide a `on_checksum_validated`
511
- # callback if you need to verify that validation occurred and which algorithm was used.
512
- # To disable checksum validation, set `checksum_mode` to `"DISABLED"`.
521
+ # This option is deprecated. Use `:response_checksum_validation` on your S3 client instead.
522
+ # To disable checksum validation, set `response_checksum_validation: 'when_required'`
523
+ # when creating your S3 client.
513
524
  #
514
525
  # @option options [Callable] :on_checksum_validated
515
526
  # Called each time a request's checksum is validated with the checksum algorithm and the
@@ -528,12 +539,16 @@ module Aws
528
539
  # @see Client#get_object
529
540
  # @see Client#head_object
530
541
  def download_file(destination, options = {})
531
- downloader = FileDownloader.new(client: client)
542
+ download_opts = options.merge(bucket: bucket_name, key: key)
543
+ executor = DefaultExecutor.new(max_threads: download_opts.delete([:thread_count]))
544
+ downloader = FileDownloader.new(client: client, executor: executor)
532
545
  Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
533
- downloader.download(destination, options.merge(bucket: bucket_name, key: key))
546
+ downloader.download(destination, download_opts)
534
547
  end
548
+ executor.shutdown
535
549
  true
536
550
  end
551
+ deprecated(:download_file, use: 'Aws::S3::TransferManager#download_file', version: 'next major version')
537
552
 
538
553
  class Collection < Aws::Resources::Collection
539
554
  alias_method :delete, :batch_delete!
@@ -6,7 +6,9 @@ module Aws
6
6
  autoload :BucketRegionCache, 'aws-sdk-s3/bucket_region_cache'
7
7
  autoload :Encryption, 'aws-sdk-s3/encryption'
8
8
  autoload :EncryptionV2, 'aws-sdk-s3/encryption_v2'
9
+ autoload :EncryptionV3, 'aws-sdk-s3/encryption_v3'
9
10
  autoload :FilePart, 'aws-sdk-s3/file_part'
11
+ autoload :DefaultExecutor, 'aws-sdk-s3/default_executor'
10
12
  autoload :FileUploader, 'aws-sdk-s3/file_uploader'
11
13
  autoload :FileDownloader, 'aws-sdk-s3/file_downloader'
12
14
  autoload :LegacySigner, 'aws-sdk-s3/legacy_signer'
@@ -18,13 +20,13 @@ module Aws
18
20
  autoload :ObjectMultipartCopier, 'aws-sdk-s3/object_multipart_copier'
19
21
  autoload :PresignedPost, 'aws-sdk-s3/presigned_post'
20
22
  autoload :Presigner, 'aws-sdk-s3/presigner'
23
+ autoload :TransferManager, 'aws-sdk-s3/transfer_manager'
21
24
 
22
25
  # s3 express session auth
23
26
  autoload :ExpressCredentials, 'aws-sdk-s3/express_credentials'
24
27
  autoload :ExpressCredentialsProvider, 'aws-sdk-s3/express_credentials_provider'
25
28
 
26
29
  # s3 access grants auth
27
-
28
30
  autoload :AccessGrantsCredentials, 'aws-sdk-s3/access_grants_credentials'
29
31
  autoload :AccessGrantsCredentialsProvider, 'aws-sdk-s3/access_grants_credentials_provider'
30
32
  end
@@ -0,0 +1,103 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aws
4
+ module S3
5
+ # @api private
6
+ class DefaultExecutor
7
+ DEFAULT_MAX_THREADS = 10
8
+ RUNNING = :running
9
+ SHUTTING_DOWN = :shutting_down
10
+ SHUTDOWN = :shutdown
11
+
12
+ def initialize(options = {})
13
+ @max_threads = options[:max_threads] || DEFAULT_MAX_THREADS
14
+ @state = RUNNING
15
+ @queue = Queue.new
16
+ @pool = []
17
+ @mutex = Mutex.new
18
+ end
19
+
20
+ # Submits a task for execution.
21
+ # @param [Object] args Variable number of arguments to pass to the block
22
+ # @param [Proc] block The block to be executed
23
+ # @return [Boolean] Returns true if the task was submitted successfully
24
+ def post(*args, &block)
25
+ @mutex.synchronize do
26
+ raise 'Executor has been shutdown and is no longer accepting tasks' unless @state == RUNNING
27
+
28
+ @queue << [args, block]
29
+ ensure_worker_available
30
+ end
31
+ true
32
+ end
33
+
34
+ # Immediately terminates all worker threads and clears pending tasks.
35
+ # This is a forceful shutdown that doesn't wait for running tasks to complete.
36
+ #
37
+ # @return [Boolean] true when termination is complete
38
+ def kill
39
+ @mutex.synchronize do
40
+ @state = SHUTDOWN
41
+ @pool.each(&:kill)
42
+ @pool.clear
43
+ @queue.clear
44
+ end
45
+ true
46
+ end
47
+
48
+ # Gracefully shuts down the executor, optionally with a timeout.
49
+ # Stops accepting new tasks and waits for running tasks to complete.
50
+ #
51
+ # @param timeout [Numeric, nil] Maximum time in seconds to wait for shutdown.
52
+ # If nil, waits indefinitely. If timeout expires, remaining threads are killed.
53
+ # @return [Boolean] true when shutdown is complete
54
+ def shutdown(timeout = nil)
55
+ @mutex.synchronize do
56
+ return true if @state == SHUTDOWN
57
+
58
+ @state = SHUTTING_DOWN
59
+ @pool.size.times { @queue << :shutdown }
60
+ end
61
+
62
+ if timeout
63
+ deadline = Time.now + timeout
64
+ @pool.each do |thread|
65
+ remaining = deadline - Time.now
66
+ break if remaining <= 0
67
+
68
+ thread.join([remaining, 0].max)
69
+ end
70
+ @pool.select(&:alive?).each(&:kill)
71
+ else
72
+ @pool.each(&:join)
73
+ end
74
+
75
+ @mutex.synchronize do
76
+ @pool.clear
77
+ @state = SHUTDOWN
78
+ end
79
+ true
80
+ end
81
+
82
+ private
83
+
84
+ def ensure_worker_available
85
+ return unless @state == RUNNING
86
+
87
+ @pool.select!(&:alive?)
88
+ @pool << spawn_worker if @pool.size < @max_threads
89
+ end
90
+
91
+ def spawn_worker
92
+ Thread.new do
93
+ while (job = @queue.shift)
94
+ break if job == :shutdown
95
+
96
+ args, block = job
97
+ block.call(*args)
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
103
+ end
@@ -6,9 +6,9 @@ module Aws
6
6
  module S3
7
7
 
8
8
  # [MAINTENANCE MODE] There is a new version of the Encryption Client.
9
- # AWS strongly recommends upgrading to the {Aws::S3::EncryptionV2::Client},
9
+ # AWS strongly recommends upgrading to the {Aws::S3::EncryptionV3::Client},
10
10
  # which provides updated data security best practices.
11
- # See documentation for {Aws::S3::EncryptionV2::Client}.
11
+ # See documentation for {Aws::S3::EncryptionV3::Client}.
12
12
  # Provides an encryption client that encrypts and decrypts data client-side,
13
13
  # storing the encrypted data in Amazon S3.
14
14
  #
@@ -16,6 +16,8 @@ module Aws
16
16
  # envelope and encryption cipher.
17
17
  def encryption_cipher
18
18
  cipher = Utils.aes_encryption_cipher(:CBC)
19
+ ##= ../specification/s3-encryption/data-format/content-metadata.md#algorithm-suite-and-message-format-version-compatibility
20
+ ##% Objects encrypted with ALG_AES_256_CBC_IV16_NO_KDF MAY use either the V1 or V2 message format version.
19
21
  envelope = {
20
22
  'x-amz-key' => encode64(encrypt(envelope_key(cipher))),
21
23
  'x-amz-iv' => encode64(envelope_iv(cipher)),
@@ -38,6 +38,8 @@ module Aws
38
38
  io = StringIO.new(io) if String === io
39
39
  context.params[:body] = IOEncrypter.new(cipher, io)
40
40
  context.params[:metadata] ||= {}
41
+ ##= ../specification/s3-encryption/data-format/content-metadata.md#content-metadata-mapkeys
42
+ ##% - The mapkey "x-amz-unencrypted-content-length" SHOULD be present for V1 format objects.
41
43
  context.params[:metadata]['x-amz-unencrypted-content-length'] = io.size
42
44
  if context.params.delete(:content_md5)
43
45
  warn('Setting content_md5 on client side encrypted objects is deprecated')
@@ -26,6 +26,8 @@ module Aws
26
26
  end
27
27
  cipher = Utils.aes_encryption_cipher(:CBC)
28
28
  cipher.key = key_data.plaintext
29
+ ##= ../specification/s3-encryption/data-format/content-metadata.md#algorithm-suite-and-message-format-version-compatibility
30
+ ##% Objects encrypted with ALG_AES_256_CBC_IV16_NO_KDF MAY use either the V1 or V2 message format version.
29
31
  envelope = {
30
32
  'x-amz-key-v2' => encode64(key_data.ciphertext_blob),
31
33
  'x-amz-iv' => encode64(cipher.iv = cipher.random_iv),