aws-sdk-core 3.105.0 → 3.130.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1304 -0
  3. data/LICENSE.txt +202 -0
  4. data/VERSION +1 -1
  5. data/lib/aws-defaults/default_configuration.rb +153 -0
  6. data/lib/aws-defaults/defaults_mode_config_resolver.rb +107 -0
  7. data/lib/aws-defaults.rb +3 -0
  8. data/lib/aws-sdk-core/arn.rb +13 -0
  9. data/lib/aws-sdk-core/assume_role_credentials.rb +20 -1
  10. data/lib/aws-sdk-core/assume_role_web_identity_credentials.rb +9 -4
  11. data/lib/aws-sdk-core/client_stubs.rb +5 -1
  12. data/lib/aws-sdk-core/credential_provider_chain.rb +2 -1
  13. data/lib/aws-sdk-core/ec2_metadata.rb +238 -0
  14. data/lib/aws-sdk-core/ecs_credentials.rb +5 -0
  15. data/lib/aws-sdk-core/errors.rb +6 -2
  16. data/lib/aws-sdk-core/instance_profile_credentials.rb +119 -18
  17. data/lib/aws-sdk-core/json/json_engine.rb +10 -8
  18. data/lib/aws-sdk-core/json/oj_engine.rb +33 -6
  19. data/lib/aws-sdk-core/json/parser.rb +8 -0
  20. data/lib/aws-sdk-core/json.rb +8 -26
  21. data/lib/aws-sdk-core/log/formatter.rb +1 -1
  22. data/lib/aws-sdk-core/log/param_filter.rb +9 -1
  23. data/lib/aws-sdk-core/pageable_response.rb +72 -26
  24. data/lib/aws-sdk-core/pager.rb +3 -0
  25. data/lib/aws-sdk-core/param_validator.rb +29 -0
  26. data/lib/aws-sdk-core/plugins/checksum_algorithm.rb +340 -0
  27. data/lib/aws-sdk-core/plugins/credentials_configuration.rb +3 -1
  28. data/lib/aws-sdk-core/plugins/defaults_mode.rb +40 -0
  29. data/lib/aws-sdk-core/plugins/endpoint_pattern.rb +6 -6
  30. data/lib/aws-sdk-core/plugins/http_checksum.rb +8 -1
  31. data/lib/aws-sdk-core/plugins/protocols/api_gateway.rb +17 -0
  32. data/lib/aws-sdk-core/plugins/protocols/rest_json.rb +16 -1
  33. data/lib/aws-sdk-core/plugins/recursion_detection.rb +27 -0
  34. data/lib/aws-sdk-core/plugins/regional_endpoint.rb +48 -2
  35. data/lib/aws-sdk-core/plugins/response_paging.rb +1 -1
  36. data/lib/aws-sdk-core/plugins/retries/error_inspector.rb +5 -3
  37. data/lib/aws-sdk-core/plugins/retry_errors.rb +25 -8
  38. data/lib/aws-sdk-core/plugins/signature_v4.rb +15 -24
  39. data/lib/aws-sdk-core/plugins/stub_responses.rb +5 -1
  40. data/lib/aws-sdk-core/process_credentials.rb +3 -2
  41. data/lib/aws-sdk-core/refreshing_credentials.rb +42 -11
  42. data/lib/aws-sdk-core/rest/request/body.rb +19 -1
  43. data/lib/aws-sdk-core/rest/request/headers.rb +18 -6
  44. data/lib/aws-sdk-core/rest/response/headers.rb +3 -1
  45. data/lib/aws-sdk-core/shared_config.rb +28 -8
  46. data/lib/aws-sdk-core/shared_credentials.rb +7 -1
  47. data/lib/aws-sdk-core/sso_credentials.rb +35 -10
  48. data/lib/aws-sdk-core/structure.rb +10 -1
  49. data/lib/aws-sdk-core/stubbing/protocols/json.rb +1 -1
  50. data/lib/aws-sdk-core/stubbing/protocols/rest_json.rb +1 -1
  51. data/lib/aws-sdk-core/stubbing/protocols/rest_xml.rb +0 -2
  52. data/lib/aws-sdk-core/xml/builder.rb +2 -2
  53. data/lib/aws-sdk-core/xml/doc_builder.rb +6 -1
  54. data/lib/aws-sdk-core/xml/parser/engines/ox.rb +1 -1
  55. data/lib/aws-sdk-core/xml/parser/frame.rb +23 -0
  56. data/lib/aws-sdk-core/xml/parser.rb +5 -0
  57. data/lib/aws-sdk-core.rb +11 -3
  58. data/lib/aws-sdk-sso/client.rb +28 -6
  59. data/lib/aws-sdk-sso/client_api.rb +1 -1
  60. data/lib/aws-sdk-sso/errors.rb +1 -1
  61. data/lib/aws-sdk-sso/resource.rb +1 -1
  62. data/lib/aws-sdk-sso/types.rb +1 -1
  63. data/lib/aws-sdk-sso.rb +7 -4
  64. data/lib/aws-sdk-sts/client.rb +515 -429
  65. data/lib/aws-sdk-sts/client_api.rb +7 -1
  66. data/lib/aws-sdk-sts/errors.rb +1 -1
  67. data/lib/aws-sdk-sts/plugins/sts_regional_endpoints.rb +5 -1
  68. data/lib/aws-sdk-sts/presigner.rb +7 -1
  69. data/lib/aws-sdk-sts/resource.rb +1 -1
  70. data/lib/aws-sdk-sts/types.rb +332 -193
  71. data/lib/aws-sdk-sts.rb +7 -2
  72. data/lib/seahorse/client/configuration.rb +4 -0
  73. data/lib/seahorse/client/h2/connection.rb +15 -13
  74. data/lib/seahorse/client/h2/handler.rb +4 -5
  75. data/lib/seahorse/client/net_http/connection_pool.rb +7 -0
  76. data/lib/seahorse/client/net_http/handler.rb +17 -8
  77. data/lib/seahorse/client/net_http/patches.rb +13 -84
  78. data/lib/seahorse/client/plugins/content_length.rb +11 -5
  79. data/lib/seahorse/client/plugins/h2.rb +4 -1
  80. data/lib/seahorse/client/plugins/net_http.rb +37 -3
  81. data/lib/seahorse/client/plugins/response_target.rb +0 -1
  82. data/lib/seahorse/model/operation.rb +3 -0
  83. data/lib/seahorse/model/shapes.rb +25 -0
  84. data/lib/seahorse/util.rb +6 -1
  85. metadata +17 -10
  86. data/lib/aws-sdk-sso/plugins/content_type.rb +0 -25
data/lib/aws-sdk-sts.rb CHANGED
@@ -3,11 +3,16 @@
3
3
  # WARNING ABOUT GENERATED CODE
4
4
  #
5
5
  # This file is generated. See the contributing guide for more information:
6
- # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
7
  #
8
8
  # WARNING ABOUT GENERATED CODE
9
9
 
10
10
 
11
+ unless Module.const_defined?(:Aws)
12
+ require 'aws-sdk-core'
13
+ require 'aws-sigv4'
14
+ end
15
+
11
16
  require_relative 'aws-sdk-sts/types'
12
17
  require_relative 'aws-sdk-sts/client_api'
13
18
  require_relative 'aws-sdk-sts/client'
@@ -45,6 +50,6 @@ require_relative 'aws-sdk-sts/customizations'
45
50
  # @!group service
46
51
  module Aws::STS
47
52
 
48
- GEM_VERSION = '3.105.0'
53
+ GEM_VERSION = '3.130.2'
49
54
 
50
55
  end
@@ -195,6 +195,10 @@ module Seahorse
195
195
  @members.include?(method_name) or super
196
196
  end
197
197
 
198
+ def override_config(k, v)
199
+ @struct[k] = v
200
+ end
201
+
198
202
  private
199
203
 
200
204
  def value_at(opt_name)
@@ -1,10 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- if RUBY_VERSION >= '2.1'
4
- begin
5
- require 'http/2'
6
- rescue LoadError; end
7
- end
3
+ begin
4
+ require 'http/2'
5
+ rescue LoadError; end
8
6
  require 'openssl'
9
7
  require 'socket'
10
8
 
@@ -75,18 +73,23 @@ module Seahorse
75
73
  def connect(endpoint)
76
74
  @mutex.synchronize {
77
75
  if @status == :ready
78
- tcp, addr = _tcp_socket(endpoint)
76
+ tcp, addr = _tcp_socket(endpoint)
79
77
  debug_output("opening connection to #{endpoint.host}:#{endpoint.port} ...")
80
78
  _nonblocking_connect(tcp, addr)
81
79
  debug_output('opened')
82
80
 
83
- @socket = OpenSSL::SSL::SSLSocket.new(tcp, _tls_context)
84
- @socket.sync_close = true
85
- @socket.hostname = endpoint.host
81
+ if endpoint.scheme == 'https'
82
+ @socket = OpenSSL::SSL::SSLSocket.new(tcp, _tls_context)
83
+ @socket.sync_close = true
84
+ @socket.hostname = endpoint.host
85
+
86
+ debug_output("starting TLS for #{endpoint.host}:#{endpoint.port} ...")
87
+ @socket.connect
88
+ debug_output('TLS established')
89
+ else
90
+ @socket = tcp
91
+ end
86
92
 
87
- debug_output("starting TLS for #{endpoint.host}:#{endpoint.port} ...")
88
- @socket.connect
89
- debug_output('TLS established')
90
93
  _register_h2_callbacks
91
94
  @status = :active
92
95
  elsif @status == :closed
@@ -245,4 +248,3 @@ module Seahorse
245
248
  end
246
249
  end
247
250
  end
248
-
@@ -1,10 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- if RUBY_VERSION >= '2.1'
4
- begin
5
- require 'http/2'
6
- rescue LoadError; end
7
- end
3
+ begin
4
+ require 'http/2'
5
+ rescue LoadError; end
6
+
8
7
  require 'securerandom'
9
8
 
10
9
  module Seahorse
@@ -34,6 +34,7 @@ module Seahorse
34
34
  ssl_ca_bundle: nil,
35
35
  ssl_ca_directory: nil,
36
36
  ssl_ca_store: nil,
37
+ ssl_timeout: nil
37
38
  }
38
39
 
39
40
  # @api private
@@ -187,6 +188,9 @@ module Seahorse
187
188
  # disables this behaviour. This value can safely be set per
188
189
  # request on the session yielded by {#session_for}.
189
190
  #
191
+ # @option options [Float] :ssl_timeout (nil) Sets the SSL timeout
192
+ # in seconds.
193
+ #
190
194
  # @option options [Boolean] :http_wire_trace (false) When `true`,
191
195
  # HTTP debug output will be sent to the `:logger`.
192
196
  #
@@ -248,6 +252,7 @@ module Seahorse
248
252
  :ssl_ca_bundle => options[:ssl_ca_bundle],
249
253
  :ssl_ca_directory => options[:ssl_ca_directory],
250
254
  :ssl_ca_store => options[:ssl_ca_store],
255
+ :ssl_timeout => options[:ssl_timeout]
251
256
  }
252
257
  end
253
258
 
@@ -285,6 +290,8 @@ module Seahorse
285
290
 
286
291
  if endpoint.scheme == 'https'
287
292
  http.use_ssl = true
293
+ http.ssl_timeout = ssl_timeout
294
+
288
295
  if ssl_verify_peer?
289
296
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
290
297
  http.ca_file = ssl_ca_bundle if ssl_ca_bundle
@@ -25,7 +25,8 @@ module Seahorse
25
25
  SocketError, EOFError, IOError, Timeout::Error,
26
26
  Errno::ECONNABORTED, Errno::ECONNRESET, Errno::EPIPE,
27
27
  Errno::EINVAL, Errno::ETIMEDOUT, OpenSSL::SSL::SSLError,
28
- Errno::EHOSTUNREACH, Errno::ECONNREFUSED
28
+ Errno::EHOSTUNREACH, Errno::ECONNREFUSED,
29
+ Net::HTTPFatalError # for proxy connection failures
29
30
  ]
30
31
 
31
32
  # does not exist in Ruby 1.9.3
@@ -73,8 +74,9 @@ module Seahorse
73
74
  # @return [void]
74
75
  def transmit(config, req, resp)
75
76
  session(config, req) do |http|
77
+ # Monkey patch default content-type set by Net::HTTP
78
+ Thread.current[:net_http_skip_default_content_type] = true
76
79
  http.request(build_net_request(req)) do |net_resp|
77
-
78
80
  status_code = net_resp.code.to_i
79
81
  headers = extract_headers(net_resp)
80
82
 
@@ -95,6 +97,9 @@ module Seahorse
95
97
  rescue => error
96
98
  # not retryable
97
99
  resp.signal_error(error)
100
+ ensure
101
+ # ensure we turn off monkey patch in case of error
102
+ Thread.current[:net_http_skip_default_content_type] = nil
98
103
  end
99
104
 
100
105
  def complete_response(req, resp, bytes_received)
@@ -146,7 +151,12 @@ module Seahorse
146
151
  def build_net_request(request)
147
152
  request_class = net_http_request_class(request)
148
153
  req = request_class.new(request.endpoint.request_uri, headers(request))
149
- req.body_stream = request.body
154
+ # Net::HTTP adds a default Content-Type when a body is present.
155
+ # Set the body stream when it has an unknown size or when it is > 0.
156
+ if !request.body.respond_to?(:size) ||
157
+ (request.body.respond_to?(:size) && request.body.size > 0)
158
+ req.body_stream = request.body
159
+ end
150
160
  req
151
161
  end
152
162
 
@@ -165,14 +175,13 @@ module Seahorse
165
175
  # @return [Hash] Returns a vanilla hash of headers to send with the
166
176
  # HTTP request.
167
177
  def headers(request)
168
- # Net::HTTP adds default headers for content-type to POSTs (1.8.7+)
169
- # and accept-encoding (2.0.0+). Setting a default empty value defeats
170
- # this.
178
+ # Net::HTTP adds a default header for accept-encoding (2.0.0+).
179
+ # Setting a default empty value defeats this.
171
180
  #
172
- # Removing these are necessary for most services to not break request
181
+ # Removing this is necessary for most services to not break request
173
182
  # signatures as well as dynamodb crc32 checks (these fail if the
174
183
  # response is gzipped).
175
- headers = { 'content-type' => '', 'accept-encoding' => '' }
184
+ headers = { 'accept-encoding' => '' }
176
185
  request.headers.each_pair do |key, value|
177
186
  headers[key] = value
178
187
  end
@@ -11,97 +11,26 @@ module Seahorse
11
11
  module Patches
12
12
 
13
13
  def self.apply!
14
+ Net::HTTPGenericRequest.prepend(PatchDefaultContentType)
14
15
  return unless RUBY_VERSION < '2.5'
15
- if RUBY_VERSION >= '2.3'
16
- Net::HTTP::IDEMPOTENT_METHODS_.clear
17
- return
18
- end
19
- # no further patches needed for above versions
20
16
 
21
- if RUBY_VERSION >= '2.0'
22
- Net::HTTP.send(:include, Ruby_2)
23
- Net::HTTP::IDEMPOTENT_METHODS_.clear
24
- elsif RUBY_VERSION >= '1.9.3'
25
- Net::HTTP.send(:include, Ruby_1_9_3)
26
- end
27
- Net::HTTP.send(:alias_method, :old_transport_request, :transport_request)
28
- Net::HTTP.send(:alias_method, :transport_request, :new_transport_request)
17
+ Net::HTTP::IDEMPOTENT_METHODS_.clear
29
18
  end
30
19
 
31
- module Ruby_2
32
- def new_transport_request(req)
33
- count = 0
34
- begin
35
- begin_transport req
36
- res = catch(:response) {
37
- req.exec @socket, @curr_http_version, edit_path(req.path)
38
- begin
39
- res = Net::HTTPResponse.read_new(@socket)
40
- res.decode_content = req.decode_content
41
- end while res.kind_of?(Net::HTTPInformation)
42
-
43
- res.uri = req.uri
44
-
45
- res
46
- }
47
- res.reading_body(@socket, req.response_body_permitted?) {
48
- yield res if block_given?
49
- }
50
- rescue Net::OpenTimeout
51
- raise
52
- rescue Net::ReadTimeout, IOError, EOFError,
53
- Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPIPE,
54
- # avoid a dependency on OpenSSL
55
- defined?(OpenSSL::SSL) ? OpenSSL::SSL::SSLError : IOError,
56
- Timeout::Error => exception
57
- if count == 0 && Net::HTTP::IDEMPOTENT_METHODS_.include?(req.method)
58
- count += 1
59
- @socket.close if @socket and not @socket.closed?
60
- D "Conn close because of error #{exception}, and retry"
61
- if req.body_stream
62
- if req.body_stream.respond_to?(:rewind)
63
- req.body_stream.rewind
64
- else
65
- raise
66
- end
67
- end
68
- retry
69
- end
70
- D "Conn close because of error #{exception}"
71
- @socket.close if @socket and not @socket.closed?
72
- raise
73
- end
74
-
75
- end_transport req, res
76
- res
77
- rescue => exception
78
- D "Conn close because of error #{exception}"
79
- @socket.close if @socket and not @socket.closed?
80
- raise exception
20
+ # For requests with bodys, Net::HTTP sets a default content type of:
21
+ # 'application/x-www-form-urlencoded'
22
+ # There are cases where we should not send content type at all.
23
+ # Even when no body is supplied, Net::HTTP uses a default empty body
24
+ # and sets it anyway. This patch disables the behavior when a Thread
25
+ # local variable is set.
26
+ module PatchDefaultContentType
27
+ def supply_default_content_type
28
+ return if Thread.current[:net_http_skip_default_content_type]
29
+
30
+ super
81
31
  end
82
32
  end
83
33
 
84
- module Ruby_1_9_3
85
- def new_transport_request(req)
86
- begin_transport req
87
- res = catch(:response) {
88
- req.exec @socket, @curr_http_version, edit_path(req.path)
89
- begin
90
- res = Net::HTTPResponse.read_new(@socket)
91
- end while res.kind_of?(Net::HTTPContinue)
92
- res
93
- }
94
- res.reading_body(@socket, req.response_body_permitted?) {
95
- yield res if block_given?
96
- }
97
- end_transport req, res
98
- res
99
- rescue => exception
100
- D "Conn close because of error #{exception}"
101
- @socket.close if @socket and not @socket.closed?
102
- raise exception
103
- end
104
- end
105
34
  end
106
35
  end
107
36
  end
@@ -7,16 +7,22 @@ module Seahorse
7
7
 
8
8
  # @api private
9
9
  class Handler < Client::Handler
10
+ # https://github.com/ruby/net-http/blob/master/lib/net/http/requests.rb
11
+ # Methods without body are forwards compatible, because content-length
12
+ # may be set for requests without body but is technically incorrect.
13
+ METHODS_WITHOUT_BODY = Set.new(
14
+ %w[GET HEAD DELETE OPTIONS TRACE COPY MOVE]
15
+ )
10
16
 
11
17
  def call(context)
12
- # If it's an IO object and not a File / String / String IO
13
- if context.http_request.body.respond_to?(:size)
14
- length = context.http_request.body.size
15
- context.http_request.headers['Content-Length'] = length
18
+ body = context.http_request.body
19
+ method = context.http_request.http_method
20
+ # We use Net::HTTP with body_stream which doesn't do this by default
21
+ if body.respond_to?(:size) && !METHODS_WITHOUT_BODY.include?(method)
22
+ context.http_request.headers['Content-Length'] = body.size
16
23
  end
17
24
  @handler.call(context)
18
25
  end
19
-
20
26
  end
21
27
 
22
28
  handler(Handler, step: :sign, priority: 0)
@@ -28,11 +28,14 @@ Defaults to `true`, raises errors if exist when #wait or #join! is called upon a
28
28
  DOCS
29
29
 
30
30
  # SSL Context
31
- option(:ssl_ca_bundle, default: nil, doc_type: String, docstring: <<-DOCS)
31
+ option(:ssl_ca_bundle, default: nil, doc_type: String, docstring: <<-DOCS) do |cfg|
32
32
  Full path to the SSL certificate authority bundle file that should be used when
33
33
  verifying peer certificates. If you do not pass `:ssl_ca_directory` or `:ssl_ca_bundle`
34
34
  the system default will be used if available.
35
35
  DOCS
36
+ ENV['AWS_CA_BUNDLE'] ||
37
+ Aws.shared_config.ca_bundle(profile: cfg.profile) if cfg.respond_to?(:profile)
38
+ end
36
39
 
37
40
  option(:ssl_ca_directory, default: nil, doc_type: String, docstring: <<-DOCS)
38
41
  Full path of the directory that contains the unbundled SSL certificate authority
@@ -9,9 +9,13 @@ module Seahorse
9
9
 
10
10
  option(:http_proxy, default: nil, doc_type: String, docstring: '')
11
11
 
12
- option(:http_open_timeout, default: 15, doc_type: Integer, docstring: '')
12
+ option(:http_open_timeout, default: 15, doc_type: Integer, docstring: '') do |cfg|
13
+ resolve_http_open_timeout(cfg)
14
+ end
13
15
 
14
- option(:http_read_timeout, default: 60, doc_type: Integer, docstring: '')
16
+ option(:http_read_timeout, default: 60, doc_type: Integer, docstring: '') do |cfg|
17
+ resolve_http_read_timeout(cfg)
18
+ end
15
19
 
16
20
  option(:http_idle_timeout, default: 5, doc_type: Integer, docstring: '')
17
21
 
@@ -21,16 +25,46 @@ module Seahorse
21
25
 
22
26
  option(:ssl_verify_peer, default: true, doc_type: 'Boolean', docstring: '')
23
27
 
24
- option(:ssl_ca_bundle, default: nil, doc_type: String, docstring: '')
28
+ option(:ssl_ca_bundle, doc_type: String, docstring: '') do |cfg|
29
+ ENV['AWS_CA_BUNDLE'] ||
30
+ Aws.shared_config.ca_bundle(profile: cfg.profile) if cfg.respond_to?(:profile)
31
+ end
25
32
 
26
33
  option(:ssl_ca_directory, default: nil, doc_type: String, docstring: '')
27
34
 
28
35
  option(:ssl_ca_store, default: nil, doc_type: String, docstring: '')
29
36
 
37
+ option(:ssl_timeout, default: nil, doc_type: Float, docstring: '') do |cfg|
38
+ resolve_ssl_timeout(cfg)
39
+ end
40
+
30
41
  option(:logger) # for backwards compat
31
42
 
32
43
  handler(Client::NetHttp::Handler, step: :send)
33
44
 
45
+ def self.resolve_http_open_timeout(cfg)
46
+ default_mode_value =
47
+ if cfg.respond_to?(:defaults_mode_config_resolver)
48
+ cfg.defaults_mode_config_resolver.resolve(:http_open_timeout)
49
+ end
50
+ default_mode_value || 15
51
+ end
52
+
53
+ def self.resolve_http_read_timeout(cfg)
54
+ default_mode_value =
55
+ if cfg.respond_to?(:defaults_mode_config_resolver)
56
+ cfg.defaults_mode_config_resolver.resolve(:http_read_timeout)
57
+ end
58
+ default_mode_value || 60
59
+ end
60
+
61
+ def self.resolve_ssl_timeout(cfg)
62
+ default_mode_value =
63
+ if cfg.respond_to?(:defaults_mode_config_resolver)
64
+ cfg.defaults_mode_config_resolver.resolve(:ssl_timeout)
65
+ end
66
+ default_mode_value || nil
67
+ end
34
68
  end
35
69
  end
36
70
  end
@@ -27,7 +27,6 @@ module Seahorse
27
27
  private
28
28
 
29
29
  def add_event_listeners(context, target)
30
- handler = self
31
30
  context.http_response.on_headers(200..299) do
32
31
  # In a fresh response body will be a StringIO
33
32
  # However, when a request is retried we may have
@@ -25,6 +25,9 @@ module Seahorse
25
25
  # @return [Boolean]
26
26
  attr_accessor :http_checksum_required
27
27
 
28
+ # @return [Hash]
29
+ attr_accessor :http_checksum
30
+
28
31
  # @return [Boolean]
29
32
  attr_accessor :deprecated
30
33
 
@@ -61,6 +61,9 @@ module Seahorse
61
61
  # @return [Boolean]
62
62
  attr_accessor :eventheader_type
63
63
 
64
+ # @return [Boolean]
65
+ attr_accessor :document
66
+
64
67
  # @return [String, nil]
65
68
  def location
66
69
  @location || (shape && shape[:location])
@@ -114,6 +117,9 @@ module Seahorse
114
117
  # @return [String, nil]
115
118
  attr_accessor :documentation
116
119
 
120
+ # @return [Boolean]
121
+ attr_accessor :union
122
+
117
123
  # Gets metadata for the given `key`.
118
124
  def [](key)
119
125
  @metadata[key.to_s]
@@ -264,8 +270,27 @@ module Seahorse
264
270
 
265
271
  end
266
272
 
273
+ class UnionShape < StructureShape
274
+ def initialize(options = {})
275
+ @member_subclasses = {}
276
+ super options.merge(union: true)
277
+ end
278
+
279
+ # @api private
280
+ def member_subclass(member)
281
+ @member_subclasses[member]
282
+ end
283
+
284
+ # @api private
285
+ def add_member_subclass(member, subclass)
286
+ @member_subclasses[member] = subclass
287
+ end
288
+ end
289
+
267
290
  class TimestampShape < Shape; end
268
291
 
292
+ class DocumentShape < Shape; end
293
+
269
294
  end
270
295
  end
271
296
  end
data/lib/seahorse/util.rb CHANGED
@@ -6,7 +6,6 @@ module Seahorse
6
6
  # @api private
7
7
  module Util
8
8
  class << self
9
-
10
9
  def uri_escape(string)
11
10
  CGI.escape(string.to_s.encode('UTF-8')).gsub('+', '%20').gsub('%7E', '~')
12
11
  end
@@ -15,6 +14,12 @@ module Seahorse
15
14
  path.gsub(/[^\/]+/) { |part| uri_escape(part) }
16
15
  end
17
16
 
17
+ # Checks for a valid host label
18
+ # @see https://tools.ietf.org/html/rfc3986#section-3.2.2
19
+ # @see https://tools.ietf.org/html/rfc1123#page-13
20
+ def host_label?(str)
21
+ str =~ /^(?!-)[a-zA-Z0-9-]{1,63}(?<!-)$/
22
+ end
18
23
  end
19
24
  end
20
25
  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.105.0
4
+ version: 3.130.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-08-25 00:00:00.000000000 Z
11
+ date: 2022-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '1'
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: 1.239.0
36
+ version: 1.525.0
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '1'
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 1.239.0
46
+ version: 1.525.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: aws-sigv4
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -85,8 +85,13 @@ executables: []
85
85
  extensions: []
86
86
  extra_rdoc_files: []
87
87
  files:
88
+ - CHANGELOG.md
89
+ - LICENSE.txt
88
90
  - VERSION
89
91
  - ca-bundle.crt
92
+ - lib/aws-defaults.rb
93
+ - lib/aws-defaults/default_configuration.rb
94
+ - lib/aws-defaults/defaults_mode_config_resolver.rb
90
95
  - lib/aws-sdk-core.rb
91
96
  - lib/aws-sdk-core/arn.rb
92
97
  - lib/aws-sdk-core/arn_parser.rb
@@ -108,6 +113,7 @@ files:
108
113
  - lib/aws-sdk-core/credentials.rb
109
114
  - lib/aws-sdk-core/deprecations.rb
110
115
  - lib/aws-sdk-core/eager_loader.rb
116
+ - lib/aws-sdk-core/ec2_metadata.rb
111
117
  - lib/aws-sdk-core/ecs_credentials.rb
112
118
  - lib/aws-sdk-core/endpoint_cache.rb
113
119
  - lib/aws-sdk-core/errors.rb
@@ -133,9 +139,11 @@ files:
133
139
  - lib/aws-sdk-core/plugins/apig_authorizer_token.rb
134
140
  - lib/aws-sdk-core/plugins/apig_credentials_configuration.rb
135
141
  - lib/aws-sdk-core/plugins/apig_user_agent.rb
142
+ - lib/aws-sdk-core/plugins/checksum_algorithm.rb
136
143
  - lib/aws-sdk-core/plugins/client_metrics_plugin.rb
137
144
  - lib/aws-sdk-core/plugins/client_metrics_send_plugin.rb
138
145
  - lib/aws-sdk-core/plugins/credentials_configuration.rb
146
+ - lib/aws-sdk-core/plugins/defaults_mode.rb
139
147
  - lib/aws-sdk-core/plugins/endpoint_discovery.rb
140
148
  - lib/aws-sdk-core/plugins/endpoint_pattern.rb
141
149
  - lib/aws-sdk-core/plugins/event_stream_configuration.rb
@@ -154,6 +162,7 @@ files:
154
162
  - lib/aws-sdk-core/plugins/protocols/query.rb
155
163
  - lib/aws-sdk-core/plugins/protocols/rest_json.rb
156
164
  - lib/aws-sdk-core/plugins/protocols/rest_xml.rb
165
+ - lib/aws-sdk-core/plugins/recursion_detection.rb
157
166
  - lib/aws-sdk-core/plugins/regional_endpoint.rb
158
167
  - lib/aws-sdk-core/plugins/response_paging.rb
159
168
  - lib/aws-sdk-core/plugins/retries/client_rate_limiter.rb
@@ -227,7 +236,6 @@ files:
227
236
  - lib/aws-sdk-sso/client_api.rb
228
237
  - lib/aws-sdk-sso/customizations.rb
229
238
  - lib/aws-sdk-sso/errors.rb
230
- - lib/aws-sdk-sso/plugins/content_type.rb
231
239
  - lib/aws-sdk-sso/resource.rb
232
240
  - lib/aws-sdk-sso/types.rb
233
241
  - lib/aws-sdk-sts.rb
@@ -287,8 +295,8 @@ homepage: https://github.com/aws/aws-sdk-ruby
287
295
  licenses:
288
296
  - Apache-2.0
289
297
  metadata:
290
- source_code_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-core
291
- changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-core/CHANGELOG.md
298
+ source_code_uri: https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-core
299
+ changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-core/CHANGELOG.md
292
300
  post_install_message:
293
301
  rdoc_options: []
294
302
  require_paths:
@@ -297,15 +305,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
297
305
  requirements:
298
306
  - - ">="
299
307
  - !ruby/object:Gem::Version
300
- version: '0'
308
+ version: '2.3'
301
309
  required_rubygems_version: !ruby/object:Gem::Requirement
302
310
  requirements:
303
311
  - - ">="
304
312
  - !ruby/object:Gem::Version
305
313
  version: '0'
306
314
  requirements: []
307
- rubyforge_project:
308
- rubygems_version: 2.7.6.2
315
+ rubygems_version: 3.1.6
309
316
  signing_key:
310
317
  specification_version: 4
311
318
  summary: AWS SDK for Ruby - Core
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Aws
4
- module SSO
5
- module Plugins
6
- class ContentType < Seahorse::Client::Plugin
7
-
8
- def add_handlers(handlers, config)
9
- handlers.add(Handler)
10
- end
11
-
12
- class Handler < Seahorse::Client::Handler
13
- def call(context)
14
- # Some SSO operations break when given an empty content-type header.
15
- # The SDK adds this blank content-type header
16
- # since Net::HTTP provides a default that can break services.
17
- # We're setting one here even though it's not used or necessary.
18
- context.http_request.headers['content-type'] = 'application/json'
19
- @handler.call(context)
20
- end
21
- end
22
- end
23
- end
24
- end
25
- end