aws-sdk-core 3.96.1 → 3.99.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afcb0729f94a2edafdcbfe1423107885abd5bc07965e98753b3597a465fb452a
4
- data.tar.gz: 10d861af75e3578631d668100f1a40aa80465bcd360bb385e650de7a90009918
3
+ metadata.gz: cf03bdc54ae7d2b3aaca392c246e2448afe60816e850b6f2389945be397a27f7
4
+ data.tar.gz: 0615a87c2daa9bc86e416d7403aedf6d934f5694dd1efda76d6821c0caa12ebd
5
5
  SHA512:
6
- metadata.gz: d1b97bea6a84793f511c3c4deddee0e5860ebdbd0af403be483cae0eced1f8309853d4f1b3c4a5dfd9d632aa7890fe0b39c5537c626688409114825b2306c5f5
7
- data.tar.gz: bb19558123d566cfd5739ea0022a90938c0e4853f955963d798c0a78b3fdf1e6ffb2b6964798a04321d7eeab456368d1dc00faf3b987e3cb879cba50ec83f4f8
6
+ metadata.gz: 8a9b4ba7e6cb3be4ab9fc0905a03162c5cc4b2d12509ebfb53eee3a0098f9f74ed0a5634df1f06f16a4101243c5c59c1e9aac2ed7d4f5ed90f1d068b30573856
7
+ data.tar.gz: f625151a68e124037dd2b0a42067a736b0562bebf975649721896d84460d4e830fad4a879d744ff45af39979f1fc75db5516ebc71b67150b412c8272afc90d01
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.96.1
1
+ 3.99.2
@@ -78,9 +78,9 @@ module Aws
78
78
 
79
79
  # locate event from eventstream
80
80
  name, ref = @rules.shape.member_by_location_name(event_type)
81
- unless ref.event
82
- raise Aws::Errors::EventStreamParserError.new(
83
- "Failed to locate event shape for the event")
81
+ unless ref && ref.event
82
+ return Struct.new(:event_type, :raw_event_type, :raw_event)
83
+ .new(:unknown_event, event_type, raw_event)
84
84
  end
85
85
 
86
86
  event = ref.shape.struct_class.new
@@ -208,12 +208,40 @@ module Aws
208
208
  # Raised when a client is constructed and region is not specified.
209
209
  class MissingRegionError < ArgumentError
210
210
  def initialize(*args)
211
- msg = 'missing region; use :region option or '\
212
- "export region name to ENV['AWS_REGION']"
211
+ msg = 'No region was provided. Configure the `:region` option or '\
212
+ "export the region name to ENV['AWS_REGION']"
213
213
  super(msg)
214
214
  end
215
215
  end
216
216
 
217
+ # Raised when a client is contsructed and the region is not valid.
218
+ class InvalidRegionError < ArgumentError
219
+ def initialize(*args)
220
+ super(<<-MSG)
221
+ Invalid `:region` option was provided.
222
+
223
+ * Not every service is available in every region.
224
+
225
+ * Never suffix region names with availability zones.
226
+ Use "us-east-1", not "us-east-1a"
227
+
228
+ Known AWS regions include (not specific to this service):
229
+
230
+ #{possible_regions}
231
+ MSG
232
+ end
233
+
234
+ private
235
+
236
+ def possible_regions
237
+ Aws.partitions.each_with_object([]) do |partition, region_names|
238
+ partition.regions.each do |region|
239
+ region_names << region.name
240
+ end
241
+ end.join("\n")
242
+ end
243
+ end
244
+
217
245
  # Raised when attempting to connect to an endpoint and a `SocketError`
218
246
  # is received from the HTTP client. This error is typically the result
219
247
  # of configuring an invalid `:region`.
@@ -226,7 +254,7 @@ module Aws
226
254
  super(<<-MSG)
227
255
  Encountered a `SocketError` while attempting to connect to:
228
256
 
229
- #{endpoint.to_s}
257
+ #{endpoint}
230
258
 
231
259
  This is typically the result of an invalid `:region` option or a
232
260
  poorly formatted `:endpoint` option.
@@ -255,14 +283,12 @@ Known AWS regions include (not specific to this service):
255
283
  private
256
284
 
257
285
  def possible_regions
258
- Aws.partitions.inject([]) do |region_names, partition|
286
+ Aws.partitions.each_with_object([]) do |partition, region_names|
259
287
  partition.regions.each do |region|
260
288
  region_names << region.name
261
289
  end
262
- region_names
263
290
  end.join("\n")
264
291
  end
265
-
266
292
  end
267
293
 
268
294
  # Raised when attempting to retry a request
@@ -11,7 +11,7 @@ module Aws
11
11
  #
12
12
  # @api private
13
13
  # begin
14
- SENSITIVE = [:access_token, :account_name, :account_password, :address, :admin_contact, :admin_password, :alexa_for_business_room_arn, :artifact_credentials, :auth_code, :authentication_token, :authorization_result, :backup_plan_tags, :backup_vault_tags, :base_32_string_seed, :block, :block_address, :block_data, :blocks, :body, :bot_configuration, :bot_email, :calling_name, :cause, :client_id, :client_request_token, :client_secret, :comment, :configuration, :copy_source_sse_customer_key, :credentials, :current_password, :custom_attributes, :custom_private_key, :db_password, :default_phone_number, :definition, :description, :destination_access_token, :digest_tip_address, :display_name, :domain_signing_private_key, :e164_phone_number, :email, :email_address, :email_message, :embed_url, :error, :external_meeting_id, :external_model_endpoint_data_blobs, :external_user_id, :fall_back_phone_number, :feedback_token, :file, :first_name, :full_name, :host_key, :id, :id_token, :input, :input_text, :ion_text, :join_token, :key, :key_id, :key_material, :key_store_password, :kms_key_id, :kms_master_key_id, :lambda_function_arn, :last_name, :local_console_password, :master_account_email, :master_user_name, :master_user_password, :meeting_host_id, :message, :metadata, :name, :new_password, :next_password, :notes, :number, :old_password, :outbound_events_https_endpoint, :output, :owner_information, :parameters, :passphrase, :password, :payload, :phone_number, :plaintext, :previous_password, :primary_email, :primary_provisioned_number, :private_key, :private_key_plaintext, :proof, :proposed_password, :proxy_phone_number, :public_key, :qr_code_png, :query, :random_password, :recovery_point_tags, :refresh_token, :registrant_contact, :request_attributes, :resource_arn, :restore_metadata, :revision, :saml_assertion, :search_query, :secret_access_key, :secret_binary, :secret_code, :secret_hash, :secret_string, :secret_to_authenticate_initiator, :secret_to_authenticate_target, :security_token, :service_password, :session_attributes, :session_token, :share_notes, :shared_secret, :slots, :sns_topic_arn, :source_access_token, :sqs_queue_arn, :sse_customer_key, :ssekms_encryption_context, :ssekms_key_id, :status_message, :tag_key_list, :tags, :target_address, :task_parameters, :tech_contact, :temporary_password, :text, :token, :trust_password, :type, :upload_credentials, :upload_url, :uri, :user_data, :user_email, :user_name, :user_password, :username, :value, :values, :variables, :vpn_psk, :web_identity_token, :zip_file]
14
+ SENSITIVE = [:access_token, :account_name, :account_password, :address, :admin_contact, :admin_password, :alexa_for_business_room_arn, :artifact_credentials, :auth_code, :authentication_token, :authorization_result, :backup_plan_tags, :backup_vault_tags, :base_32_string_seed, :block, :block_address, :block_data, :blocks, :body, :bot_configuration, :bot_email, :calling_name, :cause, :client_id, :client_request_token, :client_secret, :comment, :configuration, :content, :copy_source_sse_customer_key, :credentials, :current_password, :custom_attributes, :custom_private_key, :db_password, :default_phone_number, :definition, :description, :destination_access_token, :digest_tip_address, :display_name, :domain_signing_private_key, :e164_phone_number, :email, :email_address, :email_message, :embed_url, :error, :external_meeting_id, :external_model_endpoint_data_blobs, :external_user_id, :fall_back_phone_number, :feedback_token, :file, :filter_expression, :first_name, :full_name, :host_key, :id, :id_token, :input, :input_text, :ion_text, :join_token, :key, :key_id, :key_material, :key_store_password, :kms_key_id, :kms_master_key_id, :lambda_function_arn, :last_name, :local_console_password, :master_account_email, :master_user_name, :master_user_password, :meeting_host_id, :message, :metadata, :name, :new_password, :next_password, :notes, :number, :old_password, :outbound_events_https_endpoint, :output, :owner_information, :parameters, :passphrase, :password, :payload, :phone_number, :plaintext, :previous_password, :primary_email, :primary_provisioned_number, :private_key, :private_key_plaintext, :proof, :proposed_password, :proxy_phone_number, :public_key, :qr_code_png, :query, :random_password, :recovery_point_tags, :refresh_token, :registrant_contact, :request_attributes, :resource_arn, :restore_metadata, :revision, :saml_assertion, :search_query, :secret_access_key, :secret_binary, :secret_code, :secret_hash, :secret_string, :secret_to_authenticate_initiator, :secret_to_authenticate_target, :security_token, :service_password, :session_attributes, :session_token, :share_notes, :shared_secret, :slots, :sns_topic_arn, :source_access_token, :sqs_queue_arn, :sse_customer_key, :ssekms_encryption_context, :ssekms_key_id, :status_message, :tag_key_list, :tags, :target_address, :task_parameters, :tech_contact, :temporary_password, :text, :token, :trust_password, :type, :upload_credentials, :upload_url, :uri, :user_data, :user_email, :user_name, :user_password, :username, :value, :values, :variables, :vpn_psk, :web_identity_token, :zip_file]
15
15
  # end
16
16
 
17
17
  def initialize(options = {})
@@ -4,10 +4,10 @@ module Aws
4
4
  class EndpointDiscovery < Seahorse::Client::Plugin
5
5
 
6
6
  option(:endpoint_discovery,
7
- default: false,
7
+ doc_default: Proc.new { |options| options[:require_endpoint_discovery] },
8
8
  doc_type: 'Boolean',
9
9
  docstring: <<-DOCS) do |cfg|
10
- When set to `true`, endpoint discovery will be enabled for operations when available. Defaults to `false`.
10
+ When set to `true`, endpoint discovery will be enabled for operations when available.
11
11
  DOCS
12
12
  resolve_endpoint_discovery(cfg)
13
13
  end
@@ -102,6 +102,10 @@ the background every 60 secs (default). Defaults to `false`.
102
102
  key = cache.extract_key(ctx)
103
103
 
104
104
  if required
105
+ unless ctx.config.endpoint_discovery
106
+ raise ArgumentError, "Operation #{ctx.operation.name} requires "\
107
+ 'endpoint_discovery to be enabled.'
108
+ end
105
109
  # required for the operation
106
110
  unless cache.key?(key)
107
111
  cache.update(key, ctx)
@@ -151,8 +155,10 @@ the background every 60 secs (default). Defaults to `false`.
151
155
 
152
156
  def self.resolve_endpoint_discovery(cfg)
153
157
  env = ENV['AWS_ENABLE_ENDPOINT_DISCOVERY']
158
+ default = cfg.api.require_endpoint_discovery
154
159
  shared_cfg = Aws.shared_config.endpoint_discovery_enabled(profile: cfg.profile)
155
- Aws::Util.str_2_bool(env) || Aws::Util.str_2_bool(shared_cfg)
160
+ resolved = Aws::Util.str_2_bool(env) || Aws::Util.str_2_bool(shared_cfg)
161
+ env.nil? && shared_cfg.nil? ? default : !!resolved
156
162
  end
157
163
 
158
164
  end
@@ -0,0 +1,55 @@
1
+ require 'openssl'
2
+
3
+ module Aws
4
+ module Plugins
5
+ # @api private
6
+ class HttpChecksum < Seahorse::Client::Plugin
7
+ # @api private
8
+ class Handler < Seahorse::Client::Handler
9
+ CHUNK_SIZE = 1 * 1024 * 1024 # one MB
10
+
11
+ def call(context)
12
+ if context.operation.http_checksum_required
13
+ body = context.http_request.body
14
+ context.http_request.headers['Content-Md5'] ||= md5(body)
15
+ end
16
+ @handler.call(context)
17
+ end
18
+
19
+ private
20
+
21
+ # @param [File, Tempfile, IO#read, String] value
22
+ # @return [String<MD5>]
23
+ def md5(value)
24
+ if (value.is_a?(File) || value.is_a?(Tempfile)) &&
25
+ !value.path.nil? && File.exist?(value.path)
26
+ OpenSSL::Digest::MD5.file(value).base64digest
27
+ elsif value.respond_to?(:read)
28
+ md5 = OpenSSL::Digest::MD5.new
29
+ update_in_chunks(md5, value)
30
+ md5.base64digest
31
+ else
32
+ OpenSSL::Digest::MD5.digest(value).base64digest
33
+ end
34
+ end
35
+
36
+ def update_in_chunks(digest, io)
37
+ loop do
38
+ chunk = io.read(CHUNK_SIZE)
39
+ break unless chunk
40
+ digest.update(chunk)
41
+ end
42
+ io.rewind
43
+ end
44
+
45
+ end
46
+
47
+ def add_handlers(handlers, _config)
48
+ # priority set low to ensure checksum is computed AFTER the request is
49
+ # built but before it is signed
50
+ handlers.add(Handler, priority: 10, step: :build)
51
+ end
52
+
53
+ end
54
+ end
55
+ end
@@ -2,10 +2,6 @@ module Aws
2
2
  module Plugins
3
3
  # @api private
4
4
  class RegionalEndpoint < Seahorse::Client::Plugin
5
-
6
- # raised when region is not configured
7
- MISSING_REGION = 'missing required configuration option :region'
8
-
9
5
  option(:profile)
10
6
 
11
7
  option(:region,
@@ -31,13 +27,19 @@ a default `:region` is searched for in the following locations:
31
27
  option(:endpoint, doc_type: String, docstring: <<-DOCS) do |cfg|
32
28
  The client endpoint is normally constructed from the `:region`
33
29
  option. You should only configure an `:endpoint` when connecting
34
- to test endpoints. This should be a valid HTTP(S) URI.
30
+ to test or custom endpoints. This should be a valid HTTP(S) URI.
35
31
  DOCS
36
32
  endpoint_prefix = cfg.api.metadata['endpointPrefix']
37
33
  if cfg.region && endpoint_prefix
38
34
  if cfg.respond_to?(:sts_regional_endpoints)
39
35
  sts_regional = cfg.sts_regional_endpoints
40
36
  end
37
+
38
+ # check region is a valid RFC host label
39
+ unless cfg.region =~ /^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{,63}(?<!-)$/
40
+ raise Errors::InvalidRegionError
41
+ end
42
+
41
43
  Aws::Partitions::EndpointProvider.resolve(
42
44
  cfg.region,
43
45
  endpoint_prefix,
@@ -47,21 +49,22 @@ to test endpoints. This should be a valid HTTP(S) URI.
47
49
  end
48
50
 
49
51
  def after_initialize(client)
50
- if client.config.region.nil? or client.config.region == ''
52
+ if client.config.region.nil? || client.config.region == ''
51
53
  raise Errors::MissingRegionError
52
54
  end
53
55
  end
54
56
 
55
- private
57
+ class << self
58
+ private
56
59
 
57
- def self.resolve_region(cfg)
58
- keys = %w(AWS_REGION AMAZON_REGION AWS_DEFAULT_REGION)
59
- env_region = ENV.values_at(*keys).compact.first
60
- env_region = nil if env_region == ''
61
- cfg_region = Aws.shared_config.region(profile: cfg.profile)
62
- env_region || cfg_region
60
+ def resolve_region(cfg)
61
+ keys = %w[AWS_REGION AMAZON_REGION AWS_DEFAULT_REGION]
62
+ env_region = ENV.values_at(*keys).compact.first
63
+ env_region = nil if env_region == ''
64
+ cfg_region = Aws.shared_config.region(profile: cfg.profile)
65
+ env_region || cfg_region
66
+ end
63
67
  end
64
-
65
68
  end
66
69
  end
67
70
  end
@@ -174,7 +174,7 @@ a clock skew correction and retry requests with skewed client clocks.
174
174
  end
175
175
 
176
176
  def self.resolve_max_attempts(cfg)
177
- value = ENV['AWS_MAX_ATTEMPTS'] ||
177
+ value = (ENV['AWS_MAX_ATTEMPTS'] && ENV['AWS_MAX_ATTEMPTS'].to_i) ||
178
178
  Aws.shared_config.max_attempts(profile: cfg.profile) ||
179
179
  3
180
180
  # Raise if provided value is not a positive integer
@@ -190,7 +190,6 @@ a clock skew correction and retry requests with skewed client clocks.
190
190
  value = ENV['AWS_ADAPTIVE_RETRY_WAIT_TO_FILL'] ||
191
191
  Aws.shared_config.adaptive_retry_wait_to_fill(profile: cfg.profile) ||
192
192
  'true'
193
-
194
193
  # Raise if provided value is not true or false
195
194
  if value != 'true' && value != 'false'
196
195
  raise ArgumentError,
@@ -198,7 +197,6 @@ a clock skew correction and retry requests with skewed client clocks.
198
197
  'adaptive_retry_wait_to_fill profile option or for '\
199
198
  'ENV[\'AWS_ADAPTIVE_RETRY_WAIT_TO_FILL\']'
200
199
  end
201
-
202
200
  value == 'true'
203
201
  end
204
202
 
@@ -206,7 +204,6 @@ a clock skew correction and retry requests with skewed client clocks.
206
204
  value = ENV['AWS_CORRECT_CLOCK_SKEW'] ||
207
205
  Aws.shared_config.correct_clock_skew(profile: cfg.profile) ||
208
206
  'true'
209
-
210
207
  # Raise if provided value is not true or false
211
208
  if value != 'true' && value != 'false'
212
209
  raise ArgumentError,
@@ -214,7 +211,6 @@ a clock skew correction and retry requests with skewed client clocks.
214
211
  'correct_clock_skew profile option or for '\
215
212
  'ENV[\'AWS_CORRECT_CLOCK_SKEW\']'
216
213
  end
217
-
218
214
  value == 'true'
219
215
  end
220
216
 
@@ -43,7 +43,7 @@ module Aws
43
43
  def build_body(api, operation, data)
44
44
  rules = operation.output
45
45
  if head_operation(operation)
46
- ""
46
+ ''
47
47
  elsif streaming?(rules)
48
48
  data[rules[:payload]]
49
49
  elsif rules[:payload]
@@ -73,7 +73,7 @@ module Aws
73
73
  end
74
74
 
75
75
  def head_operation(operation)
76
- operation.http_method == "HEAD"
76
+ operation.http_method == 'HEAD'
77
77
  end
78
78
 
79
79
  def eventstream?(rules)
@@ -116,8 +116,22 @@ module Aws
116
116
  opts
117
117
  end
118
118
 
119
- def encode_event(opts, rules, event_data, builder)
120
- event_ref = rules.shape.member(event_data.delete(:event_type))
119
+ def encode_unknown_event(opts, event_type, event_data)
120
+ # right now h2 events are only rest_json
121
+ opts[:payload] = StringIO.new(JSON.dump(event_data))
122
+ opts[:headers][':event-type'] = Aws::EventStream::HeaderValue.new(
123
+ value: event_type.to_s,
124
+ type: 'string'
125
+ )
126
+ opts[:headers][':message-type'] = Aws::EventStream::HeaderValue.new(
127
+ value: 'event',
128
+ type: 'string'
129
+ )
130
+ opts
131
+ end
132
+
133
+ def encode_modeled_event(opts, rules, event_type, event_data, builder)
134
+ event_ref = rules.shape.member(event_type)
121
135
  explicit_payload = false
122
136
  implicit_payload_members = {}
123
137
  event_ref.shape.members.each do |name, ref|
@@ -166,6 +180,16 @@ module Aws
166
180
  opts
167
181
  end
168
182
 
183
+ def encode_event(opts, rules, event_data, builder)
184
+ event_type = event_data.delete(:event_type)
185
+
186
+ if rules.shape.member?(event_type)
187
+ encode_modeled_event(opts, rules, event_type, event_data, builder)
188
+ else
189
+ encode_unknown_event(opts, event_type, event_data)
190
+ end
191
+ end
192
+
169
193
  end
170
194
  end
171
195
  end
@@ -43,6 +43,6 @@ require_relative 'aws-sdk-sts/customizations'
43
43
  # @service
44
44
  module Aws::STS
45
45
 
46
- GEM_VERSION = '3.96.1'
46
+ GEM_VERSION = '3.99.2'
47
47
 
48
48
  end
@@ -24,6 +24,7 @@ require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
24
24
  require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
25
25
  require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
26
26
  require 'aws-sdk-core/plugins/transfer_encoding.rb'
27
+ require 'aws-sdk-core/plugins/http_checksum.rb'
27
28
  require 'aws-sdk-core/plugins/signature_v4.rb'
28
29
  require 'aws-sdk-core/plugins/protocols/query.rb'
29
30
  require 'aws-sdk-sts/plugins/sts_regional_endpoints.rb'
@@ -70,6 +71,7 @@ module Aws::STS
70
71
  add_plugin(Aws::Plugins::ClientMetricsPlugin)
71
72
  add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
72
73
  add_plugin(Aws::Plugins::TransferEncoding)
74
+ add_plugin(Aws::Plugins::HttpChecksum)
73
75
  add_plugin(Aws::Plugins::SignatureV4)
74
76
  add_plugin(Aws::Plugins::Protocols::Query)
75
77
  add_plugin(Aws::STS::Plugins::STSRegionalEndpoints)
@@ -163,7 +165,7 @@ module Aws::STS
163
165
  # @option options [String] :endpoint
164
166
  # The client endpoint is normally constructed from the `:region`
165
167
  # option. You should only configure an `:endpoint` when connecting
166
- # to test endpoints. This should be a valid HTTP(S) URI.
168
+ # to test or custom endpoints. This should be a valid HTTP(S) URI.
167
169
  #
168
170
  # @option options [Integer] :endpoint_cache_max_entries (1000)
169
171
  # Used for the maximum size limit of the LRU cache storing endpoints data
@@ -178,7 +180,7 @@ module Aws::STS
178
180
  # requests fetching endpoints information. Defaults to 60 sec.
179
181
  #
180
182
  # @option options [Boolean] :endpoint_discovery (false)
181
- # When set to `true`, endpoint discovery will be enabled for operations when available. Defaults to `false`.
183
+ # When set to `true`, endpoint discovery will be enabled for operations when available.
182
184
  #
183
185
  # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
184
186
  # The log formatter.
@@ -2185,7 +2187,7 @@ module Aws::STS
2185
2187
  params: params,
2186
2188
  config: config)
2187
2189
  context[:gem_name] = 'aws-sdk-core'
2188
- context[:gem_version] = '3.96.1'
2190
+ context[:gem_version] = '3.99.2'
2189
2191
  Seahorse::Client::Request.new(handlers, context)
2190
2192
  end
2191
2193
 
@@ -11,6 +11,7 @@ module Seahorse
11
11
  # @return [Integer]
12
12
  def write(chunk)
13
13
  @block.call(chunk)
14
+ ensure
14
15
  chunk.bytesize.tap { |chunk_size| @size += chunk_size }
15
16
  end
16
17
 
@@ -53,7 +53,7 @@ module Seahorse
53
53
  # For backwards-compat reasons, the default value can be passed as 2nd
54
54
  # positional argument (before the options hash) or as the `:default` option
55
55
  # in the options hash.
56
- if Hash === default
56
+ if default.is_a? Hash
57
57
  options = default
58
58
  else
59
59
  options[:default] = default
@@ -123,11 +123,11 @@ module Seahorse
123
123
  attr_writer :doc_default
124
124
  attr_accessor :docstring
125
125
 
126
- def doc_default
126
+ def doc_default(options)
127
127
  if @doc_default.nil? && !default.is_a?(Proc)
128
128
  default
129
129
  else
130
- @doc_default
130
+ @doc_default.respond_to?(:call) ? @doc_default.call(options) : @doc_default
131
131
  end
132
132
  end
133
133
 
@@ -9,8 +9,8 @@ module Seahorse
9
9
  Normally you should not configure the `:endpoint` option
10
10
  directly. This is normally constructed from the `:region`
11
11
  option. Configuring `:endpoint` is normally reserved for
12
- connecting to test endpoints. The endpoint should be a URI
13
- formatted like:
12
+ connecting to test or custom endpoints. The endpoint should
13
+ be a URI formatted like:
14
14
 
15
15
  'http://example.com'
16
16
  'https://example.com'
@@ -28,7 +28,13 @@ module Seahorse
28
28
  def add_event_listeners(context, target)
29
29
  handler = self
30
30
  context.http_response.on_headers(200..299) do
31
- context.http_response.body = handler.send(:io, target)
31
+ # In a fresh response body will be a StringIO
32
+ # However, when a request is retried we may have
33
+ # an existing ManagedFile or BlockIO and those
34
+ # should be reused.
35
+ if context.http_response.body.is_a? StringIO
36
+ context.http_response.body = handler.send(:io, target)
37
+ end
32
38
  end
33
39
 
34
40
  context.http_response.on_success(200..299) do
@@ -40,15 +46,18 @@ module Seahorse
40
46
 
41
47
  context.http_response.on_error do
42
48
  body = context.http_response.body
43
- File.unlink(body) if ManagedFile === body
49
+
50
+ # When using response_target of file we do not want to write
51
+ # error messages to the file. So set the body to a new StringIO
52
+ if body.is_a? ManagedFile
53
+ File.unlink(body)
54
+ context.http_response.body = StringIO.new
55
+ end
56
+
44
57
  # Aws::S3::Encryption::DecryptHandler (with lower priority)
45
58
  # has callbacks registered after ResponseTarget::Handler,
46
59
  # where http_response.body is an IODecrypter
47
- # and has error callbacks handling for it.
48
- # Thus avoid early remove of IODecrypter at ResponseTarget::Handler
49
- unless context.http_response.body.respond_to?(:io)
50
- context.http_response.body = StringIO.new
51
- end
60
+ # and has error callbacks handling for it so no action is required here
52
61
  end
53
62
  end
54
63
 
@@ -7,6 +7,7 @@ module Seahorse
7
7
  @operations = {}
8
8
  @authorizers = {}
9
9
  @endpoint_operation = nil
10
+ @require_endpoint_discovery = false
10
11
  end
11
12
 
12
13
  # @return [String, nil]
@@ -18,6 +19,9 @@ module Seahorse
18
19
  # @return [Symbol|nil]
19
20
  attr_accessor :endpoint_operation
20
21
 
22
+ # @return [Boolean|nil]
23
+ attr_accessor :require_endpoint_discovery
24
+
21
25
  def operations(&block)
22
26
  if block_given?
23
27
  @operations.each(&block)
@@ -20,6 +20,9 @@ module Seahorse
20
20
  # @return [String]
21
21
  attr_accessor :http_request_uri
22
22
 
23
+ # @return [Boolean]
24
+ attr_accessor :http_checksum_required
25
+
23
26
  # @return [Boolean]
24
27
  attr_accessor :deprecated
25
28
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.96.1
4
+ version: 3.99.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-18 00:00:00.000000000 Z
11
+ date: 2020-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath
@@ -141,6 +141,7 @@ files:
141
141
  - lib/aws-sdk-core/plugins/event_stream_configuration.rb
142
142
  - lib/aws-sdk-core/plugins/global_configuration.rb
143
143
  - lib/aws-sdk-core/plugins/helpful_socket_errors.rb
144
+ - lib/aws-sdk-core/plugins/http_checksum.rb
144
145
  - lib/aws-sdk-core/plugins/idempotency_token.rb
145
146
  - lib/aws-sdk-core/plugins/invocation_id.rb
146
147
  - lib/aws-sdk-core/plugins/jsonvalue_converter.rb