aws-sdk-core 3.102.1 → 3.104.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43b48314641e07e1c8d17537972bd1178d7851ffc7a60f3b9c7fa86ecc33be6b
4
- data.tar.gz: 36fd057632f75e6cff2096fcf10da6b9c1d8d5fc00f23282bbc1ad3e6f7dead8
3
+ metadata.gz: 7357ce5a3cd95241ed7e567a86b6f3e9edbfd324124b0cab96116b20f41197a6
4
+ data.tar.gz: 8b255e4d03b48ff6cdf80167e3a115085b09aac23323f891daf305c93d3f7fb6
5
5
  SHA512:
6
- metadata.gz: a3c31d85b96159bd3ab68c23263e8bbb864f0ce4ae4365c8fa7300bd5aa0ffec8d361e4b933f5e2f93a9235af3a2094ee0de96de3a359038c06e71735a7d3c22
7
- data.tar.gz: fe40d202c4a8eca29230892b597ac481af2fdc74d1f20e66180157afd92ac41245c5c1b0abb41dd25e2f6f2037da9e4a373af56058dd80f1c9670b5edd2aad2d
6
+ metadata.gz: 57822a88212cd847c75ed5d0bd958962a3559ec92330e46eea7ab2b7a13fcf2d8fbeea3e0dc87f4beffa6ecdf5f2e17b15985781d720caf5eff803decf53284c
7
+ data.tar.gz: 674a1b2b308b44f32ea037878292c9ea621c8734559acdcfde7b7008bb48bd1be183c4c29899cbed0d9355555e2801fdaffd5d52bf3a18c7d32c83c7f6785f72
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.102.1
1
+ 3.104.3
@@ -6,9 +6,9 @@ require 'set'
6
6
  module Aws
7
7
  module Log
8
8
  class ParamFilter
9
- # DEPRECATED - this must exist for backwards compatibility. Sensitive
9
+ # DEPRECATED - This must exist for backwards compatibility. Sensitive
10
10
  # members are now computed for each request/response type. This can be
11
- # removed in a new major version.
11
+ # removed in a new major version. This list is no longer updated.
12
12
  #
13
13
  # A managed list of sensitive parameters that should be filtered from
14
14
  # logs. This is updated automatically as part of each release. See the
@@ -16,7 +16,7 @@ module Aws
16
16
  #
17
17
  # @api private
18
18
  # begin
19
- SENSITIVE = [:access_token, :account_name, :account_password, :address, :admin_contact, :admin_password, :alexa_for_business_room_arn, :artifact_credentials, :auth_code, :auth_parameters, :authentication_token, :authorization_result, :backup_plan_tags, :backup_vault_tags, :base_32_string_seed, :basic_auth_credentials, :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, :oauth_token, :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]
19
+ SENSITIVE = [:access_token, :account_name, :account_password, :address, :admin_contact, :admin_password, :alexa_for_business_room_arn, :artifact_credentials, :auth_code, :auth_parameters, :authentication_token, :authorization_result, :backup_plan_tags, :backup_vault_tags, :base_32_string_seed, :basic_auth_credentials, :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, :emergency_phone_number, :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, :oauth_token, :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, :test_phone_number, :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]
20
20
  # end
21
21
 
22
22
  def initialize(options = {})
@@ -1,14 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aws
4
-
5
4
  # Decorates a {Seahorse::Client::Response} with paging convenience methods.
6
5
  # Some AWS calls provide paged responses to limit the amount of data returned
7
- # with each response. To optimize for latency, some APIs may return an
8
- # inconsistent number of responses per page. You should rely on the values of
9
- # the `next_page?` method or using enumerable methods such as `each`
10
- # rather than the number of items returned to iterate through results.
11
- # See below for examples.
6
+ # with each response. To optimize for latency, some APIs may return an
7
+ # inconsistent number of responses per page. You should rely on the values of
8
+ # the `next_page?` method or using enumerable methods such as `each` rather
9
+ # than the number of items returned to iterate through results. See below for
10
+ # examples.
11
+ #
12
+ # @note Methods such as `to_json` will enumerate all of the responses before
13
+ # returning the full response as JSON.
12
14
  #
13
15
  # # Paged Responses Are Enumerable
14
16
  # The simplest way to handle paged response data is to use the built-in
@@ -143,8 +143,22 @@ module Aws
143
143
  errors << expected_got(context, "true or false", value)
144
144
  end
145
145
  when BlobShape
146
- unless value.is_a?(String) || io_like?(value)
147
- errors << expected_got(context, "a String or IO object", value)
146
+ unless value.is_a?(String)
147
+ if streaming_input?(ref)
148
+ unless io_like?(value, _require_size = false)
149
+ errors << expected_got(
150
+ context,
151
+ "a String or IO like object that supports read and rewind",
152
+ value
153
+ )
154
+ end
155
+ elsif !io_like?(value, _require_size = true)
156
+ errors << expected_got(
157
+ context,
158
+ "a String or IO like object that supports read, rewind, and size",
159
+ value
160
+ )
161
+ end
148
162
  end
149
163
  else
150
164
  raise "unhandled shape type: #{ref.shape.class.name}"
@@ -167,8 +181,13 @@ module Aws
167
181
  end
168
182
  end
169
183
 
170
- def io_like?(value)
171
- value.respond_to?(:read) && value.respond_to?(:rewind)
184
+ def io_like?(value, require_size = true)
185
+ value.respond_to?(:read) && value.respond_to?(:rewind) &&
186
+ (!require_size || value.respond_to?(:size))
187
+ end
188
+
189
+ def streaming_input?(ref)
190
+ (ref["streaming"] || ref.shape["streaming"])
172
191
  end
173
192
 
174
193
  def error_messages(errors)
@@ -23,7 +23,9 @@ When provided, `x-api-key` header will be injected with the value provided.
23
23
  class OptionHandler < Seahorse::Client::Handler
24
24
  def call(context)
25
25
  if context.operation.require_apikey
26
- api_key = context.params.delete(:api_key)
26
+ if context.params.is_a?(Hash) && context.params[:api_key]
27
+ api_key = context.params.delete(:api_key)
28
+ end
27
29
  api_key = context.config.api_key if api_key.nil?
28
30
  context[:api_key] = api_key
29
31
  end
@@ -40,6 +40,8 @@ requests are made, and retries are disabled.
40
40
  client.handlers.remove(ClientMetricsPlugin::Handler)
41
41
  client.handlers.remove(ClientMetricsSendPlugin::LatencyHandler)
42
42
  client.handlers.remove(ClientMetricsSendPlugin::AttemptHandler)
43
+ client.handlers.remove(Seahorse::Client::Plugins::RequestCallback::OptionHandler)
44
+ client.handlers.remove(Seahorse::Client::Plugins::RequestCallback::ReadCallbackHandler)
43
45
  end
44
46
  end
45
47
 
@@ -45,6 +45,6 @@ require_relative 'aws-sdk-sts/customizations'
45
45
  # @service
46
46
  module Aws::STS
47
47
 
48
- GEM_VERSION = '3.102.1'
48
+ GEM_VERSION = '3.104.3'
49
49
 
50
50
  end
@@ -2189,7 +2189,7 @@ module Aws::STS
2189
2189
  params: params,
2190
2190
  config: config)
2191
2191
  context[:gem_name] = 'aws-sdk-core'
2192
- context[:gem_version] = '3.102.1'
2192
+ context[:gem_version] = '3.104.3'
2193
2193
  Seahorse::Client::Request.new(handlers, context)
2194
2194
  end
2195
2195
 
@@ -50,6 +50,7 @@ require_relative 'seahorse/client/plugins/net_http'
50
50
  require_relative 'seahorse/client/plugins/h2'
51
51
  require_relative 'seahorse/client/plugins/raise_response_errors'
52
52
  require_relative 'seahorse/client/plugins/response_target'
53
+ require_relative 'seahorse/client/plugins/request_callback'
53
54
 
54
55
  # model
55
56
 
@@ -14,6 +14,7 @@ module Seahorse
14
14
  Plugins::NetHttp,
15
15
  Plugins::RaiseResponseErrors,
16
16
  Plugins::ResponseTarget,
17
+ Plugins::RequestCallback
17
18
  ])
18
19
 
19
20
  # @api private
@@ -4,7 +4,8 @@ module Seahorse
4
4
  module Client
5
5
  class BlockIO
6
6
 
7
- def initialize(&block)
7
+ def initialize(headers = nil, &block)
8
+ @headers = headers
8
9
  @block = block
9
10
  @size = 0
10
11
  end
@@ -12,7 +13,7 @@ module Seahorse
12
13
  # @param [String] chunk
13
14
  # @return [Integer]
14
15
  def write(chunk)
15
- @block.call(chunk)
16
+ @block.call(chunk, @headers)
16
17
  ensure
17
18
  chunk.bytesize.tap { |chunk_size| @size += chunk_size }
18
19
  end
@@ -73,7 +73,7 @@ module Seahorse
73
73
 
74
74
  # Completes the http response.
75
75
  #
76
- # @example Completing the response in a singal call
76
+ # @example Completing the response in a single call
77
77
  #
78
78
  # http_response.signal_done(
79
79
  # status_code: 200,
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'pathname'
4
+ require 'forwardable'
5
+
6
+ module Seahorse
7
+ module Client
8
+ module Plugins
9
+
10
+ # @api private
11
+ class ReadCallbackIO
12
+ extend Forwardable
13
+ def_delegators :@io, :size
14
+
15
+ def initialize(io, on_read = nil)
16
+ @io = io
17
+ @on_read = on_read if on_read.is_a? Proc
18
+ @bytes_read = 0
19
+
20
+ # Some IO objects support readpartial - IO.copy_stream used by the
21
+ # request will call readpartial if available, so define a wrapper
22
+ # for it if the underlying IO supports it.
23
+ if @io.respond_to?(:readpartial)
24
+ def self.readpartial(*args)
25
+ @io.readpartial(*args).tap do |chunk|
26
+ handle_chunk(chunk)
27
+ end
28
+ end
29
+ end
30
+ end
31
+
32
+ attr_reader :io
33
+
34
+ def read(*args)
35
+ @io.read(*args).tap do |chunk|
36
+ handle_chunk(chunk)
37
+ end
38
+ end
39
+
40
+ private
41
+
42
+ def handle_chunk(chunk)
43
+ @bytes_read += chunk.bytesize if chunk && chunk.respond_to?(:bytesize)
44
+ total_size = @io.respond_to?(:size) ? @io.size : nil
45
+ @on_read.call(chunk, @bytes_read, total_size) if @on_read
46
+ end
47
+ end
48
+
49
+ # @api private
50
+ class RequestCallback < Plugin
51
+
52
+ option(
53
+ :on_chunk_sent,
54
+ default: nil,
55
+ doc_type: 'Proc',
56
+ docstring: <<-DOCS)
57
+ When a Proc object is provided, it will be used as callback when each chunk
58
+ of the request body is sent. It provides three arguments: the chunk,
59
+ the number of bytes read from the body, and the total number of
60
+ bytes in the body.
61
+ DOCS
62
+
63
+ # @api private
64
+ class OptionHandler < Client::Handler
65
+ def call(context)
66
+ if context.params.is_a?(Hash) && context.params[:on_chunk_sent]
67
+ on_chunk_sent = context.params.delete(:on_chunk_sent)
68
+ end
69
+ on_chunk_sent = context.config.on_chunk_sent if on_chunk_sent.nil?
70
+ context[:on_chunk_sent] = on_chunk_sent if on_chunk_sent
71
+ @handler.call(context)
72
+ end
73
+ end
74
+
75
+ # @api private
76
+ class ReadCallbackHandler < Client::Handler
77
+ def call(context)
78
+ if (callback = context[:on_chunk_sent])
79
+ context.http_request.body = ReadCallbackIO.new(
80
+ context.http_request.body,
81
+ callback
82
+ )
83
+ add_event_listeners(context)
84
+ end
85
+ @handler.call(context)
86
+ end
87
+
88
+ def add_event_listeners(context)
89
+ # unwrap the request body as soon as we start receiving a response
90
+ context.http_response.on_headers do
91
+ body = context.http_request.body
92
+ if body.is_a? ReadCallbackIO
93
+ context.http_request.body = body.io
94
+ end
95
+ end
96
+ end
97
+ end
98
+
99
+ # OptionHandler is needed to remove :on_chunk_sent
100
+ # from the params before build
101
+ handler(OptionHandler, step: :initialize)
102
+
103
+ # ReadCallbackHandlerneeds to go late in the call stack
104
+ # other plugins including Sigv4 and content_md5 read the request body
105
+ # and rewind it
106
+ handler(ReadCallbackHandler, step: :sign, priority: 0)
107
+ end
108
+ end
109
+ end
110
+ end
@@ -34,7 +34,7 @@ module Seahorse
34
34
  # an existing ManagedFile or BlockIO and those
35
35
  # should be reused.
36
36
  if context.http_response.body.is_a? StringIO
37
- context.http_response.body = handler.send(:io, target)
37
+ context.http_response.body = io(target, context.http_response.headers)
38
38
  end
39
39
  end
40
40
 
@@ -62,9 +62,9 @@ module Seahorse
62
62
  end
63
63
  end
64
64
 
65
- def io(target)
65
+ def io(target, headers)
66
66
  case target
67
- when Proc then BlockIO.new(&target)
67
+ when Proc then BlockIO.new(headers, &target)
68
68
  when String, Pathname then ManagedFile.new(target, 'w+b')
69
69
  else target
70
70
  end
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.102.1
4
+ version: 3.104.3
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-06-25 00:00:00.000000000 Z
11
+ date: 2020-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath
@@ -263,6 +263,7 @@ files:
263
263
  - lib/seahorse/client/plugins/net_http.rb
264
264
  - lib/seahorse/client/plugins/operation_methods.rb
265
265
  - lib/seahorse/client/plugins/raise_response_errors.rb
266
+ - lib/seahorse/client/plugins/request_callback.rb
266
267
  - lib/seahorse/client/plugins/response_target.rb
267
268
  - lib/seahorse/client/request.rb
268
269
  - lib/seahorse/client/request_context.rb