aws-sdk-core 3.91.0 → 3.94.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/VERSION +1 -1
- data/lib/aws-sdk-core.rb +2 -2
- data/lib/aws-sdk-core/assume_role_web_identity_credentials.rb +1 -0
- data/lib/aws-sdk-core/async_client_stubs.rb +2 -2
- data/lib/aws-sdk-core/binary/event_builder.rb +6 -6
- data/lib/aws-sdk-core/client_stubs.rb +13 -12
- data/lib/aws-sdk-core/deprecations.rb +6 -8
- data/lib/aws-sdk-core/errors.rb +9 -9
- data/lib/aws-sdk-core/json.rb +9 -10
- data/lib/aws-sdk-core/log/param_filter.rb +1 -1
- data/lib/aws-sdk-core/pageable_response.rb +34 -20
- data/lib/aws-sdk-core/param_validator.rb +1 -1
- data/lib/aws-sdk-core/plugins/retries/clock_skew.rb +43 -8
- data/lib/aws-sdk-core/plugins/retry_errors.rb +60 -22
- data/lib/aws-sdk-core/rest/request/querystring_builder.rb +2 -2
- data/lib/aws-sdk-core/shared_config.rb +11 -9
- data/lib/aws-sdk-core/stubbing/protocols/query.rb +2 -2
- data/lib/aws-sdk-core/stubbing/protocols/rest.rb +3 -3
- data/lib/aws-sdk-core/xml/builder.rb +1 -1
- data/lib/aws-sdk-core/xml/doc_builder.rb +7 -3
- data/lib/aws-sdk-core/xml/error_handler.rb +1 -1
- data/lib/aws-sdk-core/xml/parser/engines/rexml.rb +2 -1
- data/lib/aws-sdk-sts.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +24 -21
- data/lib/aws-sdk-sts/plugins/sts_regional_endpoints.rb +4 -4
- data/lib/aws-sdk-sts/resource.rb +1 -7
- data/lib/seahorse/client/h2/connection.rb +12 -12
- data/lib/seahorse/client/handler_list_entry.rb +2 -2
- data/lib/seahorse/client/http/request.rb +3 -3
- data/lib/seahorse/client/http/response.rb +2 -2
- data/lib/seahorse/client/net_http/handler.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e3dcb7b830a3e5f10ec9ad91d7f9ac0dd951c01ab6ac7ef4d3c92cc246121e5e
|
4
|
+
data.tar.gz: 67de0b39500fbd0f673f8eab1090a2ff2c8ccc0ff8d29458de785c9ba323e48c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73071a7ac86e2211ea76e64bf6ab449317cc9b7855a329729872363a09901f10937650bd4a7739590de279012987584b6222fdf1fe02e6762218cb849a18bb1d
|
7
|
+
data.tar.gz: d79f0f6d5bfe744db5361b08f6622862e0f6c153625cf9ee7034eca28d02955d553f5d2d3723bb4422b98df7bbfb05b705a58c2006bdf7715520e1de6eeaf302
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.94.1
|
data/lib/aws-sdk-core.rb
CHANGED
@@ -167,8 +167,8 @@ module Aws
|
|
167
167
|
|
168
168
|
# @api private
|
169
169
|
def eager_autoload!(*args)
|
170
|
-
msg = 'Aws.eager_autoload is no longer needed, usage of '
|
171
|
-
|
170
|
+
msg = 'Aws.eager_autoload is no longer needed, usage of '\
|
171
|
+
'autoload has been replaced with require statements'
|
172
172
|
warn(msg)
|
173
173
|
end
|
174
174
|
|
@@ -42,8 +42,8 @@ module Aws
|
|
42
42
|
if config.stub_responses
|
43
43
|
@send_events
|
44
44
|
else
|
45
|
-
msg = 'This method is only implemented for stubbed clients, and is '
|
46
|
-
|
45
|
+
msg = 'This method is only implemented for stubbed clients, and is '\
|
46
|
+
'available when you enable stubbing in the constructor with `stub_responses: true`'
|
47
47
|
raise NotImplementedError.new(msg)
|
48
48
|
end
|
49
49
|
end
|
@@ -5,7 +5,7 @@ module Aws
|
|
5
5
|
|
6
6
|
include Seahorse::Model::Shapes
|
7
7
|
|
8
|
-
# @param [Class]
|
8
|
+
# @param [Class] serializer_class
|
9
9
|
# @param [Seahorse::Model::ShapeRef] rules (of eventstream member)
|
10
10
|
def initialize(serializer_class, rules)
|
11
11
|
@serializer_class = serializer_class
|
@@ -59,7 +59,7 @@ module Aws
|
|
59
59
|
payload = _build_payload(streaming, m_ref, params[m_name])
|
60
60
|
end
|
61
61
|
end
|
62
|
-
|
62
|
+
|
63
63
|
|
64
64
|
event_ref.shape.members.each do |member_name, member_ref|
|
65
65
|
if member_ref.eventheader && params[member_name]
|
@@ -69,7 +69,7 @@ module Aws
|
|
69
69
|
value: header_value
|
70
70
|
)
|
71
71
|
elsif member_ref.eventpayload && params[member_name]
|
72
|
-
# explicit payload
|
72
|
+
# explicit payload
|
73
73
|
streaming, content_type = _content_type(member_ref.shape)
|
74
74
|
|
75
75
|
es_headers[":content-type"] = Aws::EventStream::HeaderValue.new(
|
@@ -99,7 +99,7 @@ module Aws
|
|
99
99
|
"Unsupport eventpayload shape: #{shape.name}")
|
100
100
|
end
|
101
101
|
end
|
102
|
-
|
102
|
+
|
103
103
|
def _header_value_type(shape, value)
|
104
104
|
case shape
|
105
105
|
when StringShape then "string"
|
@@ -107,9 +107,9 @@ module Aws
|
|
107
107
|
when TimestampShape then "timestamp"
|
108
108
|
when BlobShape then "bytes"
|
109
109
|
when BooleanShape then !!value ? "bool_true" : "bool_false"
|
110
|
-
else
|
110
|
+
else
|
111
111
|
raise Aws::Errors::EventStreamBuilderError.new(
|
112
|
-
"Unsupported eventheader shape: #{shape.name}")
|
112
|
+
"Unsupported eventheader shape: #{shape.name}")
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
@@ -171,24 +171,25 @@ module Aws
|
|
171
171
|
# @raise [RuntimeError] Raises a runtime error when called
|
172
172
|
# on a client that has not enabled response stubbing via
|
173
173
|
# `:stub_responses => true`.
|
174
|
-
#
|
175
174
|
def stub_responses(operation_name, *stubs)
|
176
175
|
if config.stub_responses
|
177
176
|
apply_stubs(operation_name, stubs.flatten)
|
178
177
|
else
|
179
|
-
msg = 'stubbing is not enabled; enable stubbing in the constructor '
|
180
|
-
|
178
|
+
msg = 'stubbing is not enabled; enable stubbing in the constructor '\
|
179
|
+
'with `:stub_responses => true`'
|
181
180
|
raise msg
|
182
181
|
end
|
183
182
|
end
|
184
183
|
|
185
|
-
# Allows you to access all of the requests that the stubbed client has made
|
186
|
-
#
|
187
|
-
# @
|
188
|
-
#
|
189
|
-
#
|
190
|
-
#
|
191
|
-
#
|
184
|
+
# Allows you to access all of the requests that the stubbed client has made.
|
185
|
+
#
|
186
|
+
# @param [Hash] options The options for the api requests.
|
187
|
+
# @option options [Boolean] :exclude_presign (false) Set to true to filter
|
188
|
+
# out unsent requests from generated presigned urls.
|
189
|
+
# @return [Array] Returns an array of the api requests made. Each request
|
190
|
+
# object contains the :operation_name, :params, and :context.
|
191
|
+
# @raise [NotImplementedError] Raises `NotImplementedError` when the client
|
192
|
+
# is not stubbed.
|
192
193
|
def api_requests(options = {})
|
193
194
|
if config.stub_responses
|
194
195
|
if options[:exclude_presign]
|
@@ -197,8 +198,8 @@ module Aws
|
|
197
198
|
@api_requests
|
198
199
|
end
|
199
200
|
else
|
200
|
-
msg = 'This method is only implemented for stubbed clients, and is '
|
201
|
-
|
201
|
+
msg = 'This method is only implemented for stubbed clients, and is '\
|
202
|
+
'available when you enable stubbing in the constructor with `stub_responses: true`'
|
202
203
|
raise NotImplementedError.new(msg)
|
203
204
|
end
|
204
205
|
end
|
@@ -48,14 +48,12 @@ module Aws
|
|
48
48
|
def deprecated(method, options = {})
|
49
49
|
|
50
50
|
deprecation_msg = options[:message] || begin
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
msg << "\n#############################################################"
|
58
|
-
msg
|
51
|
+
"#################### DEPRECATION WARNING ####################\n"\
|
52
|
+
"Called deprecated method `#{method}` of #{self}."\
|
53
|
+
"#{" Use `#{options[:use]}` instead.\n" if options[:use]}"\
|
54
|
+
"#{"Method `#{method}` will be removed in #{options[:version]}."\
|
55
|
+
if options[:version]}"\
|
56
|
+
"\n#############################################################"
|
59
57
|
end
|
60
58
|
|
61
59
|
alias_method(:"deprecated_#{method}", method)
|
data/lib/aws-sdk-core/errors.rb
CHANGED
@@ -52,7 +52,7 @@ module Aws
|
|
52
52
|
# EcsCredentialsProvider fails to parse the metadata response after retries
|
53
53
|
class MetadataParserError < RuntimeError
|
54
54
|
def initialize(*args)
|
55
|
-
msg =
|
55
|
+
msg = 'Failed to parse metadata service response.'
|
56
56
|
super(msg)
|
57
57
|
end
|
58
58
|
end
|
@@ -71,7 +71,7 @@ module Aws
|
|
71
71
|
class EndpointDiscoveryError < RuntimeError
|
72
72
|
def initialize(*args)
|
73
73
|
msg = 'Endpoint discovery failed for the operation or discovered endpoint is not working, '\
|
74
|
-
|
74
|
+
'request will keep failing until endpoint discovery succeeds or :endpoint option is provided.'
|
75
75
|
super(msg)
|
76
76
|
end
|
77
77
|
end
|
@@ -83,8 +83,8 @@ module Aws
|
|
83
83
|
|
84
84
|
def initialize(name)
|
85
85
|
msg = "Missing required parameter #{name} to construct"\
|
86
|
-
|
87
|
-
|
86
|
+
' endpoint host prefix. You can disable host prefix by'\
|
87
|
+
' setting :disable_host_prefix_injection to `true`.'
|
88
88
|
super(msg)
|
89
89
|
end
|
90
90
|
|
@@ -195,8 +195,8 @@ module Aws
|
|
195
195
|
class MissingWebIdentityTokenFile < RuntimeError
|
196
196
|
def initialize(*args)
|
197
197
|
msg = 'Missing :web_identity_token_file parameter or'\
|
198
|
-
|
199
|
-
|
198
|
+
' invalid file path provided for'\
|
199
|
+
' Aws::AssumeRoleWebIdentityCredentials provider'
|
200
200
|
super(msg)
|
201
201
|
end
|
202
202
|
end
|
@@ -208,8 +208,8 @@ 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 =
|
212
|
-
|
211
|
+
msg = 'missing region; use :region option or '\
|
212
|
+
"export region name to ENV['AWS_REGION']"
|
213
213
|
super(msg)
|
214
214
|
end
|
215
215
|
end
|
@@ -289,7 +289,7 @@ Known AWS regions include (not specific to this service):
|
|
289
289
|
module DynamicErrors
|
290
290
|
|
291
291
|
def self.extended(submodule)
|
292
|
-
submodule.instance_variable_set(
|
292
|
+
submodule.instance_variable_set('@const_set_mutex', Mutex.new)
|
293
293
|
submodule.const_set(:ServiceError, Class.new(ServiceError))
|
294
294
|
end
|
295
295
|
|
data/lib/aws-sdk-core/json.rb
CHANGED
@@ -7,28 +7,24 @@ require_relative 'json/parser'
|
|
7
7
|
module Aws
|
8
8
|
# @api private
|
9
9
|
module Json
|
10
|
-
|
11
10
|
class ParseError < StandardError
|
12
|
-
|
13
11
|
def initialize(error)
|
14
12
|
@error = error
|
15
13
|
super(error.message)
|
16
14
|
end
|
17
15
|
|
18
16
|
attr_reader :error
|
19
|
-
|
20
17
|
end
|
21
18
|
|
22
19
|
class << self
|
23
|
-
|
24
20
|
def load(json)
|
25
21
|
ENGINE.load(json, *ENGINE_LOAD_OPTIONS)
|
26
22
|
rescue *ENGINE_ERRORS => e
|
27
|
-
raise ParseError
|
23
|
+
raise ParseError, e
|
28
24
|
end
|
29
25
|
|
30
26
|
def load_file(path)
|
31
|
-
|
27
|
+
load(File.open(path, 'r', encoding: 'UTF-8', &:read))
|
32
28
|
end
|
33
29
|
|
34
30
|
def dump(value)
|
@@ -39,7 +35,12 @@ module Aws
|
|
39
35
|
|
40
36
|
def oj_engine
|
41
37
|
require 'oj'
|
42
|
-
[
|
38
|
+
[
|
39
|
+
Oj,
|
40
|
+
[{ mode: :compat, symbol_keys: false }],
|
41
|
+
[{ mode: :compat }],
|
42
|
+
oj_parse_error
|
43
|
+
]
|
43
44
|
rescue LoadError
|
44
45
|
false
|
45
46
|
end
|
@@ -50,17 +51,15 @@ module Aws
|
|
50
51
|
|
51
52
|
def oj_parse_error
|
52
53
|
if Oj.const_defined?('ParseError')
|
53
|
-
[Oj::ParseError, EncodingError]
|
54
|
+
[Oj::ParseError, EncodingError, JSON::ParserError]
|
54
55
|
else
|
55
56
|
[SyntaxError]
|
56
57
|
end
|
57
58
|
end
|
58
|
-
|
59
59
|
end
|
60
60
|
|
61
61
|
# @api private
|
62
62
|
ENGINE, ENGINE_LOAD_OPTIONS, ENGINE_DUMP_OPTIONS, ENGINE_ERRORS =
|
63
63
|
oj_engine || json_engine
|
64
|
-
|
65
64
|
end
|
66
65
|
end
|
@@ -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_model_endpoint_data_blobs, :external_user_id, :feedback_token, :file, :first_name, :full_name, :host_key, :id, :id_token, :input, :input_text, :ion_text, :join_token, :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, :public_key, :qr_code_png, :query, :random_password, :recovery_point_tags, :refresh_token, :registrant_contact, :request_attributes, :restore_metadata, :revision, :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, :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, :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, :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, :zip_file]
|
15
15
|
# end
|
16
16
|
|
17
17
|
def initialize(options = {})
|
@@ -1,32 +1,46 @@
|
|
1
1
|
module Aws
|
2
2
|
|
3
|
-
# Decorates a {Seahorse::Client::Response} with paging methods
|
3
|
+
# Decorates a {Seahorse::Client::Response} with paging convenience methods.
|
4
|
+
# Some AWS calls provide paged responses to limit the amount of data returned
|
5
|
+
# with each response. To optimize for latency, some APIs may return an
|
6
|
+
# inconsistent number of responses per page. You should rely on the values of
|
7
|
+
# the `next_page?` method or using enumerable methods such as `each`
|
8
|
+
# rather than the number of items returned to iterate through results.
|
9
|
+
# See below for examples.
|
4
10
|
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
11
|
+
# # Paged Responses Are Enumerable
|
12
|
+
# The simplest way to handle paged response data is to use the built-in
|
13
|
+
# enumerator in the response object, as shown in the following example.
|
8
14
|
#
|
9
|
-
#
|
10
|
-
# resp = resp.next_page
|
11
|
-
# resp.last_page?
|
12
|
-
# #=> true
|
15
|
+
# s3 = Aws::S3::Client.new
|
13
16
|
#
|
14
|
-
#
|
15
|
-
#
|
17
|
+
# s3.list_objects(bucket:'aws-sdk').each do |response|
|
18
|
+
# puts response.contents.map(&:key)
|
19
|
+
# end
|
16
20
|
#
|
17
|
-
#
|
21
|
+
# This yields one response object per API call made, and enumerates objects
|
22
|
+
# in the named bucket. The SDK retrieves additional pages of data to
|
23
|
+
# complete the request.
|
18
24
|
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
+
# # Handling Paged Responses Manually
|
26
|
+
# To handle paging yourself, use the response’s `next_page?` method to verify
|
27
|
+
# there are more pages to retrieve, or use the last_page? method to verify
|
28
|
+
# there are no more pages to retrieve.
|
29
|
+
#
|
30
|
+
# If there are more pages, use the `next_page` method to retrieve the
|
31
|
+
# next page of results, as shown in the following example.
|
25
32
|
#
|
26
|
-
#
|
33
|
+
# s3 = Aws::S3::Client.new
|
27
34
|
#
|
28
|
-
#
|
29
|
-
#
|
35
|
+
# # Get the first page of data
|
36
|
+
# response = s3.list_objects(bucket:'aws-sdk')
|
37
|
+
#
|
38
|
+
# # Get additional pages
|
39
|
+
# while response.next_page? do
|
40
|
+
# response = response.next_page
|
41
|
+
# # Use the response data here...
|
42
|
+
# puts response.contents.map(&:key)
|
43
|
+
# end
|
30
44
|
#
|
31
45
|
module PageableResponse
|
32
46
|
|
@@ -152,7 +152,7 @@ module Aws
|
|
152
152
|
def correct_type?(ref, value, errors, context)
|
153
153
|
if ref.eventstream && @input
|
154
154
|
errors << "instead of providing value directly for eventstreams at input,"\
|
155
|
-
|
155
|
+
" expected to use #signal events per stream"
|
156
156
|
return false
|
157
157
|
end
|
158
158
|
case value
|
@@ -9,7 +9,14 @@ module Aws
|
|
9
9
|
|
10
10
|
def initialize
|
11
11
|
@mutex = Mutex.new
|
12
|
+
# clock_corrections are recorded only on errors
|
13
|
+
# and only when time difference is greater than the
|
14
|
+
# CLOCK_SKEW_THRESHOLD
|
12
15
|
@endpoint_clock_corrections = Hash.new(0)
|
16
|
+
|
17
|
+
# estimated_skew is calculated on every request
|
18
|
+
# and is used to estimate a TTL for requests
|
19
|
+
@endpoint_estimated_skews = Hash.new(nil)
|
13
20
|
end
|
14
21
|
|
15
22
|
# Gets the clock_correction in seconds to apply to a given endpoint
|
@@ -18,11 +25,15 @@ module Aws
|
|
18
25
|
@mutex.synchronize { @endpoint_clock_corrections[endpoint.to_s] }
|
19
26
|
end
|
20
27
|
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
|
25
|
-
|
28
|
+
# The estimated skew factors in any clock skew from
|
29
|
+
# the service along with any network latency.
|
30
|
+
# This provides a more accurate value for the ttl,
|
31
|
+
# which should represent when the client will stop
|
32
|
+
# waiting for a request.
|
33
|
+
# Estimated Skew should not be used to correct clock skew errors
|
34
|
+
# it should only be used to estimate TTL for a request
|
35
|
+
def estimated_skew(endpoint)
|
36
|
+
@mutex.synchronize { @endpoint_estimated_skews[endpoint.to_s] }
|
26
37
|
end
|
27
38
|
|
28
39
|
# Determines whether a request has clock skew by comparing
|
@@ -30,13 +41,15 @@ module Aws
|
|
30
41
|
# @param context [Seahorse::Client::RequestContext]
|
31
42
|
def clock_skewed?(context)
|
32
43
|
server_time = server_time(context.http_response)
|
33
|
-
!!server_time &&
|
44
|
+
!!server_time &&
|
45
|
+
(Time.now.utc - server_time).abs > CLOCK_SKEW_THRESHOLD
|
34
46
|
end
|
35
47
|
|
36
|
-
#
|
48
|
+
# Called only on clock skew related errors
|
49
|
+
# Update the stored clock skew correction value for an endpoint
|
37
50
|
# from the server's time in the response
|
38
51
|
# @param context [Seahorse::Client::RequestContext]
|
39
|
-
def
|
52
|
+
def update_clock_correction(context)
|
40
53
|
endpoint = context.http_request.endpoint
|
41
54
|
now_utc = Time.now.utc
|
42
55
|
server_time = server_time(context.http_response)
|
@@ -45,6 +58,20 @@ module Aws
|
|
45
58
|
end
|
46
59
|
end
|
47
60
|
|
61
|
+
# Called for every request
|
62
|
+
# Update our estimated clock skew for the endpoint
|
63
|
+
# from the servers time in the response
|
64
|
+
# @param context [Seahorse::Client::RequestContext]
|
65
|
+
def update_estimated_skew(context)
|
66
|
+
endpoint = context.http_request.endpoint
|
67
|
+
now_utc = Time.now.utc
|
68
|
+
server_time = server_time(context.http_response)
|
69
|
+
return unless server_time
|
70
|
+
@mutex.synchronize do
|
71
|
+
@endpoint_estimated_skews[endpoint.to_s] = server_time - now_utc
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
48
75
|
private
|
49
76
|
|
50
77
|
# @param response [Seahorse::Client::Http::Response:]
|
@@ -56,6 +83,14 @@ module Aws
|
|
56
83
|
end
|
57
84
|
end
|
58
85
|
|
86
|
+
# Sets the clock correction for an endpoint
|
87
|
+
# @param endpoint [URI / String]
|
88
|
+
# @param correction [Number]
|
89
|
+
def set_clock_correction(endpoint, correction)
|
90
|
+
@mutex.synchronize do
|
91
|
+
@endpoint_clock_corrections[endpoint.to_s] = correction
|
92
|
+
end
|
93
|
+
end
|
59
94
|
end
|
60
95
|
end
|
61
96
|
end
|
@@ -97,15 +97,19 @@ This option is only used in the `legacy` retry mode.
|
|
97
97
|
doc_type: String,
|
98
98
|
docstring: <<-DOCS) do |cfg|
|
99
99
|
Specifies which retry algorithm to use. Values are:
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
100
|
+
|
101
|
+
* `legacy` - The pre-existing retry behavior. This is default value if
|
102
|
+
no retry mode is provided.
|
103
|
+
|
104
|
+
* `standard` - A standardized set of retry rules across the AWS SDKs.
|
105
|
+
This includes support for retry quotas, which limit the number of
|
106
|
+
unsuccessful retries a client can make.
|
107
|
+
|
108
|
+
* `adaptive` - An experimental retry mode that includes all the
|
109
|
+
functionality of `standard` mode along with automatic client side
|
110
|
+
throttling. This is a provisional mode that may change behavior
|
111
|
+
in the future.
|
112
|
+
|
109
113
|
DOCS
|
110
114
|
resolve_retry_mode(cfg)
|
111
115
|
end
|
@@ -163,8 +167,8 @@ a clock skew correction and retry requests with skewed client clocks.
|
|
163
167
|
# Raise if provided value is not one of the retry modes
|
164
168
|
if value != 'legacy' && value != 'standard' && value != 'adaptive'
|
165
169
|
raise ArgumentError,
|
166
|
-
|
167
|
-
|
170
|
+
'Must provide either `legacy`, `standard`, or `adaptive` for '\
|
171
|
+
'retry_mode profile option or for ENV[\'AWS_RETRY_MODE\']'
|
168
172
|
end
|
169
173
|
value
|
170
174
|
end
|
@@ -176,8 +180,8 @@ a clock skew correction and retry requests with skewed client clocks.
|
|
176
180
|
# Raise if provided value is not a positive integer
|
177
181
|
if !value.is_a?(Integer) || value <= 0
|
178
182
|
raise ArgumentError,
|
179
|
-
|
180
|
-
|
183
|
+
'Must provide a positive integer for max_attempts profile '\
|
184
|
+
'option or for ENV[\'AWS_MAX_ATTEMPTS\']'
|
181
185
|
end
|
182
186
|
value
|
183
187
|
end
|
@@ -190,9 +194,9 @@ a clock skew correction and retry requests with skewed client clocks.
|
|
190
194
|
# Raise if provided value is not true or false
|
191
195
|
if value != 'true' && value != 'false'
|
192
196
|
raise ArgumentError,
|
193
|
-
|
194
|
-
|
195
|
-
|
197
|
+
'Must provide either `true` or `false` for '\
|
198
|
+
'adaptive_retry_wait_to_fill profile option or for '\
|
199
|
+
'ENV[\'AWS_ADAPTIVE_RETRY_WAIT_TO_FILL\']'
|
196
200
|
end
|
197
201
|
|
198
202
|
value == 'true'
|
@@ -206,9 +210,9 @@ a clock skew correction and retry requests with skewed client clocks.
|
|
206
210
|
# Raise if provided value is not true or false
|
207
211
|
if value != 'true' && value != 'false'
|
208
212
|
raise ArgumentError,
|
209
|
-
|
210
|
-
|
211
|
-
|
213
|
+
'Must provide either `true` or `false` for '\
|
214
|
+
'correct_clock_skew profile option or for '\
|
215
|
+
'ENV[\'AWS_CORRECT_CLOCK_SKEW\']'
|
212
216
|
end
|
213
217
|
|
214
218
|
value == 'true'
|
@@ -223,6 +227,7 @@ a clock skew correction and retry requests with skewed client clocks.
|
|
223
227
|
config = context.config
|
224
228
|
|
225
229
|
get_send_token(config)
|
230
|
+
add_retry_headers(context)
|
226
231
|
response = @handler.call(context)
|
227
232
|
error_inspector = Retries::ErrorInspector.new(
|
228
233
|
response.error, response.context.http_response.status_code
|
@@ -235,12 +240,16 @@ a clock skew correction and retry requests with skewed client clocks.
|
|
235
240
|
config.endpoint_cache.delete(key)
|
236
241
|
end
|
237
242
|
|
238
|
-
# Clock
|
239
|
-
# the request is not retryable
|
243
|
+
# Clock correction needs to be updated from the response even when
|
244
|
+
# the request is not retryable but should only be updated
|
245
|
+
# in the case of clock skew errors
|
240
246
|
if error_inspector.clock_skew?(context)
|
241
|
-
config.clock_skew.
|
247
|
+
config.clock_skew.update_clock_correction(context)
|
242
248
|
end
|
243
249
|
|
250
|
+
# Estimated skew needs to be updated on every request
|
251
|
+
config.clock_skew.update_estimated_skew(context)
|
252
|
+
|
244
253
|
return response unless retryable?(context, response, error_inspector)
|
245
254
|
|
246
255
|
return response if context.retries >= config.max_attempts - 1
|
@@ -304,6 +313,35 @@ a clock skew correction and retry requests with skewed client clocks.
|
|
304
313
|
context.http_response.reset
|
305
314
|
call(context)
|
306
315
|
end
|
316
|
+
|
317
|
+
def add_retry_headers(context)
|
318
|
+
request_pairs = {
|
319
|
+
'attempt' => context.retries,
|
320
|
+
'max' => context.config.max_attempts
|
321
|
+
}
|
322
|
+
if (ttl = compute_request_ttl(context))
|
323
|
+
request_pairs['ttl'] = ttl
|
324
|
+
end
|
325
|
+
|
326
|
+
# create the request header
|
327
|
+
formatted_header = request_pairs.map { |k, v| "#{k}=#{v}" }.join('; ')
|
328
|
+
context.http_request.headers['amz-sdk-request'] = formatted_header
|
329
|
+
end
|
330
|
+
|
331
|
+
def compute_request_ttl(context)
|
332
|
+
return if context.operation.async
|
333
|
+
|
334
|
+
endpoint = context.http_request.endpoint
|
335
|
+
estimated_skew = context.config.clock_skew.estimated_skew(endpoint)
|
336
|
+
if context.config.respond_to?(:http_read_timeout)
|
337
|
+
read_timeout = context.config.http_read_timeout
|
338
|
+
end
|
339
|
+
|
340
|
+
if estimated_skew && read_timeout
|
341
|
+
(Time.now.utc + read_timeout + estimated_skew)
|
342
|
+
.strftime('%Y%m%dT%H%M%SZ')
|
343
|
+
end
|
344
|
+
end
|
307
345
|
end
|
308
346
|
|
309
347
|
class LegacyHandler < Seahorse::Client::Handler
|
@@ -50,8 +50,8 @@ module Aws
|
|
50
50
|
if StringShape === shape_ref.shape.member.shape
|
51
51
|
list_of_strings(shape_ref.location_name, param_value)
|
52
52
|
else
|
53
|
-
msg = "Only list of strings supported, got "
|
54
|
-
|
53
|
+
msg = "Only list of strings supported, got "\
|
54
|
+
"#{shape_ref.shape.member.shape.class.name}"
|
55
55
|
raise NotImplementedError, msg
|
56
56
|
end
|
57
57
|
else
|
@@ -184,9 +184,9 @@ module Aws
|
|
184
184
|
credential_source ||= prof_cfg['credential_source']
|
185
185
|
if opts[:source_profile] && credential_source
|
186
186
|
raise Errors::CredentialSourceConflictError,
|
187
|
-
|
188
|
-
|
189
|
-
|
187
|
+
"Profile #{profile} has a source_profile, and "\
|
188
|
+
'a credential_source. For assume role credentials, must '\
|
189
|
+
'provide only source_profile or credential_source, not both.'
|
190
190
|
elsif opts[:source_profile]
|
191
191
|
opts[:credentials] = resolve_source_profile(opts[:source_profile], opts)
|
192
192
|
if opts[:credentials]
|
@@ -199,8 +199,9 @@ module Aws
|
|
199
199
|
opts[:profile] = opts.delete(:source_profile)
|
200
200
|
AssumeRoleCredentials.new(opts)
|
201
201
|
else
|
202
|
-
raise Errors::NoSourceProfileError,
|
203
|
-
|
202
|
+
raise Errors::NoSourceProfileError,
|
203
|
+
"Profile #{profile} has a role_arn, and source_profile, but the"\
|
204
|
+
' source_profile does not have credentials.'
|
204
205
|
end
|
205
206
|
elsif credential_source
|
206
207
|
opts[:credentials] = credentials_from_source(
|
@@ -217,8 +218,9 @@ module Aws
|
|
217
218
|
opts.delete(:source_profile) # Cleanup
|
218
219
|
AssumeRoleCredentials.new(opts)
|
219
220
|
else
|
220
|
-
raise Errors::NoSourceCredentials,
|
221
|
-
|
221
|
+
raise Errors::NoSourceCredentials,
|
222
|
+
"Profile #{profile} could not get source credentials from"\
|
223
|
+
" provider #{credential_source}"
|
222
224
|
end
|
223
225
|
elsif prof_cfg['role_arn']
|
224
226
|
raise Errors::NoSourceProfileError, "Profile #{profile} has a role_arn, but no source_profile."
|
@@ -306,8 +308,8 @@ module Aws
|
|
306
308
|
def validate_profile_exists(profile)
|
307
309
|
unless (@parsed_credentials && @parsed_credentials[profile]) ||
|
308
310
|
(@parsed_config && @parsed_config[profile])
|
309
|
-
msg = "Profile `#{profile}' not found in #{@credentials_path}"
|
310
|
-
|
311
|
+
msg = "Profile `#{profile}' not found in #{@credentials_path}"\
|
312
|
+
"#{" or #{@config_path}" if @config_path}"
|
311
313
|
raise Errors::NoSuchProfileError, msg
|
312
314
|
end
|
313
315
|
end
|
@@ -23,9 +23,9 @@ module Aws
|
|
23
23
|
xml = []
|
24
24
|
builder = Aws::Xml::DocBuilder.new(target: xml, indent: ' ')
|
25
25
|
builder.node(operation.name + 'Response', xmlns: xmlns(api)) do
|
26
|
-
if rules = operation.output
|
26
|
+
if (rules = operation.output)
|
27
27
|
rules.location_name = operation.name + 'Result'
|
28
|
-
Xml::Builder.new(rules, target:xml, pad:' ').to_xml(data)
|
28
|
+
Xml::Builder.new(rules, target: xml, pad:' ').to_xml(data)
|
29
29
|
end
|
30
30
|
builder.node('ResponseMetadata') do
|
31
31
|
builder.node('RequestId', 'stubbed-request-id')
|
@@ -94,9 +94,9 @@ module Aws
|
|
94
94
|
# Pending
|
95
95
|
raise 'Stubbing :exception event is not supported'
|
96
96
|
end
|
97
|
-
stream
|
98
|
-
Aws::EventStream::Message.new(opts)
|
99
|
-
|
97
|
+
[stream, Aws::EventStream::Encoder.new.encode(
|
98
|
+
Aws::EventStream::Message.new(opts)
|
99
|
+
)].pack('a*a*')
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
@@ -11,7 +11,7 @@ module Aws
|
|
11
11
|
@xml = options[:target] || []
|
12
12
|
indent = options[:indent] || ' '
|
13
13
|
pad = options[:pad] || ''
|
14
|
-
@builder = DocBuilder.new(target
|
14
|
+
@builder = DocBuilder.new(target: @xml, indent: indent, pad: pad)
|
15
15
|
end
|
16
16
|
|
17
17
|
def to_xml(params)
|
@@ -6,7 +6,11 @@ module Aws
|
|
6
6
|
# @option options [String] :pad ('')
|
7
7
|
# @option options [String] :indent ('')
|
8
8
|
def initialize(options = {})
|
9
|
-
@target = options[:target] ||
|
9
|
+
@target = options[:target] || (
|
10
|
+
# The String has to be mutable
|
11
|
+
# because @target implements `<<` method.
|
12
|
+
String.new
|
13
|
+
)
|
10
14
|
@indent = options[:indent] || ''
|
11
15
|
@pad = options[:pad] || ''
|
12
16
|
@end_of_line = @indent == '' ? '' : "\n"
|
@@ -32,7 +36,7 @@ module Aws
|
|
32
36
|
if block_given?
|
33
37
|
@target << open_el(name, attrs)
|
34
38
|
@target << @end_of_line
|
35
|
-
increase_pad
|
39
|
+
increase_pad(&block)
|
36
40
|
@target << @pad
|
37
41
|
@target << close_el(name)
|
38
42
|
elsif args.empty?
|
@@ -77,7 +81,7 @@ module Aws
|
|
77
81
|
def increase_pad(&block)
|
78
82
|
pre_increase = @pad
|
79
83
|
@pad = @pad + @indent
|
80
|
-
|
84
|
+
block.call
|
81
85
|
@pad = pre_increase
|
82
86
|
end
|
83
87
|
|
@@ -15,7 +15,8 @@ module Aws
|
|
15
15
|
|
16
16
|
def parse(xml)
|
17
17
|
begin
|
18
|
-
|
18
|
+
mutable_xml = xml.dup # REXML only accepts mutable string
|
19
|
+
source = REXML::Source.new(mutable_xml)
|
19
20
|
REXML::Parsers::StreamParser.new(source, self).parse
|
20
21
|
rescue REXML::ParseException => error
|
21
22
|
@stack.error(error.message)
|
data/lib/aws-sdk-sts.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
@@ -33,11 +33,11 @@ Aws::Plugins::GlobalConfiguration.add_identifier(:sts)
|
|
33
33
|
module Aws::STS
|
34
34
|
# An API client for STS. To construct a client, you need to configure a `:region` and `:credentials`.
|
35
35
|
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
36
|
+
# client = Aws::STS::Client.new(
|
37
|
+
# region: region_name,
|
38
|
+
# credentials: credentials,
|
39
|
+
# # ...
|
40
|
+
# )
|
41
41
|
#
|
42
42
|
# For details on configuring region and credentials see
|
43
43
|
# the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
|
@@ -231,24 +231,28 @@ module Aws::STS
|
|
231
231
|
#
|
232
232
|
# @option options [String] :retry_mode ("legacy")
|
233
233
|
# Specifies which retry algorithm to use. Values are:
|
234
|
-
#
|
235
|
-
#
|
236
|
-
#
|
237
|
-
#
|
238
|
-
#
|
239
|
-
#
|
240
|
-
#
|
241
|
-
#
|
242
|
-
#
|
234
|
+
#
|
235
|
+
# * `legacy` - The pre-existing retry behavior. This is default value if
|
236
|
+
# no retry mode is provided.
|
237
|
+
#
|
238
|
+
# * `standard` - A standardized set of retry rules across the AWS SDKs.
|
239
|
+
# This includes support for retry quotas, which limit the number of
|
240
|
+
# unsuccessful retries a client can make.
|
241
|
+
#
|
242
|
+
# * `adaptive` - An experimental retry mode that includes all the
|
243
|
+
# functionality of `standard` mode along with automatic client side
|
244
|
+
# throttling. This is a provisional mode that may change behavior
|
245
|
+
# in the future.
|
246
|
+
#
|
243
247
|
#
|
244
248
|
# @option options [String] :secret_access_key
|
245
249
|
#
|
246
250
|
# @option options [String] :session_token
|
247
251
|
#
|
248
|
-
# @option options [String] :sts_regional_endpoints ("
|
252
|
+
# @option options [String] :sts_regional_endpoints ("regional")
|
249
253
|
# Passing in 'regional' to enable regional endpoint for STS for all supported
|
250
|
-
# regions (except 'aws-global')
|
251
|
-
#
|
254
|
+
# regions (except 'aws-global'). Using 'legacy' mode will force all legacy
|
255
|
+
# regions to resolve to the STS global endpoint.
|
252
256
|
#
|
253
257
|
# @option options [Boolean] :stub_responses (false)
|
254
258
|
# Causes the client to return stubbed responses. By default
|
@@ -272,8 +276,7 @@ module Aws::STS
|
|
272
276
|
#
|
273
277
|
# @option options [Integer] :http_read_timeout (60) The default
|
274
278
|
# number of seconds to wait for response data. This value can
|
275
|
-
# safely be set
|
276
|
-
# per-request on the session yielded by {#session_for}.
|
279
|
+
# safely be set per-request on the session.
|
277
280
|
#
|
278
281
|
# @option options [Float] :http_idle_timeout (5) The number of
|
279
282
|
# seconds a connection is allowed to sit idle before it is
|
@@ -285,7 +288,7 @@ module Aws::STS
|
|
285
288
|
# request body. This option has no effect unless the request has
|
286
289
|
# "Expect" header set to "100-continue". Defaults to `nil` which
|
287
290
|
# disables this behaviour. This value can safely be set per
|
288
|
-
# request on the session
|
291
|
+
# request on the session.
|
289
292
|
#
|
290
293
|
# @option options [Boolean] :http_wire_trace (false) When `true`,
|
291
294
|
# HTTP debug output will be sent to the `:logger`.
|
@@ -2182,7 +2185,7 @@ module Aws::STS
|
|
2182
2185
|
params: params,
|
2183
2186
|
config: config)
|
2184
2187
|
context[:gem_name] = 'aws-sdk-core'
|
2185
|
-
context[:gem_version] = '3.
|
2188
|
+
context[:gem_version] = '3.94.1'
|
2186
2189
|
Seahorse::Client::Request.new(handlers, context)
|
2187
2190
|
end
|
2188
2191
|
|
@@ -5,12 +5,12 @@ module Aws
|
|
5
5
|
class STSRegionalEndpoints < Seahorse::Client::Plugin
|
6
6
|
|
7
7
|
option(:sts_regional_endpoints,
|
8
|
-
default: '
|
8
|
+
default: 'regional',
|
9
9
|
doc_type: String,
|
10
10
|
docstring: <<-DOCS) do |cfg|
|
11
11
|
Passing in 'regional' to enable regional endpoint for STS for all supported
|
12
|
-
regions (except 'aws-global')
|
13
|
-
|
12
|
+
regions (except 'aws-global'). Using 'legacy' mode will force all legacy
|
13
|
+
regions to resolve to the STS global endpoint.
|
14
14
|
DOCS
|
15
15
|
resolve_sts_regional_endpoints(cfg)
|
16
16
|
end
|
@@ -22,7 +22,7 @@ for legacy regions.
|
|
22
22
|
env_mode = nil if env_mode == ''
|
23
23
|
cfg_mode = Aws.shared_config.sts_regional_endpoints(
|
24
24
|
profile: cfg.profile)
|
25
|
-
env_mode || cfg_mode || '
|
25
|
+
env_mode || cfg_mode || 'regional'
|
26
26
|
end
|
27
27
|
|
28
28
|
end
|
data/lib/aws-sdk-sts/resource.rb
CHANGED
@@ -6,13 +6,7 @@
|
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
8
|
module Aws::STS
|
9
|
-
|
10
|
-
# To create a resource object:
|
11
|
-
# resource = Aws::STS::Resource.new(region: 'us-west-2')
|
12
|
-
# You can supply a client object with custom configuration that will be used for all resource operations.
|
13
|
-
# If you do not pass +:client+, a default client will be constructed.
|
14
|
-
# client = Aws::STS::Client.new(region: 'us-west-2')
|
15
|
-
# resource = Aws::STS::Resource.new(client: client)
|
9
|
+
|
16
10
|
class Resource
|
17
11
|
|
18
12
|
# @param options ({})
|
@@ -76,7 +76,7 @@ module Seahorse
|
|
76
76
|
tcp, addr = _tcp_socket(endpoint)
|
77
77
|
debug_output("opening connection to #{endpoint.host}:#{endpoint.port} ...")
|
78
78
|
_nonblocking_connect(tcp, addr)
|
79
|
-
debug_output(
|
79
|
+
debug_output('opened')
|
80
80
|
|
81
81
|
@socket = OpenSSL::SSL::SSLSocket.new(tcp, _tls_context)
|
82
82
|
@socket.sync_close = true
|
@@ -84,12 +84,12 @@ module Seahorse
|
|
84
84
|
|
85
85
|
debug_output("starting TLS for #{endpoint.host}:#{endpoint.port} ...")
|
86
86
|
@socket.connect
|
87
|
-
debug_output(
|
87
|
+
debug_output('TLS established')
|
88
88
|
_register_h2_callbacks
|
89
89
|
@status = :active
|
90
90
|
elsif @status == :closed
|
91
|
-
msg =
|
92
|
-
|
91
|
+
msg = 'Async Client HTTP2 Connection is closed, you may'\
|
92
|
+
' use #new_connection to create a new HTTP2 Connection for this client'
|
93
93
|
raise Http2ConnectionClosedError.new(msg)
|
94
94
|
end
|
95
95
|
}
|
@@ -106,7 +106,7 @@ module Seahorse
|
|
106
106
|
rescue IO::WaitReadable
|
107
107
|
begin
|
108
108
|
unless IO.select([@socket], nil, nil, connection_read_timeout)
|
109
|
-
self.debug_output(
|
109
|
+
self.debug_output('socket connection read time out')
|
110
110
|
self.close!
|
111
111
|
else
|
112
112
|
# available, retry to start reading
|
@@ -132,7 +132,7 @@ module Seahorse
|
|
132
132
|
|
133
133
|
def close!
|
134
134
|
@mutex.synchronize {
|
135
|
-
self.debug_output(
|
135
|
+
self.debug_output('closing connection ...')
|
136
136
|
if @socket
|
137
137
|
@socket.close
|
138
138
|
@socket = nil
|
@@ -151,10 +151,10 @@ module Seahorse
|
|
151
151
|
|
152
152
|
def debug_output(msg, type = nil)
|
153
153
|
prefix = case type
|
154
|
-
when :send then
|
155
|
-
when :receive then
|
154
|
+
when :send then '-> '
|
155
|
+
when :receive then '<- '
|
156
156
|
else
|
157
|
-
|
157
|
+
''
|
158
158
|
end
|
159
159
|
return unless @logger
|
160
160
|
_debug_entry(prefix + msg)
|
@@ -170,8 +170,8 @@ module Seahorse
|
|
170
170
|
def _register_h2_callbacks
|
171
171
|
@h2_client.on(:frame) do |bytes|
|
172
172
|
if @socket.nil?
|
173
|
-
msg =
|
174
|
-
|
173
|
+
msg = 'Connection is closed due to errors, '\
|
174
|
+
'you can find errors at async_client.connection.errors'
|
175
175
|
raise Http2ConnectionClosedError.new(msg)
|
176
176
|
else
|
177
177
|
@socket.print(bytes)
|
@@ -223,7 +223,7 @@ module Seahorse
|
|
223
223
|
ssl_ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
224
224
|
end
|
225
225
|
if enable_alpn
|
226
|
-
debug_output(
|
226
|
+
debug_output('enabling ALPN for TLS ...')
|
227
227
|
ssl_ctx.alpn_protocols = ['h2']
|
228
228
|
end
|
229
229
|
ssl_ctx
|
@@ -86,8 +86,8 @@ module Seahorse
|
|
86
86
|
if STEPS.key?(step)
|
87
87
|
@step = step
|
88
88
|
else
|
89
|
-
msg = "invalid :step `%s', must be one of :initialize, :validate, "
|
90
|
-
|
89
|
+
msg = "invalid :step `%s', must be one of :initialize, :validate, "\
|
90
|
+
':build, :sign or :send'
|
91
91
|
raise ArgumentError, msg % step.inspect
|
92
92
|
end
|
93
93
|
end
|
@@ -34,8 +34,8 @@ module Seahorse
|
|
34
34
|
if endpoint.nil? or URI::HTTP === endpoint or URI::HTTPS === endpoint
|
35
35
|
@endpoint = endpoint
|
36
36
|
else
|
37
|
-
msg =
|
38
|
-
|
37
|
+
msg = 'invalid endpoint, expected URI::HTTP, URI::HTTPS, or nil, '\
|
38
|
+
"got #{endpoint.inspect}"
|
39
39
|
raise ArgumentError, msg
|
40
40
|
end
|
41
41
|
end
|
@@ -55,7 +55,7 @@ module Seahorse
|
|
55
55
|
|
56
56
|
# @param [#read, #size, #rewind] io
|
57
57
|
def body=(io)
|
58
|
-
@body =case io
|
58
|
+
@body = case io
|
59
59
|
when nil then StringIO.new('')
|
60
60
|
when String then StringIO.new(io)
|
61
61
|
else io
|
@@ -109,8 +109,8 @@ module Seahorse
|
|
109
109
|
@done = true
|
110
110
|
emit(:done)
|
111
111
|
else
|
112
|
-
msg =
|
113
|
-
|
112
|
+
msg = 'options must be empty or must contain :status_code, :headers, '\
|
113
|
+
'and :body'
|
114
114
|
raise ArgumentError, msg
|
115
115
|
end
|
116
116
|
end
|
@@ -13,8 +13,8 @@ module Seahorse
|
|
13
13
|
# @api private
|
14
14
|
class TruncatedBodyError < IOError
|
15
15
|
def initialize(bytes_expected, bytes_received)
|
16
|
-
msg = "http response body truncated, expected #{bytes_expected} "
|
17
|
-
|
16
|
+
msg = "http response body truncated, expected #{bytes_expected} "\
|
17
|
+
"bytes, received #{bytes_received} bytes"
|
18
18
|
super(msg)
|
19
19
|
end
|
20
20
|
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.
|
4
|
+
version: 3.94.1
|
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-
|
11
|
+
date: 2020-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jmespath
|
@@ -64,7 +64,7 @@ dependencies:
|
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '1
|
67
|
+
version: '1'
|
68
68
|
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: 1.0.2
|
@@ -74,7 +74,7 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - "~>"
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: '1
|
77
|
+
version: '1'
|
78
78
|
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: 1.0.2
|
@@ -294,7 +294,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
294
294
|
version: '0'
|
295
295
|
requirements: []
|
296
296
|
rubyforge_project:
|
297
|
-
rubygems_version: 2.
|
297
|
+
rubygems_version: 2.7.6.2
|
298
298
|
signing_key:
|
299
299
|
specification_version: 4
|
300
300
|
summary: AWS SDK for Ruby - Core
|