aws-sdk-s3 1.88.1 → 1.105.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +833 -0
  3. data/LICENSE.txt +202 -0
  4. data/VERSION +1 -0
  5. data/lib/aws-sdk-s3/arn/access_point_arn.rb +14 -11
  6. data/lib/aws-sdk-s3/arn/multi_region_access_point_arn.rb +68 -0
  7. data/lib/aws-sdk-s3/arn/object_lambda_arn.rb +69 -0
  8. data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +9 -10
  9. data/lib/aws-sdk-s3/bucket.rb +30 -29
  10. data/lib/aws-sdk-s3/bucket_acl.rb +9 -6
  11. data/lib/aws-sdk-s3/bucket_cors.rb +8 -7
  12. data/lib/aws-sdk-s3/bucket_lifecycle.rb +6 -5
  13. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +3 -3
  14. data/lib/aws-sdk-s3/bucket_logging.rb +6 -6
  15. data/lib/aws-sdk-s3/bucket_notification.rb +4 -4
  16. data/lib/aws-sdk-s3/bucket_policy.rb +6 -5
  17. data/lib/aws-sdk-s3/bucket_request_payment.rb +8 -8
  18. data/lib/aws-sdk-s3/bucket_tagging.rb +6 -5
  19. data/lib/aws-sdk-s3/bucket_versioning.rb +13 -10
  20. data/lib/aws-sdk-s3/bucket_website.rb +6 -5
  21. data/lib/aws-sdk-s3/client.rb +1823 -1323
  22. data/lib/aws-sdk-s3/client_api.rb +65 -1
  23. data/lib/aws-sdk-s3/customizations/bucket.rb +8 -3
  24. data/lib/aws-sdk-s3/customizations/object.rb +41 -16
  25. data/lib/aws-sdk-s3/encryption/client.rb +1 -1
  26. data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +0 -4
  27. data/lib/aws-sdk-s3/encryptionV2/client.rb +1 -1
  28. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +0 -4
  29. data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +0 -4
  30. data/lib/aws-sdk-s3/errors.rb +1 -1
  31. data/lib/aws-sdk-s3/event_streams.rb +1 -1
  32. data/lib/aws-sdk-s3/file_downloader.rb +6 -1
  33. data/lib/aws-sdk-s3/file_uploader.rb +3 -3
  34. data/lib/aws-sdk-s3/multipart_upload.rb +7 -7
  35. data/lib/aws-sdk-s3/multipart_upload_part.rb +9 -8
  36. data/lib/aws-sdk-s3/object.rb +164 -75
  37. data/lib/aws-sdk-s3/object_acl.rb +10 -7
  38. data/lib/aws-sdk-s3/object_summary.rb +75 -71
  39. data/lib/aws-sdk-s3/object_version.rb +18 -17
  40. data/lib/aws-sdk-s3/plugins/accelerate.rb +7 -1
  41. data/lib/aws-sdk-s3/plugins/arn.rb +91 -42
  42. data/lib/aws-sdk-s3/plugins/bucket_dns.rb +1 -1
  43. data/lib/aws-sdk-s3/plugins/dualstack.rb +25 -31
  44. data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +1 -1
  45. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +11 -10
  46. data/lib/aws-sdk-s3/plugins/object_lambda_endpoint.rb +25 -0
  47. data/lib/aws-sdk-s3/plugins/s3_signer.rb +35 -5
  48. data/lib/aws-sdk-s3/presigner.rb +19 -5
  49. data/lib/aws-sdk-s3/resource.rb +5 -3
  50. data/lib/aws-sdk-s3/types.rb +1397 -845
  51. data/lib/aws-sdk-s3/waiters.rb +1 -1
  52. data/lib/aws-sdk-s3.rb +2 -2
  53. metadata +17 -12
@@ -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/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
7
  #
8
8
  # WARNING ABOUT GENERATED CODE
9
9
 
@@ -22,6 +22,7 @@ module Aws::S3
22
22
  AcceptRanges = Shapes::StringShape.new(name: 'AcceptRanges')
23
23
  AccessControlPolicy = Shapes::StructureShape.new(name: 'AccessControlPolicy')
24
24
  AccessControlTranslation = Shapes::StructureShape.new(name: 'AccessControlTranslation')
25
+ AccessPointArn = Shapes::StringShape.new(name: 'AccessPointArn')
25
26
  AccountId = Shapes::StringShape.new(name: 'AccountId')
26
27
  AllowQuotedRecordDelimiter = Shapes::BooleanShape.new(name: 'AllowQuotedRecordDelimiter')
27
28
  AllowedHeader = Shapes::StringShape.new(name: 'AllowedHeader')
@@ -152,7 +153,9 @@ module Aws::S3
152
153
  End = Shapes::IntegerShape.new(name: 'End')
153
154
  EndEvent = Shapes::StructureShape.new(name: 'EndEvent')
154
155
  Error = Shapes::StructureShape.new(name: 'Error')
156
+ ErrorCode = Shapes::StringShape.new(name: 'ErrorCode')
155
157
  ErrorDocument = Shapes::StructureShape.new(name: 'ErrorDocument')
158
+ ErrorMessage = Shapes::StringShape.new(name: 'ErrorMessage')
156
159
  Errors = Shapes::ListShape.new(name: 'Errors', flattened: true)
157
160
  Event = Shapes::StringShape.new(name: 'Event')
158
161
  EventList = Shapes::ListShape.new(name: 'EventList', flattened: true)
@@ -223,6 +226,7 @@ module Aws::S3
223
226
  GetObjectLockConfigurationRequest = Shapes::StructureShape.new(name: 'GetObjectLockConfigurationRequest')
224
227
  GetObjectOutput = Shapes::StructureShape.new(name: 'GetObjectOutput')
225
228
  GetObjectRequest = Shapes::StructureShape.new(name: 'GetObjectRequest')
229
+ GetObjectResponseStatusCode = Shapes::IntegerShape.new(name: 'GetObjectResponseStatusCode')
226
230
  GetObjectRetentionOutput = Shapes::StructureShape.new(name: 'GetObjectRetentionOutput')
227
231
  GetObjectRetentionRequest = Shapes::StructureShape.new(name: 'GetObjectRetentionRequest')
228
232
  GetObjectTaggingOutput = Shapes::StructureShape.new(name: 'GetObjectTaggingOutput')
@@ -475,6 +479,8 @@ module Aws::S3
475
479
  RequestPayer = Shapes::StringShape.new(name: 'RequestPayer')
476
480
  RequestPaymentConfiguration = Shapes::StructureShape.new(name: 'RequestPaymentConfiguration')
477
481
  RequestProgress = Shapes::StructureShape.new(name: 'RequestProgress')
482
+ RequestRoute = Shapes::StringShape.new(name: 'RequestRoute')
483
+ RequestToken = Shapes::StringShape.new(name: 'RequestToken')
478
484
  ResponseCacheControl = Shapes::StringShape.new(name: 'ResponseCacheControl')
479
485
  ResponseContentDisposition = Shapes::StringShape.new(name: 'ResponseContentDisposition')
480
486
  ResponseContentEncoding = Shapes::StringShape.new(name: 'ResponseContentEncoding')
@@ -559,6 +565,7 @@ module Aws::S3
559
565
  VersioningConfiguration = Shapes::StructureShape.new(name: 'VersioningConfiguration')
560
566
  WebsiteConfiguration = Shapes::StructureShape.new(name: 'WebsiteConfiguration')
561
567
  WebsiteRedirectLocation = Shapes::StringShape.new(name: 'WebsiteRedirectLocation')
568
+ WriteGetObjectResponseRequest = Shapes::StructureShape.new(name: 'WriteGetObjectResponseRequest')
562
569
  Years = Shapes::IntegerShape.new(name: 'Years')
563
570
 
564
571
  AbortIncompleteMultipartUpload.add_member(:days_after_initiation, Shapes::ShapeRef.new(shape: DaysAfterInitiation, location_name: "DaysAfterInitiation"))
@@ -634,6 +641,7 @@ module Aws::S3
634
641
  CORSConfiguration.add_member(:cors_rules, Shapes::ShapeRef.new(shape: CORSRules, required: true, location_name: "CORSRule"))
635
642
  CORSConfiguration.struct_class = Types::CORSConfiguration
636
643
 
644
+ CORSRule.add_member(:id, Shapes::ShapeRef.new(shape: ID, location_name: "ID"))
637
645
  CORSRule.add_member(:allowed_headers, Shapes::ShapeRef.new(shape: AllowedHeaders, location_name: "AllowedHeader"))
638
646
  CORSRule.add_member(:allowed_methods, Shapes::ShapeRef.new(shape: AllowedMethods, required: true, location_name: "AllowedMethod"))
639
647
  CORSRule.add_member(:allowed_origins, Shapes::ShapeRef.new(shape: AllowedOrigins, required: true, location_name: "AllowedOrigin"))
@@ -1288,6 +1296,7 @@ module Aws::S3
1288
1296
  GetObjectTaggingRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key"))
1289
1297
  GetObjectTaggingRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "querystring", location_name: "versionId"))
1290
1298
  GetObjectTaggingRequest.add_member(:expected_bucket_owner, Shapes::ShapeRef.new(shape: AccountId, location: "header", location_name: "x-amz-expected-bucket-owner"))
1299
+ GetObjectTaggingRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer"))
1291
1300
  GetObjectTaggingRequest.struct_class = Types::GetObjectTaggingRequest
1292
1301
 
1293
1302
  GetObjectTorrentOutput.add_member(:body, Shapes::ShapeRef.new(shape: Body, location_name: "Body", metadata: {"streaming"=>true}))
@@ -1678,6 +1687,7 @@ module Aws::S3
1678
1687
 
1679
1688
  MetricsAndOperator.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix"))
1680
1689
  MetricsAndOperator.add_member(:tags, Shapes::ShapeRef.new(shape: TagSet, location_name: "Tag", metadata: {"flattened"=>true}))
1690
+ MetricsAndOperator.add_member(:access_point_arn, Shapes::ShapeRef.new(shape: AccessPointArn, location_name: "AccessPointArn"))
1681
1691
  MetricsAndOperator.struct_class = Types::MetricsAndOperator
1682
1692
 
1683
1693
  MetricsConfiguration.add_member(:id, Shapes::ShapeRef.new(shape: MetricsId, required: true, location_name: "Id"))
@@ -1688,6 +1698,7 @@ module Aws::S3
1688
1698
 
1689
1699
  MetricsFilter.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix"))
1690
1700
  MetricsFilter.add_member(:tag, Shapes::ShapeRef.new(shape: Tag, location_name: "Tag"))
1701
+ MetricsFilter.add_member(:access_point_arn, Shapes::ShapeRef.new(shape: AccessPointArn, location_name: "AccessPointArn"))
1691
1702
  MetricsFilter.add_member(:and, Shapes::ShapeRef.new(shape: MetricsAndOperator, location_name: "And"))
1692
1703
  MetricsFilter.struct_class = Types::MetricsFilter
1693
1704
 
@@ -2105,6 +2116,7 @@ module Aws::S3
2105
2116
  PutObjectTaggingRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5"))
2106
2117
  PutObjectTaggingRequest.add_member(:tagging, Shapes::ShapeRef.new(shape: Tagging, required: true, location_name: "Tagging", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}}))
2107
2118
  PutObjectTaggingRequest.add_member(:expected_bucket_owner, Shapes::ShapeRef.new(shape: AccountId, location: "header", location_name: "x-amz-expected-bucket-owner"))
2119
+ PutObjectTaggingRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer"))
2108
2120
  PutObjectTaggingRequest.struct_class = Types::PutObjectTaggingRequest
2109
2121
  PutObjectTaggingRequest[:payload] = :tagging
2110
2122
  PutObjectTaggingRequest[:payload_member] = PutObjectTaggingRequest.member(:tagging)
@@ -2429,6 +2441,46 @@ module Aws::S3
2429
2441
  WebsiteConfiguration.add_member(:routing_rules, Shapes::ShapeRef.new(shape: RoutingRules, location_name: "RoutingRules"))
2430
2442
  WebsiteConfiguration.struct_class = Types::WebsiteConfiguration
2431
2443
 
2444
+ WriteGetObjectResponseRequest.add_member(:request_route, Shapes::ShapeRef.new(shape: RequestRoute, required: true, location: "header", location_name: "x-amz-request-route", metadata: {"hostLabel"=>true, "hostLabelName"=>"RequestRoute"}))
2445
+ WriteGetObjectResponseRequest.add_member(:request_token, Shapes::ShapeRef.new(shape: RequestToken, required: true, location: "header", location_name: "x-amz-request-token"))
2446
+ WriteGetObjectResponseRequest.add_member(:body, Shapes::ShapeRef.new(shape: Body, location_name: "Body", metadata: {"streaming"=>true}))
2447
+ WriteGetObjectResponseRequest.add_member(:status_code, Shapes::ShapeRef.new(shape: GetObjectResponseStatusCode, location: "header", location_name: "x-amz-fwd-status"))
2448
+ WriteGetObjectResponseRequest.add_member(:error_code, Shapes::ShapeRef.new(shape: ErrorCode, location: "header", location_name: "x-amz-fwd-error-code"))
2449
+ WriteGetObjectResponseRequest.add_member(:error_message, Shapes::ShapeRef.new(shape: ErrorMessage, location: "header", location_name: "x-amz-fwd-error-message"))
2450
+ WriteGetObjectResponseRequest.add_member(:accept_ranges, Shapes::ShapeRef.new(shape: AcceptRanges, location: "header", location_name: "x-amz-fwd-header-accept-ranges"))
2451
+ WriteGetObjectResponseRequest.add_member(:cache_control, Shapes::ShapeRef.new(shape: CacheControl, location: "header", location_name: "x-amz-fwd-header-Cache-Control"))
2452
+ WriteGetObjectResponseRequest.add_member(:content_disposition, Shapes::ShapeRef.new(shape: ContentDisposition, location: "header", location_name: "x-amz-fwd-header-Content-Disposition"))
2453
+ WriteGetObjectResponseRequest.add_member(:content_encoding, Shapes::ShapeRef.new(shape: ContentEncoding, location: "header", location_name: "x-amz-fwd-header-Content-Encoding"))
2454
+ WriteGetObjectResponseRequest.add_member(:content_language, Shapes::ShapeRef.new(shape: ContentLanguage, location: "header", location_name: "x-amz-fwd-header-Content-Language"))
2455
+ WriteGetObjectResponseRequest.add_member(:content_length, Shapes::ShapeRef.new(shape: ContentLength, location: "header", location_name: "Content-Length"))
2456
+ WriteGetObjectResponseRequest.add_member(:content_range, Shapes::ShapeRef.new(shape: ContentRange, location: "header", location_name: "x-amz-fwd-header-Content-Range"))
2457
+ WriteGetObjectResponseRequest.add_member(:content_type, Shapes::ShapeRef.new(shape: ContentType, location: "header", location_name: "x-amz-fwd-header-Content-Type"))
2458
+ WriteGetObjectResponseRequest.add_member(:delete_marker, Shapes::ShapeRef.new(shape: DeleteMarker, location: "header", location_name: "x-amz-fwd-header-x-amz-delete-marker"))
2459
+ WriteGetObjectResponseRequest.add_member(:etag, Shapes::ShapeRef.new(shape: ETag, location: "header", location_name: "x-amz-fwd-header-ETag"))
2460
+ WriteGetObjectResponseRequest.add_member(:expires, Shapes::ShapeRef.new(shape: Expires, location: "header", location_name: "x-amz-fwd-header-Expires"))
2461
+ WriteGetObjectResponseRequest.add_member(:expiration, Shapes::ShapeRef.new(shape: Expiration, location: "header", location_name: "x-amz-fwd-header-x-amz-expiration"))
2462
+ WriteGetObjectResponseRequest.add_member(:last_modified, Shapes::ShapeRef.new(shape: LastModified, location: "header", location_name: "x-amz-fwd-header-Last-Modified"))
2463
+ WriteGetObjectResponseRequest.add_member(:missing_meta, Shapes::ShapeRef.new(shape: MissingMeta, location: "header", location_name: "x-amz-fwd-header-x-amz-missing-meta"))
2464
+ WriteGetObjectResponseRequest.add_member(:metadata, Shapes::ShapeRef.new(shape: Metadata, location: "headers", location_name: "x-amz-meta-"))
2465
+ WriteGetObjectResponseRequest.add_member(:object_lock_mode, Shapes::ShapeRef.new(shape: ObjectLockMode, location: "header", location_name: "x-amz-fwd-header-x-amz-object-lock-mode"))
2466
+ WriteGetObjectResponseRequest.add_member(:object_lock_legal_hold_status, Shapes::ShapeRef.new(shape: ObjectLockLegalHoldStatus, location: "header", location_name: "x-amz-fwd-header-x-amz-object-lock-legal-hold"))
2467
+ WriteGetObjectResponseRequest.add_member(:object_lock_retain_until_date, Shapes::ShapeRef.new(shape: ObjectLockRetainUntilDate, location: "header", location_name: "x-amz-fwd-header-x-amz-object-lock-retain-until-date"))
2468
+ WriteGetObjectResponseRequest.add_member(:parts_count, Shapes::ShapeRef.new(shape: PartsCount, location: "header", location_name: "x-amz-fwd-header-x-amz-mp-parts-count"))
2469
+ WriteGetObjectResponseRequest.add_member(:replication_status, Shapes::ShapeRef.new(shape: ReplicationStatus, location: "header", location_name: "x-amz-fwd-header-x-amz-replication-status"))
2470
+ WriteGetObjectResponseRequest.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-fwd-header-x-amz-request-charged"))
2471
+ WriteGetObjectResponseRequest.add_member(:restore, Shapes::ShapeRef.new(shape: Restore, location: "header", location_name: "x-amz-fwd-header-x-amz-restore"))
2472
+ WriteGetObjectResponseRequest.add_member(:server_side_encryption, Shapes::ShapeRef.new(shape: ServerSideEncryption, location: "header", location_name: "x-amz-fwd-header-x-amz-server-side-encryption"))
2473
+ WriteGetObjectResponseRequest.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-fwd-header-x-amz-server-side-encryption-customer-algorithm"))
2474
+ WriteGetObjectResponseRequest.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-fwd-header-x-amz-server-side-encryption-aws-kms-key-id"))
2475
+ WriteGetObjectResponseRequest.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-fwd-header-x-amz-server-side-encryption-customer-key-MD5"))
2476
+ WriteGetObjectResponseRequest.add_member(:storage_class, Shapes::ShapeRef.new(shape: StorageClass, location: "header", location_name: "x-amz-fwd-header-x-amz-storage-class"))
2477
+ WriteGetObjectResponseRequest.add_member(:tag_count, Shapes::ShapeRef.new(shape: TagCount, location: "header", location_name: "x-amz-fwd-header-x-amz-tagging-count"))
2478
+ WriteGetObjectResponseRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "header", location_name: "x-amz-fwd-header-x-amz-version-id"))
2479
+ WriteGetObjectResponseRequest.add_member(:bucket_key_enabled, Shapes::ShapeRef.new(shape: BucketKeyEnabled, location: "header", location_name: "x-amz-fwd-header-x-amz-server-side-encryption-bucket-key-enabled"))
2480
+ WriteGetObjectResponseRequest.struct_class = Types::WriteGetObjectResponseRequest
2481
+ WriteGetObjectResponseRequest[:payload] = :body
2482
+ WriteGetObjectResponseRequest[:payload_member] = WriteGetObjectResponseRequest.member(:body)
2483
+
2432
2484
 
2433
2485
  # @api private
2434
2486
  API = Seahorse::Model::Api.new.tap do |api|
@@ -3285,6 +3337,18 @@ module Aws::S3
3285
3337
  o.input = Shapes::ShapeRef.new(shape: UploadPartCopyRequest)
3286
3338
  o.output = Shapes::ShapeRef.new(shape: UploadPartCopyOutput)
3287
3339
  end)
3340
+
3341
+ api.add_operation(:write_get_object_response, Seahorse::Model::Operation.new.tap do |o|
3342
+ o.name = "WriteGetObjectResponse"
3343
+ o.http_method = "POST"
3344
+ o.http_request_uri = "/WriteGetObjectResponse"
3345
+ o['authtype'] = "v4-unsigned-body"
3346
+ o.endpoint_pattern = {
3347
+ "hostPrefix" => "{RequestRoute}.",
3348
+ }
3349
+ o.input = Shapes::ShapeRef.new(shape: WriteGetObjectResponseRequest)
3350
+ o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
3351
+ end)
3288
3352
  end
3289
3353
 
3290
3354
  end
@@ -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.bucket.com')
91
+ # bucket = s3.bucket('my-bucket.com')
92
92
  # bucket.url(virtual_host: true)
93
- # #=> "http://my.bucket.com"
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
- "http://#{name}"
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
- # @param [Symbol] http_method
157
- # The HTTP method to generate a presigned URL for. Valid values
158
- # are `:get`, `:put`, `:head`, and `:delete`.
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
- # | HTTP Method | Client Method |
166
- # |---------------|------------------------|
167
- # | `:get` | {Client#get_object} |
168
- # | `:put` | {Client#put_object} |
169
- # | `:head` | {Client#head_object} |
170
- # | `:delete` | {Client#delete_object} |
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,15 @@ module Aws
188
202
  #
189
203
  # @return [String]
190
204
  #
191
- def presigned_url(http_method, params = {})
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
- "#{http_method.downcase}_object",
213
+ method.downcase,
195
214
  params.merge(bucket: bucket_name, key: key)
196
215
  )
197
216
  end
@@ -201,16 +220,22 @@ module Aws
201
220
  # s3.bucket('bucket-name').object('obj-key').public_url
202
221
  # #=> "https://bucket-name.s3.amazonaws.com/obj-key"
203
222
  #
204
- # To use virtual hosted bucket url (disables https):
223
+ # To use virtual hosted bucket url.
224
+ # Uses https unless secure: false is set. If the bucket
225
+ # name contains dots (.) then you will need to set secure: false.
205
226
  #
206
- # s3.bucket('my.bucket.com').object('key')
227
+ # s3.bucket('my-bucket.com').object('key')
207
228
  # .public_url(virtual_host: true)
208
- # #=> "http://my.bucket.com/key"
229
+ # #=> "https://my-bucket.com/key"
209
230
  #
210
231
  # @option options [Boolean] :virtual_host (false) When `true`, the bucket
211
232
  # name will be used as the host name. This is useful when you have
212
233
  # a CNAME configured for the bucket.
213
234
  #
235
+ # @option options [Boolean] :secure (true) When `false`, http
236
+ # will be used with virtual_host. This is required when
237
+ # the bucket name has a dot (.) in it.
238
+ #
214
239
  # @return [String]
215
240
  def public_url(options = {})
216
241
  url = URI.parse(bucket.url(options))
@@ -312,10 +337,10 @@ module Aws
312
337
  # using an open Tempfile, rewind it before uploading or else the object
313
338
  # will be empty.
314
339
  #
315
- # @option options [Integer] :multipart_threshold (15728640) Files larger
340
+ # @option options [Integer] :multipart_threshold (104857600) Files larger
316
341
  # than or equal to `:multipart_threshold` are uploaded using the S3
317
342
  # multipart APIs.
318
- # Default threshold is 15MB.
343
+ # Default threshold is 100MB.
319
344
  #
320
345
  # @option options [Integer] :thread_count (10) The number of parallel
321
346
  # multipart uploads. This option is not used if the file is smaller than
@@ -120,7 +120,7 @@ module Aws
120
120
  # attr_reader :encryption_materials
121
121
  #
122
122
  # def key_for(matdesc)
123
- # key_name = JSON.load(matdesc)['key']
123
+ # key_name = JSON.parse(matdesc)['key']
124
124
  # if key = @keys[key_name]
125
125
  # key
126
126
  # else
@@ -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)
@@ -157,7 +157,7 @@ module Aws
157
157
  # attr_reader :encryption_materials
158
158
  #
159
159
  # def key_for(matdesc)
160
- # key_name = JSON.load(matdesc)['key']
160
+ # key_name = JSON.parse(matdesc)['key']
161
161
  # if key = @keys[key_name]
162
162
  # key
163
163
  # else
@@ -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)
@@ -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]
@@ -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/master/CONTRIBUTING.md
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/master/CONTRIBUTING.md
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 || [(file_size.to_f / MAX_PARTS).ceil, MIN_CHUNK_SIZE].max.to_i
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
 
@@ -7,16 +7,16 @@ module Aws
7
7
  # @api private
8
8
  class FileUploader
9
9
 
10
- FIFTEEN_MEGABYTES = 15 * 1024 * 1024
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 (15728640)
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
- FIFTEEN_MEGABYTES
19
+ ONE_HUNDRED_MEGABYTES
20
20
  end
21
21
 
22
22
  # @return [Client]
@@ -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/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
7
  #
8
8
  # WARNING ABOUT GENERATED CODE
9
9
 
@@ -228,13 +228,13 @@ module Aws::S3
228
228
  # request. Bucket owners need not specify this parameter in their
229
229
  # requests. For information about downloading objects from requester
230
230
  # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
231
- # in the *Amazon S3 Developer Guide*.
231
+ # in the *Amazon S3 User Guide*.
232
232
  #
233
233
  #
234
234
  #
235
235
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
236
236
  # @option options [String] :expected_bucket_owner
237
- # The account id of the expected bucket owner. If the bucket is owned by
237
+ # The account ID of the expected bucket owner. If the bucket is owned by
238
238
  # a different account, the request will fail with an HTTP `403 (Access
239
239
  # Denied)` error.
240
240
  # @return [Types::AbortMultipartUploadOutput]
@@ -270,13 +270,13 @@ module Aws::S3
270
270
  # request. Bucket owners need not specify this parameter in their
271
271
  # requests. For information about downloading objects from requester
272
272
  # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
273
- # in the *Amazon S3 Developer Guide*.
273
+ # in the *Amazon S3 User Guide*.
274
274
  #
275
275
  #
276
276
  #
277
277
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
278
278
  # @option options [String] :expected_bucket_owner
279
- # The account id of the expected bucket owner. If the bucket is owned by
279
+ # The account ID of the expected bucket owner. If the bucket is owned by
280
280
  # a different account, the request will fail with an HTTP `403 (Access
281
281
  # Denied)` error.
282
282
  # @return [Object]
@@ -329,13 +329,13 @@ module Aws::S3
329
329
  # request. Bucket owners need not specify this parameter in their
330
330
  # requests. For information about downloading objects from requester
331
331
  # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
332
- # in the *Amazon S3 Developer Guide*.
332
+ # in the *Amazon S3 User Guide*.
333
333
  #
334
334
  #
335
335
  #
336
336
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
337
337
  # @option options [String] :expected_bucket_owner
338
- # The account id of the expected bucket owner. If the bucket is owned by
338
+ # The account ID of the expected bucket owner. If the bucket is owned by
339
339
  # a different account, the request will fail with an HTTP `403 (Access
340
340
  # Denied)` error.
341
341
  # @return [MultipartUploadPart::Collection]
@@ -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/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
7
  #
8
8
  # WARNING ABOUT GENERATED CODE
9
9
 
@@ -248,7 +248,8 @@ module Aws::S3
248
248
  # The value must be URL encoded.
249
249
  #
250
250
  # <note markdown="1"> Amazon S3 supports copy operations using access points only when the
251
- # source and destination buckets are in the same AWS Region.
251
+ # source and destination buckets are in the same Amazon Web Services
252
+ # Region.
252
253
  #
253
254
  # </note>
254
255
  #
@@ -269,7 +270,7 @@ module Aws::S3
269
270
  #
270
271
  #
271
272
  #
272
- # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-points.html
273
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html
273
274
  # @option options [String] :copy_source_if_match
274
275
  # Copies the object if its entity tag (ETag) matches the specified tag.
275
276
  # @option options [Time,DateTime,Date,Integer,String] :copy_source_if_modified_since
@@ -317,17 +318,17 @@ module Aws::S3
317
318
  # request. Bucket owners need not specify this parameter in their
318
319
  # requests. For information about downloading objects from requester
319
320
  # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
320
- # in the *Amazon S3 Developer Guide*.
321
+ # in the *Amazon S3 User Guide*.
321
322
  #
322
323
  #
323
324
  #
324
325
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
325
326
  # @option options [String] :expected_bucket_owner
326
- # The account id of the expected destination bucket owner. If the
327
+ # The account ID of the expected destination bucket owner. If the
327
328
  # destination bucket is owned by a different account, the request will
328
329
  # fail with an HTTP `403 (Access Denied)` error.
329
330
  # @option options [String] :expected_source_bucket_owner
330
- # The account id of the expected source bucket owner. If the source
331
+ # The account ID of the expected source bucket owner. If the source
331
332
  # bucket is owned by a different account, the request will fail with an
332
333
  # HTTP `403 (Access Denied)` error.
333
334
  # @return [Types::UploadPartCopyOutput]
@@ -384,13 +385,13 @@ module Aws::S3
384
385
  # request. Bucket owners need not specify this parameter in their
385
386
  # requests. For information about downloading objects from requester
386
387
  # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
387
- # in the *Amazon S3 Developer Guide*.
388
+ # in the *Amazon S3 User Guide*.
388
389
  #
389
390
  #
390
391
  #
391
392
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
392
393
  # @option options [String] :expected_bucket_owner
393
- # The account id of the expected bucket owner. If the bucket is owned by
394
+ # The account ID of the expected bucket owner. If the bucket is owned by
394
395
  # a different account, the request will fail with an HTTP `403 (Access
395
396
  # Denied)` error.
396
397
  # @return [Types::UploadPartOutput]