aws-sdk-core 3.168.4 → 3.190.3

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.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +231 -0
  3. data/VERSION +1 -1
  4. data/lib/aws-defaults/default_configuration.rb +4 -4
  5. data/lib/aws-sdk-core/client_stubs.rb +15 -12
  6. data/lib/aws-sdk-core/credential_provider.rb +3 -0
  7. data/lib/aws-sdk-core/credential_provider_chain.rb +2 -1
  8. data/lib/aws-sdk-core/ecs_credentials.rb +177 -53
  9. data/lib/aws-sdk-core/endpoints/condition.rb +5 -0
  10. data/lib/aws-sdk-core/endpoints/endpoint_rule.rb +5 -1
  11. data/lib/aws-sdk-core/endpoints/error_rule.rb +5 -0
  12. data/lib/aws-sdk-core/endpoints/function.rb +5 -0
  13. data/lib/aws-sdk-core/endpoints/matchers.rb +13 -9
  14. data/lib/aws-sdk-core/endpoints/reference.rb +5 -0
  15. data/lib/aws-sdk-core/endpoints/rule.rb +5 -0
  16. data/lib/aws-sdk-core/endpoints/rule_set.rb +5 -0
  17. data/lib/aws-sdk-core/endpoints/rules_provider.rb +5 -0
  18. data/lib/aws-sdk-core/endpoints/templater.rb +6 -0
  19. data/lib/aws-sdk-core/endpoints/tree_rule.rb +5 -0
  20. data/lib/aws-sdk-core/endpoints/url.rb +1 -0
  21. data/lib/aws-sdk-core/endpoints.rb +6 -2
  22. data/lib/aws-sdk-core/errors.rb +1 -1
  23. data/lib/aws-sdk-core/ini_parser.rb +7 -0
  24. data/lib/aws-sdk-core/instance_profile_credentials.rb +52 -30
  25. data/lib/aws-sdk-core/json/error_handler.rb +15 -5
  26. data/lib/aws-sdk-core/json/handler.rb +8 -1
  27. data/lib/aws-sdk-core/json/parser.rb +27 -2
  28. data/lib/aws-sdk-core/log/formatter.rb +6 -0
  29. data/lib/aws-sdk-core/pageable_response.rb +3 -1
  30. data/lib/aws-sdk-core/param_validator.rb +2 -2
  31. data/lib/aws-sdk-core/plugins/checksum_algorithm.rb +5 -3
  32. data/lib/aws-sdk-core/plugins/http_checksum.rb +2 -1
  33. data/lib/aws-sdk-core/plugins/regional_endpoint.rb +109 -33
  34. data/lib/aws-sdk-core/plugins/request_compression.rb +217 -0
  35. data/lib/aws-sdk-core/plugins/sign.rb +16 -10
  36. data/lib/aws-sdk-core/plugins/user_agent.rb +117 -14
  37. data/lib/aws-sdk-core/refreshing_credentials.rb +12 -12
  38. data/lib/aws-sdk-core/rest/request/querystring_builder.rb +43 -29
  39. data/lib/aws-sdk-core/shared_config.rb +48 -18
  40. data/lib/aws-sdk-core/sso_credentials.rb +1 -1
  41. data/lib/aws-sdk-core/stubbing/stub_data.rb +11 -0
  42. data/lib/aws-sdk-core/waiters/poller.rb +4 -2
  43. data/lib/aws-sdk-core/xml/parser/engines/oga.rb +2 -0
  44. data/lib/aws-sdk-sso/client.rb +21 -1
  45. data/lib/aws-sdk-sso/endpoint_provider.rb +41 -96
  46. data/lib/aws-sdk-sso/endpoints.rb +1 -0
  47. data/lib/aws-sdk-sso/plugins/endpoints.rb +3 -2
  48. data/lib/aws-sdk-sso.rb +1 -1
  49. data/lib/aws-sdk-ssooidc/client.rb +358 -29
  50. data/lib/aws-sdk-ssooidc/client_api.rb +56 -1
  51. data/lib/aws-sdk-ssooidc/endpoint_provider.rb +41 -95
  52. data/lib/aws-sdk-ssooidc/endpoints.rb +15 -0
  53. data/lib/aws-sdk-ssooidc/errors.rb +31 -0
  54. data/lib/aws-sdk-ssooidc/plugins/endpoints.rb +5 -2
  55. data/lib/aws-sdk-ssooidc/types.rb +302 -49
  56. data/lib/aws-sdk-ssooidc.rb +1 -1
  57. data/lib/aws-sdk-sts/client.rb +158 -122
  58. data/lib/aws-sdk-sts/client_api.rb +12 -1
  59. data/lib/aws-sdk-sts/endpoint_provider.rb +96 -213
  60. data/lib/aws-sdk-sts/endpoints.rb +1 -0
  61. data/lib/aws-sdk-sts/plugins/endpoints.rb +3 -2
  62. data/lib/aws-sdk-sts/presigner.rb +1 -1
  63. data/lib/aws-sdk-sts/types.rb +49 -11
  64. data/lib/aws-sdk-sts.rb +1 -1
  65. data/lib/seahorse/client/configuration.rb +0 -4
  66. data/lib/seahorse/client/h2/connection.rb +10 -6
  67. data/lib/seahorse/client/net_http/patches.rb +1 -4
  68. data/lib/seahorse/client/plugins/h2.rb +3 -3
  69. data/lib/seahorse/client/plugins/request_callback.rb +31 -0
  70. data/lib/seahorse/client/response.rb +6 -0
  71. data/lib/seahorse/model/operation.rb +3 -0
  72. metadata +13 -12
@@ -2,6 +2,11 @@
2
2
 
3
3
  module Aws
4
4
  module Endpoints
5
+ # This class is deprecated. It is used by the Runtime endpoint
6
+ # resolution approach. It has been replaced by a code generated
7
+ # approach in each service gem. It can be removed in a new
8
+ # major version. It has to exist because
9
+ # old service gems can use a new core version.
5
10
  # @api private
6
11
  class ErrorRule < Rule
7
12
  def initialize(type: 'error', conditions:, error: nil, documentation: nil)
@@ -2,6 +2,11 @@
2
2
 
3
3
  module Aws
4
4
  module Endpoints
5
+ # This class is deprecated. It is used by the Runtime endpoint
6
+ # resolution approach. It has been replaced by a code generated
7
+ # approach in each service gem. It can be removed in a new
8
+ # major version. It has to exist because
9
+ # old service gems can use a new core version.
5
10
  # @api private
6
11
  class Function
7
12
  def initialize(fn:, argv:)
@@ -79,11 +79,11 @@ module Aws
79
79
  return false if value.empty?
80
80
 
81
81
  if allow_sub_domains
82
- labels = value.split('.')
82
+ labels = value.split('.', -1)
83
83
  return labels.all? { |l| valid_host_label?(l) }
84
84
  end
85
85
 
86
- value =~ /\A(?!-)[a-zA-Z0-9-]{1,63}(?<!-)\z/
86
+ !!(value =~ /\A(?!-)[a-zA-Z0-9-]{1,63}(?<!-)\z/)
87
87
  end
88
88
 
89
89
  # AWS
@@ -114,13 +114,17 @@ module Aws
114
114
 
115
115
  # aws.isVirtualHostableS3Bucket(value: string, allowSubDomains: bool) bool
116
116
  def self.aws_virtual_hostable_s3_bucket?(value, allow_sub_domains = false)
117
- !!(value.size < 64 &&
118
- # regular naming rules
119
- value =~ /^[a-z0-9][a-z0-9\-#{'.' if allow_sub_domains}]+[a-z0-9]$/ &&
120
- # not IP address
121
- value !~ /(\d+\.){3}\d+/ &&
122
- # no dash and hyphen together
123
- value !~ /[.-]{2}/)
117
+ return false if value.empty?
118
+
119
+ if allow_sub_domains
120
+ labels = value.split('.', -1)
121
+ return labels.all? { |l| aws_virtual_hostable_s3_bucket?(l) }
122
+ end
123
+
124
+ # must be between 3 and 63 characters long, no uppercase
125
+ value =~ /\A(?!-)[a-z0-9-]{3,63}(?<!-)\z/ &&
126
+ # not an IP address
127
+ value !~ /(\d+\.){3}\d+/
124
128
  end
125
129
  end
126
130
  end
@@ -2,6 +2,11 @@
2
2
 
3
3
  module Aws
4
4
  module Endpoints
5
+ # This class is deprecated. It is used by the Runtime endpoint
6
+ # resolution approach. It has been replaced by a code generated
7
+ # approach in each service gem. It can be removed in a new
8
+ # major version. It has to exist because
9
+ # old service gems can use a new core version.
5
10
  # @api private
6
11
  class Reference
7
12
  def initialize(ref:)
@@ -2,6 +2,11 @@
2
2
 
3
3
  module Aws
4
4
  module Endpoints
5
+ # This class is deprecated. It is used by the Runtime endpoint
6
+ # resolution approach. It has been replaced by a code generated
7
+ # approach in each service gem. It can be removed in a new
8
+ # major version. It has to exist because
9
+ # old service gems can use a new core version.
5
10
  # @api private
6
11
  class Rule
7
12
  # Resolves a value that is a function, reference, or template string.
@@ -2,6 +2,11 @@
2
2
 
3
3
  module Aws
4
4
  module Endpoints
5
+ # This class is deprecated. It is used by the Runtime endpoint
6
+ # resolution approach. It has been replaced by a code generated
7
+ # approach in each service gem. It can be removed in a new
8
+ # major version. It has to exist because
9
+ # old service gems can use a new core version.
5
10
  # @api private
6
11
  class RuleSet
7
12
  def initialize(version:, service_id:, parameters:, rules:)
@@ -1,5 +1,10 @@
1
1
  module Aws
2
2
  module Endpoints
3
+ # This class is deprecated. It is used by the Runtime endpoint
4
+ # resolution approach. It has been replaced by a code generated
5
+ # approach in each service gem. It can be removed in a new
6
+ # major version. It has to exist because
7
+ # old service gems can use a new core version.
3
8
  # @api private
4
9
  class RulesProvider
5
10
  def initialize(rule_set)
@@ -3,6 +3,12 @@
3
3
  module Aws
4
4
  module Endpoints
5
5
  # Does substitutions for templated endpoint strings
6
+
7
+ # This class is deprecated. It is used by the Runtime endpoint
8
+ # resolution approach. It has been replaced by a code generated
9
+ # approach in each service gem. It can be removed in a new
10
+ # major version. It has to exist because
11
+ # old service gems can use a new core version.
6
12
  # @api private
7
13
  module Templater
8
14
  class << self
@@ -2,6 +2,11 @@
2
2
 
3
3
  module Aws
4
4
  module Endpoints
5
+ # This class is deprecated. It is used by the Runtime endpoint
6
+ # resolution approach. It has been replaced by a code generated
7
+ # approach in each service gem. It can be removed in a new
8
+ # major version. It has to exist because
9
+ # old service gems can use a new core version.
5
10
  # @api private
6
11
  class TreeRule
7
12
  def initialize(type: 'tree', conditions:, rules:, documentation: nil)
@@ -4,6 +4,7 @@ require 'ipaddr'
4
4
 
5
5
  module Aws
6
6
  module Endpoints
7
+
7
8
  # @api private
8
9
  class URL
9
10
  def initialize(url)
@@ -39,7 +39,11 @@ module Aws
39
39
  auth_scheme = { 'name' => 'sigv4' }
40
40
  merge_signing_defaults(auth_scheme, context.config)
41
41
  when 's3', 's3v4'
42
- auth_scheme = { 'name' => 'sigv4', 'disableDoubleEncoding' => true }
42
+ auth_scheme = {
43
+ 'name' => 'sigv4',
44
+ 'disableDoubleEncoding' => true,
45
+ 'disableNormalizePath' => true
46
+ }
43
47
  merge_signing_defaults(auth_scheme, context.config)
44
48
  when 'bearer'
45
49
  { 'name' => 'bearer' }
@@ -49,7 +53,7 @@ module Aws
49
53
  end
50
54
 
51
55
  def merge_signing_defaults(auth_scheme, config)
52
- if %w[sigv4 sigv4a].include?(auth_scheme['name'])
56
+ if %w[sigv4 sigv4a sigv4-s3express].include?(auth_scheme['name'])
53
57
  auth_scheme['signingName'] ||= sigv4_name(config)
54
58
  if auth_scheme['name'] == 'sigv4a'
55
59
  auth_scheme['signingRegionSet'] ||= ['*']
@@ -30,7 +30,7 @@ module Aws
30
30
  attr_reader :context
31
31
 
32
32
  # @return [Aws::Structure]
33
- attr_reader :data
33
+ attr_accessor :data
34
34
 
35
35
  class << self
36
36
 
@@ -8,6 +8,8 @@ module Aws
8
8
  def ini_parse(raw)
9
9
  current_profile = nil
10
10
  current_prefix = nil
11
+ item = nil
12
+ previous_item = nil
11
13
  raw.lines.inject({}) do |acc, line|
12
14
  line = line.split(/^|\s;/).first # remove comments
13
15
  profile = line.match(/^\[([^\[\]]+)\]\s*(#.+)?$/) unless line.nil?
@@ -17,11 +19,16 @@ module Aws
17
19
  current_profile = named_profile[1] if named_profile
18
20
  elsif current_profile
19
21
  unless line.nil?
22
+ previous_item = item
20
23
  item = line.match(/^(.+?)\s*=\s*(.+?)\s*$/)
21
24
  prefix = line.match(/^(.+?)\s*=\s*$/)
22
25
  end
23
26
  if item && item[1].match(/^\s+/)
24
27
  # Need to add lines to a nested configuration.
28
+ if current_prefix.nil? && previous_item[2].strip.empty?
29
+ current_prefix = previous_item[1]
30
+ acc[current_profile][current_prefix] = {}
31
+ end
25
32
  inner_item = line.match(/^\s*(.+?)\s*=\s*(.+?)\s*$/)
26
33
  acc[current_profile] ||= {}
27
34
  acc[current_profile][current_prefix] ||= {}
@@ -53,6 +53,8 @@ module Aws
53
53
  # @option options [String] :endpoint_mode ('IPv4') The endpoint mode for
54
54
  # the instance metadata service. This is either 'IPv4' ('169.254.169.254')
55
55
  # or 'IPv6' ('[fd00:ec2::254]').
56
+ # @option options [Boolean] :disable_imds_v1 (false) Disable the use of the
57
+ # legacy EC2 Metadata Service v1.
56
58
  # @option options [String] :ip_address ('169.254.169.254') Deprecated. Use
57
59
  # :endpoint instead. The IP address for the endpoint.
58
60
  # @option options [Integer] :port (80)
@@ -77,6 +79,9 @@ module Aws
77
79
  endpoint_mode = resolve_endpoint_mode(options)
78
80
  @endpoint = resolve_endpoint(options, endpoint_mode)
79
81
  @port = options[:port] || 80
82
+ @disable_imds_v1 = resolve_disable_v1(options)
83
+ # Flag for if v2 flow fails, skip future attempts
84
+ @imds_v1_fallback = false
80
85
  @http_open_timeout = options[:http_open_timeout] || 1
81
86
  @http_read_timeout = options[:http_read_timeout] || 1
82
87
  @http_debug_output = options[:http_debug_output]
@@ -123,6 +128,16 @@ module Aws
123
128
  end
124
129
  end
125
130
 
131
+ def resolve_disable_v1(options)
132
+ value = options[:disable_imds_v1]
133
+ value ||= ENV['AWS_EC2_METADATA_V1_DISABLED']
134
+ value ||= Aws.shared_config.ec2_metadata_v1_disabled(
135
+ profile: options[:profile]
136
+ )
137
+ value = value.to_s.downcase if value
138
+ Aws::Util.str_2_bool(value) || false
139
+ end
140
+
126
141
  def backoff(backoff)
127
142
  case backoff
128
143
  when Proc then backoff
@@ -141,7 +156,7 @@ module Aws
141
156
  # service is responding but is returning invalid JSON documents
142
157
  # in response to the GET profile credentials call.
143
158
  begin
144
- retry_errors([Aws::Json::ParseError, StandardError], max_retries: 3) do
159
+ retry_errors([Aws::Json::ParseError], max_retries: 3) do
145
160
  c = Aws::Json.load(get_credentials.to_s)
146
161
  if empty_credentials?(@credentials)
147
162
  @credentials = Credentials.new(
@@ -173,7 +188,6 @@ module Aws
173
188
  end
174
189
  end
175
190
  end
176
-
177
191
  end
178
192
  rescue Aws::Json::ParseError
179
193
  raise Aws::Errors::MetadataParserError
@@ -191,34 +205,14 @@ module Aws
191
205
  open_connection do |conn|
192
206
  # attempt to fetch token to start secure flow first
193
207
  # and rescue to failover
194
- begin
195
- retry_errors(NETWORK_ERRORS, max_retries: @retries) do
196
- unless token_set?
197
- created_time = Time.now
198
- token_value, ttl = http_put(
199
- conn, METADATA_TOKEN_PATH, @token_ttl
200
- )
201
- @token = Token.new(token_value, ttl, created_time) if token_value && ttl
202
- end
203
- end
204
- rescue *NETWORK_ERRORS
205
- # token attempt failed, reset token
206
- # fallback to non-token mode
207
- @token = nil
208
- end
209
-
208
+ fetch_token(conn) unless @imds_v1_fallback
210
209
  token = @token.value if token_set?
211
210
 
212
- begin
213
- metadata = http_get(conn, METADATA_PATH_BASE, token)
214
- profile_name = metadata.lines.first.strip
215
- http_get(conn, METADATA_PATH_BASE + profile_name, token)
216
- rescue TokenExpiredError
217
- # Token has expired, reset it
218
- # The next retry should fetch it
219
- @token = nil
220
- raise Non200Response
221
- end
211
+ # disable insecure flow if we couldn't get token
212
+ # and imds v1 is disabled
213
+ raise TokenRetrivalError if token.nil? && @disable_imds_v1
214
+
215
+ _get_credentials(conn, token)
222
216
  end
223
217
  end
224
218
  rescue
@@ -227,6 +221,36 @@ module Aws
227
221
  end
228
222
  end
229
223
 
224
+ def fetch_token(conn)
225
+ retry_errors(NETWORK_ERRORS, max_retries: @retries) do
226
+ unless token_set?
227
+ created_time = Time.now
228
+ token_value, ttl = http_put(
229
+ conn, METADATA_TOKEN_PATH, @token_ttl
230
+ )
231
+ @token = Token.new(token_value, ttl, created_time) if token_value && ttl
232
+ end
233
+ end
234
+ rescue *NETWORK_ERRORS
235
+ # token attempt failed, reset token
236
+ # fallback to non-token mode
237
+ @token = nil
238
+ @imds_v1_fallback = true
239
+ end
240
+
241
+ # token is optional - if nil, uses v1 (insecure) flow
242
+ def _get_credentials(conn, token)
243
+ metadata = http_get(conn, METADATA_PATH_BASE, token)
244
+ profile_name = metadata.lines.first.strip
245
+ http_get(conn, METADATA_PATH_BASE + profile_name, token)
246
+ rescue TokenExpiredError
247
+ # Token has expired, reset it
248
+ # The next retry should fetch it
249
+ @token = nil
250
+ @imds_v1_fallback = false
251
+ raise Non200Response
252
+ end
253
+
230
254
  def token_set?
231
255
  @token && !@token.expired?
232
256
  end
@@ -276,8 +300,6 @@ module Aws
276
300
  ]
277
301
  when 400
278
302
  raise TokenRetrivalError
279
- when 401
280
- raise TokenExpiredError
281
303
  else
282
304
  raise Non200Response
283
305
  end
@@ -26,11 +26,13 @@ module Aws
26
26
  end
27
27
 
28
28
  def error_code(json, context)
29
- code = if aws_query_error?(context)
30
- context.http_response.headers['x-amzn-query-error'].split(';')[0]
31
- else
32
- json['__type']
33
- end
29
+ code =
30
+ if aws_query_error?(context)
31
+ error = context.http_response.headers['x-amzn-query-error'].split(';')[0]
32
+ remove_prefix(error, context)
33
+ else
34
+ json['__type']
35
+ end
34
36
  code ||= json['code']
35
37
  code ||= context.http_response.headers['x-amzn-errortype']
36
38
  if code
@@ -45,6 +47,14 @@ module Aws
45
47
  context.http_response.headers['x-amzn-query-error']
46
48
  end
47
49
 
50
+ def remove_prefix(error_code, context)
51
+ if prefix = context.config.api.metadata['errorPrefix']
52
+ error_code.sub(/^#{prefix}/, '')
53
+ else
54
+ error_code
55
+ end
56
+ end
57
+
48
58
  def error_message(code, json)
49
59
  if code == 'RequestEntityTooLarge'
50
60
  'Request body must be less than 1 MB'
@@ -59,7 +59,10 @@ module Aws
59
59
  end
60
60
  resp_struct
61
61
  else
62
- Parser.new(rules).parse(json == '' ? '{}' : json)
62
+ Parser.new(
63
+ rules,
64
+ query_compatible: query_compatible?(context)
65
+ ).parse(json == '' ? '{}' : json)
63
66
  end
64
67
  else
65
68
  EmptyStructure.new
@@ -83,6 +86,10 @@ module Aws
83
86
  context.config.simple_json
84
87
  end
85
88
 
89
+ def query_compatible?(context)
90
+ context.config.api.metadata.key?('awsQueryCompatible')
91
+ end
92
+
86
93
  end
87
94
  end
88
95
  end
@@ -10,8 +10,9 @@ module Aws
10
10
  include Seahorse::Model::Shapes
11
11
 
12
12
  # @param [Seahorse::Model::ShapeRef] rules
13
- def initialize(rules)
13
+ def initialize(rules, query_compatible: false)
14
14
  @rules = rules
15
+ @query_compatible = query_compatible
15
16
  end
16
17
 
17
18
  # @param [String<JSON>] json
@@ -28,10 +29,26 @@ module Aws
28
29
  member_name, member_ref = shape.member_by_location_name(key)
29
30
  if member_ref
30
31
  target[member_name] = parse_ref(member_ref, value)
31
- elsif shape.union
32
+ elsif shape.union && key != '__type'
32
33
  target[:unknown] = { 'name' => key, 'value' => value }
33
34
  end
34
35
  end
36
+ # In services that were previously Query/XML, members that were
37
+ # "flattened" defaulted to empty lists. In JSON, these values are nil,
38
+ # which is backwards incompatible. To preserve backwards compatibility,
39
+ # we set a default value of [] for these members.
40
+ if @query_compatible
41
+ ref.shape.members.each do |member_name, member_target|
42
+ next unless target[member_name].nil?
43
+
44
+ if flattened_list?(member_target.shape)
45
+ target[member_name] = []
46
+ elsif flattened_map?(member_target.shape)
47
+ target[member_name] = {}
48
+ end
49
+ end
50
+ end
51
+
35
52
  if shape.union
36
53
  # convert to subclass
37
54
  member_subclass = shape.member_subclass(target.member).new
@@ -79,6 +96,14 @@ module Aws
79
96
  value.is_a?(Numeric) ? Time.at(value) : Time.parse(value)
80
97
  end
81
98
 
99
+ def flattened_list?(shape)
100
+ shape.is_a?(ListShape) && shape.flattened
101
+ end
102
+
103
+ def flattened_map?(shape)
104
+ shape.is_a?(MapShape) && shape.flattened
105
+ end
106
+
82
107
  end
83
108
  end
84
109
  end
@@ -26,6 +26,8 @@ module Aws
26
26
  #
27
27
  # You can put any of these placeholders into you pattern.
28
28
  #
29
+ # * `:region` - The region configured for the client.
30
+ #
29
31
  # * `:client_class` - The name of the client class.
30
32
  #
31
33
  # * `:operation` - The name of the client request method.
@@ -116,6 +118,10 @@ module Aws
116
118
 
117
119
  private
118
120
 
121
+ def _region(response)
122
+ response.context.config.region
123
+ end
124
+
119
125
  def _client_class(response)
120
126
  response.context.client.class.name
121
127
  end
@@ -201,7 +201,9 @@ module Aws
201
201
  def next_response(params)
202
202
  params = next_page_params(params)
203
203
  request = context.client.build_request(context.operation_name, params)
204
- request.send_request
204
+ Aws::Plugins::UserAgent.feature('paginator') do
205
+ request.send_request
206
+ end
205
207
  end
206
208
 
207
209
  def next_page_params(params)
@@ -6,7 +6,7 @@ module Aws
6
6
 
7
7
  include Seahorse::Model::Shapes
8
8
 
9
- EXPECTED_GOT = "expected %s to be %s, got value %s (class: %s) instead."
9
+ EXPECTED_GOT = 'expected %s to be %s, got class %s instead.'
10
10
 
11
11
  # @param [Seahorse::Model::Shapes::ShapeRef] rules
12
12
  # @param [Hash] params
@@ -230,7 +230,7 @@ module Aws
230
230
  end
231
231
 
232
232
  def expected_got(context, expected, got)
233
- EXPECTED_GOT % [context, expected, got.inspect, got.class.name]
233
+ EXPECTED_GOT % [context, expected, got.class.name]
234
234
  end
235
235
 
236
236
  end
@@ -117,7 +117,8 @@ module Aws
117
117
 
118
118
  def call(context)
119
119
  if should_calculate_request_checksum?(context)
120
- request_algorithm_input = ChecksumAlgorithm.request_algorithm_selection(context)
120
+ request_algorithm_input = ChecksumAlgorithm.request_algorithm_selection(context) ||
121
+ context[:default_request_checksum_algorithm]
121
122
  context[:checksum_algorithms] = request_algorithm_input
122
123
 
123
124
  request_checksum_property = {
@@ -140,7 +141,8 @@ module Aws
140
141
 
141
142
  def should_calculate_request_checksum?(context)
142
143
  context.operation.http_checksum &&
143
- ChecksumAlgorithm.request_algorithm_selection(context)
144
+ (ChecksumAlgorithm.request_algorithm_selection(context) ||
145
+ context[:default_request_checksum_algorithm])
144
146
  end
145
147
 
146
148
  def should_verify_response_checksum?(context)
@@ -314,7 +316,7 @@ module Aws
314
316
  @io.rewind
315
317
  end
316
318
 
317
- def read(length, buf)
319
+ def read(length, buf = nil)
318
320
  # account for possible leftover bytes at the end, if we have trailer bytes, send them
319
321
  if @trailer_io
320
322
  return @trailer_io.read(length, buf)
@@ -12,7 +12,8 @@ module Aws
12
12
 
13
13
  def call(context)
14
14
  if checksum_required?(context) &&
15
- !context[:checksum_algorithms] # skip in favor of flexible checksum
15
+ !context[:checksum_algorithms] && # skip in favor of flexible checksum
16
+ !context[:s3_express_endpoint] # s3 express endpoints do not support md5
16
17
  body = context.http_request.body
17
18
  context.http_request.headers['Content-Md5'] ||= md5(body)
18
19
  end