aws-sdk-s3 1.113.0 → 1.133.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +163 -0
  3. data/VERSION +1 -1
  4. data/lib/aws-sdk-s3/bucket.rb +108 -55
  5. data/lib/aws-sdk-s3/bucket_acl.rb +9 -3
  6. data/lib/aws-sdk-s3/bucket_cors.rb +12 -4
  7. data/lib/aws-sdk-s3/bucket_lifecycle.rb +12 -4
  8. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +12 -4
  9. data/lib/aws-sdk-s3/bucket_logging.rb +9 -3
  10. data/lib/aws-sdk-s3/bucket_notification.rb +9 -3
  11. data/lib/aws-sdk-s3/bucket_policy.rb +12 -4
  12. data/lib/aws-sdk-s3/bucket_request_payment.rb +9 -3
  13. data/lib/aws-sdk-s3/bucket_tagging.rb +12 -4
  14. data/lib/aws-sdk-s3/bucket_versioning.rb +15 -5
  15. data/lib/aws-sdk-s3/bucket_website.rb +12 -4
  16. data/lib/aws-sdk-s3/client.rb +1894 -1573
  17. data/lib/aws-sdk-s3/client_api.rb +213 -189
  18. data/lib/aws-sdk-s3/customizations/bucket.rb +23 -47
  19. data/lib/aws-sdk-s3/customizations/errors.rb +27 -0
  20. data/lib/aws-sdk-s3/customizations/object.rb +95 -19
  21. data/lib/aws-sdk-s3/customizations/types/permanent_redirect.rb +26 -0
  22. data/lib/aws-sdk-s3/customizations.rb +2 -0
  23. data/lib/aws-sdk-s3/encryption/client.rb +6 -2
  24. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +13 -9
  25. data/lib/aws-sdk-s3/encryptionV2/client.rb +6 -2
  26. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +1 -0
  27. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +10 -6
  28. data/lib/aws-sdk-s3/endpoint_parameters.rb +146 -0
  29. data/lib/aws-sdk-s3/endpoint_provider.rb +509 -0
  30. data/lib/aws-sdk-s3/endpoints.rb +2150 -0
  31. data/lib/aws-sdk-s3/file_downloader.rb +170 -44
  32. data/lib/aws-sdk-s3/file_uploader.rb +8 -6
  33. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +41 -13
  34. data/lib/aws-sdk-s3/multipart_upload.rb +12 -4
  35. data/lib/aws-sdk-s3/multipart_upload_part.rb +10 -4
  36. data/lib/aws-sdk-s3/object.rb +105 -77
  37. data/lib/aws-sdk-s3/object_acl.rb +9 -3
  38. data/lib/aws-sdk-s3/object_copier.rb +7 -5
  39. data/lib/aws-sdk-s3/object_multipart_copier.rb +41 -19
  40. data/lib/aws-sdk-s3/object_summary.rb +106 -65
  41. data/lib/aws-sdk-s3/object_version.rb +35 -9
  42. data/lib/aws-sdk-s3/plugins/accelerate.rb +3 -50
  43. data/lib/aws-sdk-s3/plugins/arn.rb +0 -184
  44. data/lib/aws-sdk-s3/plugins/bucket_dns.rb +3 -39
  45. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +1 -6
  46. data/lib/aws-sdk-s3/plugins/dualstack.rb +1 -49
  47. data/lib/aws-sdk-s3/plugins/endpoints.rb +262 -0
  48. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +2 -1
  49. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +0 -29
  50. data/lib/aws-sdk-s3/plugins/s3_signer.rb +35 -124
  51. data/lib/aws-sdk-s3/plugins/streaming_retry.rb +23 -2
  52. data/lib/aws-sdk-s3/presigned_post.rb +61 -59
  53. data/lib/aws-sdk-s3/presigner.rb +24 -35
  54. data/lib/aws-sdk-s3/resource.rb +7 -3
  55. data/lib/aws-sdk-s3/types.rb +714 -4040
  56. data/lib/aws-sdk-s3.rb +5 -1
  57. metadata +12 -11
  58. data/lib/aws-sdk-s3/arn/access_point_arn.rb +0 -69
  59. data/lib/aws-sdk-s3/arn/multi_region_access_point_arn.rb +0 -68
  60. data/lib/aws-sdk-s3/arn/object_lambda_arn.rb +0 -69
  61. data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +0 -74
  62. data/lib/aws-sdk-s3/plugins/object_lambda_endpoint.rb +0 -25
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative '../arn/access_point_arn'
4
- require_relative '../arn/object_lambda_arn'
5
- require_relative '../arn/outpost_access_point_arn'
6
- require_relative '../arn/multi_region_access_point_arn'
7
-
8
3
  module Aws
9
4
  module S3
10
5
  module Plugins
@@ -36,150 +31,9 @@ result in cross region requests.
36
31
  resolve_s3_disable_multiregion_access_points(cfg)
37
32
  end
38
33
 
39
- # param validator is validate:50
40
- # endpoint is build:90 (populates the URI for the first time)
41
- # endpoint pattern is build:10
42
- def add_handlers(handlers, _config)
43
- handlers.add(ARNHandler, step: :validate, priority: 75)
44
- handlers.add(UrlHandler)
45
- end
46
-
47
- # After extracting out any ARN input, resolve a new URL with it.
48
- class UrlHandler < Seahorse::Client::Handler
49
- def call(context)
50
- if context.metadata[:s3_arn]
51
- ARN.resolve_url!(
52
- context.http_request.endpoint,
53
- context.metadata[:s3_arn][:arn],
54
- context.metadata[:s3_arn][:resolved_region],
55
- context.metadata[:s3_arn][:fips],
56
- context.metadata[:s3_arn][:dualstack],
57
- # if regional_endpoint is false, a custom endpoint was provided
58
- # in this case, we want to prefix the endpoint using the ARN
59
- !context.config.regional_endpoint
60
- )
61
- end
62
- @handler.call(context)
63
- end
64
- end
65
-
66
- # This plugin will extract out any ARN input and set context for other
67
- # plugins to use without having to translate the ARN again.
68
- class ARNHandler < Seahorse::Client::Handler
69
- def call(context)
70
- bucket_member = _bucket_member(context.operation.input.shape)
71
- if bucket_member && (bucket = context.params[bucket_member])
72
- resolved_region, arn = ARN.resolve_arn!(
73
- bucket,
74
- context.config.region,
75
- context.config.s3_use_arn_region
76
- )
77
- if arn
78
- validate_config!(context, arn)
79
-
80
- context.metadata[:s3_arn] = {
81
- arn: arn,
82
- resolved_region: resolved_region,
83
- fips: context.config.use_fips_endpoint,
84
- dualstack: extract_dualstack_config!(context)
85
- }
86
- end
87
- end
88
- @handler.call(context)
89
- end
90
-
91
- private
92
-
93
- def _bucket_member(input)
94
- input.members.each do |member, ref|
95
- return member if ref.shape.name == 'BucketName'
96
- end
97
- nil
98
- end
99
-
100
- # other plugins use dualstack so disable it when we're done
101
- def extract_dualstack_config!(context)
102
- dualstack = context[:use_dualstack_endpoint]
103
- context[:use_dualstack_endpoint] = false if dualstack
104
- dualstack
105
- end
106
-
107
- def validate_config!(context, arn)
108
- if context.config.force_path_style
109
- raise ArgumentError,
110
- 'Cannot provide an Access Point ARN when '\
111
- '`:force_path_style` is set to true.'
112
- end
113
-
114
- if context.config.use_accelerate_endpoint
115
- raise ArgumentError,
116
- 'Cannot provide an Access Point ARN when '\
117
- '`:use_accelerate_endpoint` is set to true.'
118
- end
119
-
120
- if !arn.support_dualstack? && context[:use_dualstack_endpoint]
121
- raise ArgumentError,
122
- 'Cannot provide an Outpost Access Point, Object Lambda, '\
123
- 'or Multi-region Access Point ARN'\
124
- ' when `:use_dualstack_endpoint` is set to true.'
125
- end
126
-
127
- if arn.region.empty? && context.config.s3_disable_multiregion_access_points
128
- raise ArgumentError,
129
- 'Cannot provide a Multi-region Access Point ARN with '\
130
- '`:s3_disable_multiregion_access_points` set to true'
131
- end
132
-
133
- if context.config.use_fips_endpoint && !arn.support_fips?
134
- raise ArgumentError,
135
- 'FIPS client regions are not supported for this type '\
136
- 'of ARN.'
137
- end
138
- end
139
- end
140
-
141
34
  class << self
142
- # @api private
143
- def resolve_arn!(member_value, region, use_arn_region)
144
- if Aws::ARNParser.arn?(member_value)
145
- arn = Aws::ARNParser.parse(member_value)
146
- s3_arn = resolve_arn_type!(arn)
147
- s3_arn.validate_arn!
148
- validate_region_config!(s3_arn, region, use_arn_region)
149
- region = s3_arn.region if use_arn_region
150
- [region, s3_arn]
151
- else
152
- [region]
153
- end
154
- end
155
-
156
- # @api private
157
- def resolve_url!(url, arn, region, fips = false, dualstack = false, has_custom_endpoint = false)
158
- custom_endpoint = url.host if has_custom_endpoint
159
- url.host = arn.host_url(region, fips, dualstack, custom_endpoint)
160
- url.path = url_path(url.path, arn)
161
- url
162
- end
163
-
164
35
  private
165
36
 
166
- def resolve_arn_type!(arn)
167
- case arn.service
168
- when 's3'
169
- arn.region.empty? ?
170
- Aws::S3::MultiRegionAccessPointARN.new(arn.to_h) :
171
- Aws::S3::AccessPointARN.new(arn.to_h)
172
- when 's3-outposts'
173
- Aws::S3::OutpostAccessPointARN.new(arn.to_h)
174
- when 's3-object-lambda'
175
- Aws::S3::ObjectLambdaARN.new(arn.to_h)
176
- else
177
- raise ArgumentError,
178
- 'Only Access Point, Outposts, and Object Lambdas ARNs '\
179
- 'are currently supported.'
180
- end
181
- end
182
-
183
37
  def resolve_s3_use_arn_region(cfg)
184
38
  value = ENV['AWS_S3_USE_ARN_REGION'] ||
185
39
  Aws.shared_config.s3_use_arn_region(profile: cfg.profile) ||
@@ -209,44 +63,6 @@ result in cross region requests.
209
63
  end
210
64
  value
211
65
  end
212
-
213
- # Remove ARN from the path because we've already set the new host
214
- def url_path(path, arn)
215
- path = path.sub("/#{Seahorse::Util.uri_escape(arn.to_s)}", '')
216
- .sub("/#{arn}", '')
217
- "/#{path}" unless path =~ /^\//
218
- path
219
- end
220
-
221
- def validate_region_config!(arn, region, use_arn_region)
222
- if ['s3-external-1', 'aws-global'].include?(region)
223
- # These "regions" are not regional endpoints
224
- unless use_arn_region
225
- raise Aws::Errors::InvalidARNRegionError,
226
- 'Configured client region is not a regional endpoint.'
227
- end
228
- # These "regions" are in the AWS partition
229
- # Cannot use ARN region unless it's the same partition
230
- unless arn.partition == 'aws'
231
- raise Aws::Errors::InvalidARNPartitionError
232
- end
233
- else
234
- # use_arn_region does not apply to MRAP (global) arns
235
- unless arn.region.empty?
236
- # Raise if the ARN and client regions are in different partitions
237
- if use_arn_region &&
238
- !Aws::Partitions.partition(arn.partition).region?(region)
239
- raise Aws::Errors::InvalidARNPartitionError
240
- end
241
-
242
- # Raise if regions mismatch
243
- # Either when it's a fips client or not using the ARN region
244
- if !use_arn_region && region != arn.region
245
- raise Aws::Errors::InvalidARNRegionError
246
- end
247
- end
248
- end
249
- end
250
66
  end
251
67
  end
252
68
  end
@@ -23,45 +23,10 @@ When set to `true`, the bucket name is always left in the
23
23
  request URI and never moved to the host as a sub-domain.
24
24
  DOCS
25
25
 
26
- def add_handlers(handlers, config)
27
- handlers.add(Handler, priority: 48) unless config.force_path_style
28
- end
29
-
30
- # @api private
31
- class Handler < Seahorse::Client::Handler
32
-
33
- def call(context)
34
- move_dns_compat_bucket_to_subdomain(context)
35
- @handler.call(context)
36
- end
37
-
38
- private
39
-
40
- def move_dns_compat_bucket_to_subdomain(context)
41
- bucket_name = context.params[:bucket]
42
- endpoint = context.http_request.endpoint
43
- if bucket_name &&
44
- BucketDns.dns_compatible?(bucket_name, https?(endpoint)) &&
45
- context.operation_name.to_s != 'get_bucket_location'
46
- move_bucket_to_subdomain(bucket_name, endpoint)
47
- end
48
- end
49
-
50
- def move_bucket_to_subdomain(bucket_name, endpoint)
51
- endpoint.host = "#{bucket_name}.#{endpoint.host}"
52
- path = endpoint.path.sub("/#{bucket_name}", '')
53
- path = "/#{path}" unless path.match(/^\//)
54
- endpoint.path = path
55
- end
56
-
57
- def https?(uri)
58
- uri.scheme == 'https'
59
- end
60
-
61
- end
62
-
26
+ # These class methods were originally used in a handler in this plugin.
27
+ # SigV2 legacy signer needs this logic so we keep it here as utility.
28
+ # New endpoint resolution will check this as a matcher.
63
29
  class << self
64
-
65
30
  # @param [String] bucket_name
66
31
  # @param [Boolean] ssl
67
32
  # @return [Boolean]
@@ -81,7 +46,6 @@ request URI and never moved to the host as a sub-domain.
81
46
  bucket_name !~ /(\d+\.){3}\d+/ &&
82
47
  bucket_name !~ /[.-]{2}/
83
48
  end
84
-
85
49
  end
86
50
  end
87
51
  end
@@ -13,12 +13,7 @@ module Aws
13
13
  def call(context)
14
14
  bucket_member = _bucket_member(context.operation.input.shape)
15
15
  if bucket_member && (bucket = context.params[bucket_member])
16
- _resolved_region, arn = ARN.resolve_arn!(
17
- bucket,
18
- context.config.region,
19
- context.config.s3_use_arn_region
20
- )
21
- if !arn && bucket.include?('/')
16
+ if !Aws::ARNParser.arn?(bucket) && bucket.include?('/')
22
17
  raise ArgumentError,
23
18
  'bucket name must not contain a forward-slash (/)'
24
19
  end
@@ -5,9 +5,8 @@ module Aws
5
5
  module Plugins
6
6
  # @api private
7
7
  class Dualstack < Seahorse::Client::Plugin
8
- def add_handlers(handlers, config)
8
+ def add_handlers(handlers, _config)
9
9
  handlers.add(OptionHandler, step: :initialize)
10
- handlers.add(DualstackHandler, step: :build, priority: 49)
11
10
  end
12
11
 
13
12
  # @api private
@@ -18,57 +17,10 @@ module Aws
18
17
  dualstack = context.params.delete(:use_dualstack_endpoint)
19
18
  end
20
19
  dualstack = context.config.use_dualstack_endpoint if dualstack.nil?
21
- # Raise if :endpoint and dualstack are both provided
22
- if dualstack && !context.config.regional_endpoint
23
- raise ArgumentError,
24
- 'Cannot use both :use_dualstack_endpoint and :endpoint'
25
- end
26
20
  context[:use_dualstack_endpoint] = dualstack
27
21
  @handler.call(context)
28
22
  end
29
23
  end
30
-
31
- # @api private
32
- class DualstackHandler < Seahorse::Client::Handler
33
- def call(context)
34
- # only rewrite the endpoint if it's not a custom endpoint
35
- # accelerate/ARN already handle dualstack cases, so ignore these
36
- # check to see if dualstack is on but configured off via operation
37
- if context.config.regional_endpoint &&
38
- use_dualstack_endpoint?(context)
39
- apply_dualstack_endpoint(context)
40
- end
41
- @handler.call(context)
42
- end
43
-
44
- private
45
-
46
- def apply_dualstack_endpoint(context)
47
- new_endpoint = Aws::Partitions::EndpointProvider.resolve(
48
- context.config.region,
49
- 's3',
50
- 'regional',
51
- {
52
- dualstack: context[:use_dualstack_endpoint],
53
- fips: context.config.use_fips_endpoint
54
- }
55
- )
56
- endpoint = URI.parse(context.http_request.endpoint.to_s)
57
- endpoint.host = URI.parse(new_endpoint).host
58
- context.http_request.endpoint = endpoint
59
- end
60
-
61
- def use_dualstack_endpoint?(context)
62
- # case when dualstack is turned off via operation
63
- (context[:use_dualstack_endpoint] ||
64
- context.config.use_dualstack_endpoint) &&
65
- # accelerate plugin already applies dualstack
66
- !context[:use_accelerate_endpoint] &&
67
- # arns handle dualstack
68
- !context.metadata[:s3_arn]
69
- end
70
- end
71
-
72
24
  end
73
25
  end
74
26
  end
@@ -0,0 +1,262 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::S3
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::S3::EndpointProvider',
17
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
18
+ 'object that responds to `#resolve_endpoint(parameters)` '\
19
+ 'where `parameters` is a Struct similar to '\
20
+ '`Aws::S3::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::S3::EndpointProvider.new
23
+ end
24
+
25
+ # @api private
26
+ class Handler < Seahorse::Client::Handler
27
+ def call(context)
28
+ # If endpoint was discovered, do not resolve or apply the endpoint.
29
+ unless context[:discovered_endpoint]
30
+ params = parameters_for_operation(context)
31
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
32
+
33
+ context.http_request.endpoint = endpoint.url
34
+ apply_endpoint_headers(context, endpoint.headers)
35
+ end
36
+
37
+ context[:endpoint_params] = params
38
+ context[:auth_scheme] =
39
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
40
+
41
+ @handler.call(context)
42
+ end
43
+
44
+ private
45
+
46
+ def apply_endpoint_headers(context, headers)
47
+ headers.each do |key, values|
48
+ value = values
49
+ .compact
50
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
51
+ .join(',')
52
+
53
+ context.http_request.headers[key] = value
54
+ end
55
+ end
56
+
57
+ def parameters_for_operation(context)
58
+ case context.operation_name
59
+ when :abort_multipart_upload
60
+ Aws::S3::Endpoints::AbortMultipartUpload.build(context)
61
+ when :complete_multipart_upload
62
+ Aws::S3::Endpoints::CompleteMultipartUpload.build(context)
63
+ when :copy_object
64
+ Aws::S3::Endpoints::CopyObject.build(context)
65
+ when :create_bucket
66
+ Aws::S3::Endpoints::CreateBucket.build(context)
67
+ when :create_multipart_upload
68
+ Aws::S3::Endpoints::CreateMultipartUpload.build(context)
69
+ when :delete_bucket
70
+ Aws::S3::Endpoints::DeleteBucket.build(context)
71
+ when :delete_bucket_analytics_configuration
72
+ Aws::S3::Endpoints::DeleteBucketAnalyticsConfiguration.build(context)
73
+ when :delete_bucket_cors
74
+ Aws::S3::Endpoints::DeleteBucketCors.build(context)
75
+ when :delete_bucket_encryption
76
+ Aws::S3::Endpoints::DeleteBucketEncryption.build(context)
77
+ when :delete_bucket_intelligent_tiering_configuration
78
+ Aws::S3::Endpoints::DeleteBucketIntelligentTieringConfiguration.build(context)
79
+ when :delete_bucket_inventory_configuration
80
+ Aws::S3::Endpoints::DeleteBucketInventoryConfiguration.build(context)
81
+ when :delete_bucket_lifecycle
82
+ Aws::S3::Endpoints::DeleteBucketLifecycle.build(context)
83
+ when :delete_bucket_metrics_configuration
84
+ Aws::S3::Endpoints::DeleteBucketMetricsConfiguration.build(context)
85
+ when :delete_bucket_ownership_controls
86
+ Aws::S3::Endpoints::DeleteBucketOwnershipControls.build(context)
87
+ when :delete_bucket_policy
88
+ Aws::S3::Endpoints::DeleteBucketPolicy.build(context)
89
+ when :delete_bucket_replication
90
+ Aws::S3::Endpoints::DeleteBucketReplication.build(context)
91
+ when :delete_bucket_tagging
92
+ Aws::S3::Endpoints::DeleteBucketTagging.build(context)
93
+ when :delete_bucket_website
94
+ Aws::S3::Endpoints::DeleteBucketWebsite.build(context)
95
+ when :delete_object
96
+ Aws::S3::Endpoints::DeleteObject.build(context)
97
+ when :delete_object_tagging
98
+ Aws::S3::Endpoints::DeleteObjectTagging.build(context)
99
+ when :delete_objects
100
+ Aws::S3::Endpoints::DeleteObjects.build(context)
101
+ when :delete_public_access_block
102
+ Aws::S3::Endpoints::DeletePublicAccessBlock.build(context)
103
+ when :get_bucket_accelerate_configuration
104
+ Aws::S3::Endpoints::GetBucketAccelerateConfiguration.build(context)
105
+ when :get_bucket_acl
106
+ Aws::S3::Endpoints::GetBucketAcl.build(context)
107
+ when :get_bucket_analytics_configuration
108
+ Aws::S3::Endpoints::GetBucketAnalyticsConfiguration.build(context)
109
+ when :get_bucket_cors
110
+ Aws::S3::Endpoints::GetBucketCors.build(context)
111
+ when :get_bucket_encryption
112
+ Aws::S3::Endpoints::GetBucketEncryption.build(context)
113
+ when :get_bucket_intelligent_tiering_configuration
114
+ Aws::S3::Endpoints::GetBucketIntelligentTieringConfiguration.build(context)
115
+ when :get_bucket_inventory_configuration
116
+ Aws::S3::Endpoints::GetBucketInventoryConfiguration.build(context)
117
+ when :get_bucket_lifecycle
118
+ Aws::S3::Endpoints::GetBucketLifecycle.build(context)
119
+ when :get_bucket_lifecycle_configuration
120
+ Aws::S3::Endpoints::GetBucketLifecycleConfiguration.build(context)
121
+ when :get_bucket_location
122
+ Aws::S3::Endpoints::GetBucketLocation.build(context)
123
+ when :get_bucket_logging
124
+ Aws::S3::Endpoints::GetBucketLogging.build(context)
125
+ when :get_bucket_metrics_configuration
126
+ Aws::S3::Endpoints::GetBucketMetricsConfiguration.build(context)
127
+ when :get_bucket_notification
128
+ Aws::S3::Endpoints::GetBucketNotification.build(context)
129
+ when :get_bucket_notification_configuration
130
+ Aws::S3::Endpoints::GetBucketNotificationConfiguration.build(context)
131
+ when :get_bucket_ownership_controls
132
+ Aws::S3::Endpoints::GetBucketOwnershipControls.build(context)
133
+ when :get_bucket_policy
134
+ Aws::S3::Endpoints::GetBucketPolicy.build(context)
135
+ when :get_bucket_policy_status
136
+ Aws::S3::Endpoints::GetBucketPolicyStatus.build(context)
137
+ when :get_bucket_replication
138
+ Aws::S3::Endpoints::GetBucketReplication.build(context)
139
+ when :get_bucket_request_payment
140
+ Aws::S3::Endpoints::GetBucketRequestPayment.build(context)
141
+ when :get_bucket_tagging
142
+ Aws::S3::Endpoints::GetBucketTagging.build(context)
143
+ when :get_bucket_versioning
144
+ Aws::S3::Endpoints::GetBucketVersioning.build(context)
145
+ when :get_bucket_website
146
+ Aws::S3::Endpoints::GetBucketWebsite.build(context)
147
+ when :get_object
148
+ Aws::S3::Endpoints::GetObject.build(context)
149
+ when :get_object_acl
150
+ Aws::S3::Endpoints::GetObjectAcl.build(context)
151
+ when :get_object_attributes
152
+ Aws::S3::Endpoints::GetObjectAttributes.build(context)
153
+ when :get_object_legal_hold
154
+ Aws::S3::Endpoints::GetObjectLegalHold.build(context)
155
+ when :get_object_lock_configuration
156
+ Aws::S3::Endpoints::GetObjectLockConfiguration.build(context)
157
+ when :get_object_retention
158
+ Aws::S3::Endpoints::GetObjectRetention.build(context)
159
+ when :get_object_tagging
160
+ Aws::S3::Endpoints::GetObjectTagging.build(context)
161
+ when :get_object_torrent
162
+ Aws::S3::Endpoints::GetObjectTorrent.build(context)
163
+ when :get_public_access_block
164
+ Aws::S3::Endpoints::GetPublicAccessBlock.build(context)
165
+ when :head_bucket
166
+ Aws::S3::Endpoints::HeadBucket.build(context)
167
+ when :head_object
168
+ Aws::S3::Endpoints::HeadObject.build(context)
169
+ when :list_bucket_analytics_configurations
170
+ Aws::S3::Endpoints::ListBucketAnalyticsConfigurations.build(context)
171
+ when :list_bucket_intelligent_tiering_configurations
172
+ Aws::S3::Endpoints::ListBucketIntelligentTieringConfigurations.build(context)
173
+ when :list_bucket_inventory_configurations
174
+ Aws::S3::Endpoints::ListBucketInventoryConfigurations.build(context)
175
+ when :list_bucket_metrics_configurations
176
+ Aws::S3::Endpoints::ListBucketMetricsConfigurations.build(context)
177
+ when :list_buckets
178
+ Aws::S3::Endpoints::ListBuckets.build(context)
179
+ when :list_multipart_uploads
180
+ Aws::S3::Endpoints::ListMultipartUploads.build(context)
181
+ when :list_object_versions
182
+ Aws::S3::Endpoints::ListObjectVersions.build(context)
183
+ when :list_objects
184
+ Aws::S3::Endpoints::ListObjects.build(context)
185
+ when :list_objects_v2
186
+ Aws::S3::Endpoints::ListObjectsV2.build(context)
187
+ when :list_parts
188
+ Aws::S3::Endpoints::ListParts.build(context)
189
+ when :put_bucket_accelerate_configuration
190
+ Aws::S3::Endpoints::PutBucketAccelerateConfiguration.build(context)
191
+ when :put_bucket_acl
192
+ Aws::S3::Endpoints::PutBucketAcl.build(context)
193
+ when :put_bucket_analytics_configuration
194
+ Aws::S3::Endpoints::PutBucketAnalyticsConfiguration.build(context)
195
+ when :put_bucket_cors
196
+ Aws::S3::Endpoints::PutBucketCors.build(context)
197
+ when :put_bucket_encryption
198
+ Aws::S3::Endpoints::PutBucketEncryption.build(context)
199
+ when :put_bucket_intelligent_tiering_configuration
200
+ Aws::S3::Endpoints::PutBucketIntelligentTieringConfiguration.build(context)
201
+ when :put_bucket_inventory_configuration
202
+ Aws::S3::Endpoints::PutBucketInventoryConfiguration.build(context)
203
+ when :put_bucket_lifecycle
204
+ Aws::S3::Endpoints::PutBucketLifecycle.build(context)
205
+ when :put_bucket_lifecycle_configuration
206
+ Aws::S3::Endpoints::PutBucketLifecycleConfiguration.build(context)
207
+ when :put_bucket_logging
208
+ Aws::S3::Endpoints::PutBucketLogging.build(context)
209
+ when :put_bucket_metrics_configuration
210
+ Aws::S3::Endpoints::PutBucketMetricsConfiguration.build(context)
211
+ when :put_bucket_notification
212
+ Aws::S3::Endpoints::PutBucketNotification.build(context)
213
+ when :put_bucket_notification_configuration
214
+ Aws::S3::Endpoints::PutBucketNotificationConfiguration.build(context)
215
+ when :put_bucket_ownership_controls
216
+ Aws::S3::Endpoints::PutBucketOwnershipControls.build(context)
217
+ when :put_bucket_policy
218
+ Aws::S3::Endpoints::PutBucketPolicy.build(context)
219
+ when :put_bucket_replication
220
+ Aws::S3::Endpoints::PutBucketReplication.build(context)
221
+ when :put_bucket_request_payment
222
+ Aws::S3::Endpoints::PutBucketRequestPayment.build(context)
223
+ when :put_bucket_tagging
224
+ Aws::S3::Endpoints::PutBucketTagging.build(context)
225
+ when :put_bucket_versioning
226
+ Aws::S3::Endpoints::PutBucketVersioning.build(context)
227
+ when :put_bucket_website
228
+ Aws::S3::Endpoints::PutBucketWebsite.build(context)
229
+ when :put_object
230
+ Aws::S3::Endpoints::PutObject.build(context)
231
+ when :put_object_acl
232
+ Aws::S3::Endpoints::PutObjectAcl.build(context)
233
+ when :put_object_legal_hold
234
+ Aws::S3::Endpoints::PutObjectLegalHold.build(context)
235
+ when :put_object_lock_configuration
236
+ Aws::S3::Endpoints::PutObjectLockConfiguration.build(context)
237
+ when :put_object_retention
238
+ Aws::S3::Endpoints::PutObjectRetention.build(context)
239
+ when :put_object_tagging
240
+ Aws::S3::Endpoints::PutObjectTagging.build(context)
241
+ when :put_public_access_block
242
+ Aws::S3::Endpoints::PutPublicAccessBlock.build(context)
243
+ when :restore_object
244
+ Aws::S3::Endpoints::RestoreObject.build(context)
245
+ when :select_object_content
246
+ Aws::S3::Endpoints::SelectObjectContent.build(context)
247
+ when :upload_part
248
+ Aws::S3::Endpoints::UploadPart.build(context)
249
+ when :upload_part_copy
250
+ Aws::S3::Endpoints::UploadPartCopy.build(context)
251
+ when :write_get_object_response
252
+ Aws::S3::Endpoints::WriteGetObjectResponse.build(context)
253
+ end
254
+ end
255
+ end
256
+
257
+ def add_handlers(handlers, _config)
258
+ handlers.add(Handler, step: :build, priority: 75)
259
+ end
260
+ end
261
+ end
262
+ end
@@ -16,7 +16,8 @@ module Aws
16
16
 
17
17
  def call(context)
18
18
  body = context.http_request.body
19
- if body.respond_to?(:size) && body.size > 0
19
+ if body.respond_to?(:size) && body.size > 0 &&
20
+ !context[:use_accelerate_endpoint]
20
21
  context.http_request.headers['expect'] = '100-continue'
21
22
  end
22
23
  @handler.call(context)
@@ -16,35 +16,6 @@ Defaults to `legacy` mode which uses the global endpoint.
16
16
  resolve_iad_regional_endpoint(cfg)
17
17
  end
18
18
 
19
- def add_handlers(handlers, config)
20
- # only modify non-custom endpoints
21
- if config.regional_endpoint && config.region == 'us-east-1'
22
- handlers.add(Handler)
23
- end
24
- end
25
-
26
- # @api private
27
- class Handler < Seahorse::Client::Handler
28
-
29
- def call(context)
30
- # WriteGetObjectResponse does not have a global endpoint
31
- # ARNs are regionalized, so don't touch those either.
32
- if context.operation.name != 'WriteGetObjectResponse' &&
33
- context.config.s3_us_east_1_regional_endpoint == 'legacy' &&
34
- !context.metadata[:s3_arn]
35
- host = context.http_request.endpoint.host
36
- legacy_host = IADRegionalEndpoint.legacy_host(host)
37
- context.http_request.endpoint.host = legacy_host
38
- end
39
- @handler.call(context)
40
- end
41
-
42
- end
43
-
44
- def self.legacy_host(host)
45
- host.sub(".us-east-1", '')
46
- end
47
-
48
19
  private
49
20
 
50
21
  def self.resolve_iad_regional_endpoint(cfg)