aws-sdk-core 3.196.1 → 3.198.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b77f2eeb94a52526e385b422b59703e582c75af70402ab009b66d542694259c8
4
- data.tar.gz: e97d33313f38d3b6dd565a02b3c1ccdc34d5960cd076ace3449fe50f7f75f2b6
3
+ metadata.gz: 2b0adce6eef1d5e8601f303dec4bd1cf5ead7dfecafed0130061f6649ec778e9
4
+ data.tar.gz: 6cee7400cd7a7da15cdfd7a834a9a124c6bf46eb1169a6652d3355ec91d5a0df
5
5
  SHA512:
6
- metadata.gz: 2efdc811c495c91558cf5144599eff67f2e828a94d90d4fd31d49575a9bff4456e7f237aa79853cdb6f8fba016b9011cc8f6d8677596c85a9e6179f606431961
7
- data.tar.gz: e933ae0dc9b2d77e0455a1af5f5c635833b394ec2f70f90133af52993992134b56481952124d5a2448182a6c180c4cb1483114667ea5d2437891e22a739e3f44
6
+ metadata.gz: 3e1f493384514d0f4f23b38b8869a6714dd20389f74ee382b66dc381d6483fef41e31a058a5473a434a182b00e92d3933d6112ed9de413eb91fe0547d65a3801
7
+ data.tar.gz: dafb321f4b580a86eeb35f180dbac05efab41255c46355c85824256d066ee73c27bd4656d6ad5d07c7ada8af84937a9dcdc47d49d7ce16a5104ea7a9a802b385
data/CHANGELOG.md CHANGED
@@ -1,6 +1,36 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 3.198.0 (2024-06-24)
5
+ ------------------
6
+
7
+ * Feature - Updated Aws::STS::Client with the latest API changes.
8
+
9
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
10
+
11
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
12
+
13
+ * Feature - Support `:plugins` option on all Clients or using `Aws.config[:plugins]`.
14
+
15
+ 3.197.2 (2024-06-20)
16
+ ------------------
17
+
18
+ * Issue - fix issue in Endpoint `attr` matcher when path is only an array index.
19
+
20
+ * Issue - Fix trailing slash in endpoint URLs for rest-json and rest-xml services.
21
+
22
+ 3.197.1 (2024-06-19)
23
+ ------------------
24
+
25
+ * Issue - Support an array of string arguments for `Aws::ProcessCredentials` to be executed by `system`.
26
+
27
+ 3.197.0 (2024-06-05)
28
+ ------------------
29
+
30
+ * Issue - Ensure no UTC offset when deserializing `iso8601` timestamp format values.
31
+
32
+ * Feature - Bump User Agent to version 2.1 to track business metrics. This changes the User Agent plugin order to be just before sending.
33
+
4
34
  3.196.1 (2024-05-14)
5
35
  ------------------
6
36
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.196.1
1
+ 3.198.0
@@ -28,7 +28,11 @@ module Aws
28
28
 
29
29
  val = if (index = parts.first[BRACKET_REGEX, 1])
30
30
  # remove brackets and index from part before indexing
31
- value[parts.first.gsub(BRACKET_REGEX, '')][index.to_i]
31
+ if (base = parts.first.gsub(BRACKET_REGEX, '')) && !base.empty?
32
+ value[base][index.to_i]
33
+ else
34
+ value[index.to_i]
35
+ end
32
36
  else
33
37
  value[parts.first]
34
38
  end
@@ -201,7 +201,7 @@ 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
- Aws::Plugins::UserAgent.feature('paginator') do
204
+ Aws::Plugins::UserAgent.metric('PAGINATOR') do
205
205
  request.send_request
206
206
  end
207
207
  end
@@ -11,6 +11,8 @@ module Aws
11
11
  # AttemptHandler comes just before we would retry an error.
12
12
  # Or before we would follow redirects.
13
13
  handlers.add(AttemptHandler, step: :sign, priority: 39)
14
+ # ErrorHandler comes after we have parsed an error.
15
+ handlers.add(ErrorHandler, step: :sign, priority: 95)
14
16
  # LatencyHandler is as close to sending as possible.
15
17
  handlers.add(LatencyHandler, step: :sign, priority: 0)
16
18
  end
@@ -62,17 +64,27 @@ module Aws
62
64
  call_attempt.x_amzn_request_id = headers["x-amzn-request-id"]
63
65
  end
64
66
  call_attempt.http_status_code = context.http_response.status_code
65
- if e = resp.error
67
+ context.metadata[:current_call_attempt] = call_attempt
68
+ request_metrics.add_call_attempt(call_attempt)
69
+ resp
70
+ end
71
+ end
72
+
73
+ class ErrorHandler < Seahorse::Client::Handler
74
+ def call(context)
75
+ resp = @handler.call(context)
76
+ call_attempt = context.metadata[:current_call_attempt]
77
+ if (e = resp.error)
66
78
  e_name = _extract_error_name(e)
67
79
  e_msg = e.message
68
80
  call_attempt.aws_exception = "#{e_name}"
69
81
  call_attempt.aws_exception_msg = "#{e_msg}"
70
82
  end
71
- request_metrics.add_call_attempt(call_attempt)
72
83
  resp
73
84
  end
74
85
 
75
86
  private
87
+
76
88
  def _extract_error_name(error)
77
89
  if error.is_a?(Aws::Errors::ServiceError)
78
90
  error.class.code
@@ -43,7 +43,7 @@ module Aws
43
43
  # @api private
44
44
  class GlobalConfiguration < Seahorse::Client::Plugin
45
45
 
46
- @identifiers = Set.new()
46
+ @identifiers = Set.new
47
47
 
48
48
  # @api private
49
49
  def before_initialize(client_class, options)
@@ -55,17 +55,18 @@ module Aws
55
55
  private
56
56
 
57
57
  def apply_service_defaults(client_class, options)
58
- if defaults = Aws.config[client_class.identifier]
59
- defaults.each do |option_name, default|
60
- options[option_name] = default unless options.key?(option_name)
61
- end
58
+ return unless (defaults = Aws.config[client_class.identifier])
59
+
60
+ defaults.each do |option_name, default|
61
+ options[option_name] = default unless options.key?(option_name)
62
62
  end
63
63
  end
64
64
 
65
- def apply_aws_defaults(client_class, options)
65
+ def apply_aws_defaults(_client_class, options)
66
66
  Aws.config.each do |option_name, default|
67
67
  next if self.class.identifiers.include?(option_name)
68
68
  next if options.key?(option_name)
69
+
69
70
  options[option_name] = default
70
71
  end
71
72
  end
@@ -80,9 +81,7 @@ module Aws
80
81
 
81
82
  # @return [Set<String>]
82
83
  # @api private
83
- def identifiers
84
- @identifiers
85
- end
84
+ attr_reader :identifiers
86
85
 
87
86
  end
88
87
  end
@@ -91,11 +91,20 @@ and 10485780 bytes inclusive.
91
91
  end
92
92
  end
93
93
  end
94
- @handler.call(context)
94
+ with_metric(selected_encoding) { @handler.call(context) }
95
95
  end
96
96
 
97
97
  private
98
98
 
99
+ def with_metric(encoding, &block)
100
+ case encoding
101
+ when 'gzip'
102
+ Aws::Plugins::UserAgent.metric('GZIP_REQUEST_COMPRESSION', &block)
103
+ else
104
+ block.call
105
+ end
106
+ end
107
+
99
108
  def request_encoding_selection(context)
100
109
  encoding_list = context.operation.request_compression['encodings']
101
110
  encoding_list.find { |encoding| RequestCompression::SUPPORTED_ENCODINGS.include?(encoding) }
@@ -113,7 +113,6 @@ Specifies which retry algorithm to use. Values are:
113
113
  functionality of `standard` mode along with automatic client side
114
114
  throttling. This is a provisional mode that may change behavior
115
115
  in the future.
116
-
117
116
  DOCS
118
117
  resolve_retry_mode(cfg)
119
118
  end
@@ -235,7 +234,7 @@ a clock skew correction and retry requests with skewed client clocks.
235
234
 
236
235
  get_send_token(config)
237
236
  add_retry_headers(context)
238
- response = @handler.call(context)
237
+ response = with_metric(config.retry_mode) { @handler.call(context) }
239
238
  error_inspector = Retries::ErrorInspector.new(
240
239
  response.error, response.context.http_response.status_code
241
240
  )
@@ -272,6 +271,10 @@ a clock skew correction and retry requests with skewed client clocks.
272
271
 
273
272
  private
274
273
 
274
+ def with_metric(retry_mode, &block)
275
+ Aws::Plugins::UserAgent.metric("RETRY_MODE_#{retry_mode.upcase}", &block)
276
+ end
277
+
275
278
  def get_send_token(config)
276
279
  # either fail fast or block until a token becomes available
277
280
  # must be configurable
@@ -359,7 +362,7 @@ a clock skew correction and retry requests with skewed client clocks.
359
362
  class LegacyHandler < Seahorse::Client::Handler
360
363
 
361
364
  def call(context)
362
- response = @handler.call(context)
365
+ response = with_metric { @handler.call(context) }
363
366
  if response.error
364
367
  error_inspector = Retries::ErrorInspector.new(
365
368
  response.error, response.context.http_response.status_code
@@ -378,6 +381,10 @@ a clock skew correction and retry requests with skewed client clocks.
378
381
 
379
382
  private
380
383
 
384
+ def with_metric(&block)
385
+ Aws::Plugins::UserAgent.metric('RETRY_MODE_LEGACY', &block)
386
+ end
387
+
381
388
  def retry_if_possible(response, error_inspector)
382
389
  context = response.context
383
390
  if should_retry?(context, error_inspector)
@@ -4,6 +4,23 @@ module Aws
4
4
  module Plugins
5
5
  # @api private
6
6
  class UserAgent < Seahorse::Client::Plugin
7
+ METRICS = Aws::Json.load(<<-METRICS)
8
+ {
9
+ "RESOURCE_MODEL": "A",
10
+ "WAITER": "B",
11
+ "PAGINATOR": "C",
12
+ "RETRY_MODE_LEGACY": "D",
13
+ "RETRY_MODE_STANDARD": "E",
14
+ "RETRY_MODE_ADAPTIVE": "F",
15
+ "S3_TRANSFER": "G",
16
+ "S3_CRYPTO_V1N": "H",
17
+ "S3_CRYPTO_V2": "I",
18
+ "S3_EXPRESS_BUCKET": "J",
19
+ "S3_ACCESS_GRANTS": "K",
20
+ "GZIP_REQUEST_COMPRESSION": "L"
21
+ }
22
+ METRICS
23
+
7
24
  # @api private
8
25
  option(:user_agent_suffix)
9
26
  # @api private
@@ -23,12 +40,20 @@ variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
23
40
  app_id
24
41
  end
25
42
 
26
- def self.feature(feature, &block)
27
- Thread.current[:aws_sdk_core_user_agent_feature] ||= []
28
- Thread.current[:aws_sdk_core_user_agent_feature] << "ft/#{feature}"
43
+ # Deprecated - must exist for old service gems
44
+ def self.feature(_feature, &block)
45
+ block.call
46
+ end
47
+
48
+ def self.metric(metric, &block)
49
+ Thread.current[:aws_sdk_core_user_agent_metric] ||= []
50
+ Thread.current[:aws_sdk_core_user_agent_metric] << METRICS[metric]
29
51
  block.call
30
52
  ensure
31
- Thread.current[:aws_sdk_core_user_agent_feature].pop
53
+ Thread.current[:aws_sdk_core_user_agent_metric].pop
54
+ if Thread.current[:aws_sdk_core_user_agent_metric].empty?
55
+ Thread.current[:aws_sdk_core_user_agent_metric] = nil
56
+ end
32
57
  end
33
58
 
34
59
  # @api private
@@ -49,15 +74,24 @@ variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
49
74
 
50
75
  def to_s
51
76
  ua = "aws-sdk-ruby3/#{CORE_GEM_VERSION}"
52
- ua += ' ua/2.0'
53
- ua += " #{api_metadata}" if api_metadata
77
+ ua += ' ua/2.1'
78
+ if (api_m = api_metadata)
79
+ ua += " #{api_m}"
80
+ end
54
81
  ua += " #{os_metadata}"
55
82
  ua += " #{language_metadata}"
56
- ua += " #{env_metadata}" if env_metadata
57
- ua += " #{config_metadata}" if config_metadata
58
- ua += " #{app_id}" if app_id
59
- ua += " #{feature_metadata}" if feature_metadata
60
- ua += " #{framework_metadata}" if framework_metadata
83
+ if (env_m = env_metadata)
84
+ ua += " #{env_m}"
85
+ end
86
+ if (app_id_m = app_id_metadata)
87
+ ua += " #{app_id_m}"
88
+ end
89
+ if (framework_m = framework_metadata)
90
+ ua += " #{framework_m}"
91
+ end
92
+ if (metric_m = metric_metadata)
93
+ ua += " #{metric_m}"
94
+ end
61
95
  if @context.config.user_agent_suffix
62
96
  ua += " #{@context.config.user_agent_suffix}"
63
97
  end
@@ -93,7 +127,6 @@ variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
93
127
  local_version = Gem::Platform.local.version
94
128
  metadata += "##{local_version}" if local_version
95
129
  metadata += " md/#{RbConfig::CONFIG['host_cpu']}"
96
- metadata
97
130
  end
98
131
 
99
132
  # Used to be RUBY_ENGINE/RUBY_VERSION
@@ -107,11 +140,7 @@ variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
107
140
  "exec-env/#{execution_env}"
108
141
  end
109
142
 
110
- def config_metadata
111
- "cfg/retry-mode##{@context.config.retry_mode}"
112
- end
113
-
114
- def app_id
143
+ def app_id_metadata
115
144
  return unless (app_id = @context.config.sdk_ua_app_id)
116
145
 
117
146
  # Sanitize and only allow these characters
@@ -119,12 +148,6 @@ variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
119
148
  "app/#{app_id}"
120
149
  end
121
150
 
122
- def feature_metadata
123
- return unless Thread.current[:aws_sdk_core_user_agent_feature]
124
-
125
- Thread.current[:aws_sdk_core_user_agent_feature].join(' ')
126
- end
127
-
128
151
  def framework_metadata
129
152
  if (frameworks_cfg = @context.config.user_agent_frameworks).empty?
130
153
  return
@@ -141,10 +164,21 @@ variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
141
164
  end
142
165
  frameworks.map { |n, v| "lib/#{n}##{v}" }.join(' ')
143
166
  end
167
+
168
+ def metric_metadata
169
+ return unless Thread.current[:aws_sdk_core_user_agent_metric]
170
+
171
+ metrics = Thread.current[:aws_sdk_core_user_agent_metric].join(',')
172
+ # Metric metadata is limited to 1024 bytes
173
+ return "m/#{metrics}" if metrics.bytesize <= 1024
174
+
175
+ # Removes the last unfinished metric
176
+ "m/#{metrics[0...metrics[0..1024].rindex(',')]}"
177
+ end
144
178
  end
145
179
  end
146
180
 
147
- handler(Handler, priority: 1)
181
+ handler(Handler, step: :sign, priority: 97)
148
182
  end
149
183
  end
150
184
  end
@@ -2,9 +2,15 @@
2
2
 
3
3
  module Aws
4
4
  # A credential provider that executes a given process and attempts
5
- # to read its stdout to recieve a JSON payload containing the credentials.
5
+ # to read its stdout to receive a JSON payload containing the credentials.
6
6
  #
7
- # credentials = Aws::ProcessCredentials.new('/usr/bin/credential_proc')
7
+ # credentials = Aws::ProcessCredentials.new(['/usr/bin/credential_proc'])
8
+ # ec2 = Aws::EC2::Client.new(credentials: credentials)
9
+ #
10
+ # Arguments should be provided as strings in the array, for example:
11
+ #
12
+ # process = ['/usr/bin/credential_proc', 'arg1', 'arg2']
13
+ # credentials = Aws::ProcessCredentials.new(process)
8
14
  # ec2 = Aws::EC2::Client.new(credentials: credentials)
9
15
  #
10
16
  # Automatically handles refreshing credentials if an Expiration time is
@@ -19,40 +25,49 @@ module Aws
19
25
  # Creates a new ProcessCredentials object, which allows an
20
26
  # external process to be used as a credential provider.
21
27
  #
22
- # @param [String] process Invocation string for process
23
- # credentials provider.
28
+ # @param [Array<String>, String] process An array of strings including
29
+ # the process name and its arguments to execute, or a single string to be
30
+ # executed by the shell (deprecated and insecure).
24
31
  def initialize(process)
32
+ if process.is_a?(String)
33
+ warn('Passing a single string to Aws::ProcessCredentials.new '\
34
+ 'is insecure, please use use an array of system arguments instead')
35
+ end
25
36
  @process = process
26
- @credentials = credentials_from_process(@process)
37
+ @credentials = credentials_from_process
27
38
  @async_refresh = false
28
39
 
29
40
  super
30
41
  end
31
42
 
32
43
  private
33
- def credentials_from_process(proc_invocation)
34
- begin
35
- raw_out = `#{proc_invocation}`
36
- process_status = $?
37
- rescue Errno::ENOENT
38
- raise Errors::InvalidProcessCredentialsPayload.new("Could not find process #{proc_invocation}")
44
+
45
+ def credentials_from_process
46
+ r, w = IO.pipe
47
+ success = system(*@process, out: w)
48
+ w.close
49
+ raw_out = r.read
50
+ r.close
51
+
52
+ unless success
53
+ raise Errors::InvalidProcessCredentialsPayload.new(
54
+ 'credential_process provider failure, the credential process had '\
55
+ 'non zero exit status and failed to provide credentials'
56
+ )
39
57
  end
40
58
 
41
- if process_status.success?
42
- begin
43
- creds_json = Aws::Json.load(raw_out)
44
- rescue Aws::Json::ParseError
45
- raise Errors::InvalidProcessCredentialsPayload.new("Invalid JSON response")
46
- end
47
- payload_version = creds_json['Version']
48
- if payload_version == 1
49
- _parse_payload_format_v1(creds_json)
50
- else
51
- raise Errors::InvalidProcessCredentialsPayload.new("Invalid version #{payload_version} for credentials payload")
52
- end
53
- else
54
- raise Errors::InvalidProcessCredentialsPayload.new('credential_process provider failure, the credential process had non zero exit status and failed to provide credentials')
59
+ begin
60
+ creds_json = Aws::Json.load(raw_out)
61
+ rescue Aws::Json::ParseError
62
+ raise Errors::InvalidProcessCredentialsPayload.new('Invalid JSON response')
55
63
  end
64
+
65
+ payload_version = creds_json['Version']
66
+ return _parse_payload_format_v1(creds_json) if payload_version == 1
67
+
68
+ raise Errors::InvalidProcessCredentialsPayload.new(
69
+ "Invalid version #{payload_version} for credentials payload"
70
+ )
56
71
  end
57
72
 
58
73
  def _parse_payload_format_v1(creds_json)
@@ -64,11 +79,14 @@ module Aws
64
79
 
65
80
  @expiration = creds_json['Expiration'] ? Time.iso8601(creds_json['Expiration']) : nil
66
81
  return creds if creds.set?
67
- raise Errors::InvalidProcessCredentialsPayload.new("Invalid payload for JSON credentials version 1")
82
+
83
+ raise Errors::InvalidProcessCredentialsPayload.new(
84
+ 'Invalid payload for JSON credentials version 1'
85
+ )
68
86
  end
69
87
 
70
88
  def refresh
71
- @credentials = credentials_from_process(@process)
89
+ @credentials = credentials_from_process
72
90
  end
73
91
 
74
92
  def near_expiration?(expiration_length)
@@ -30,7 +30,9 @@ module Aws
30
30
  private
31
31
 
32
32
  def apply_path_params(uri, params)
33
- path = uri.path.sub(%r{/$}, '') + @path_pattern.split('?')[0]
33
+ path = uri.path.sub(%r{/$}, '')
34
+ # handle trailing slash
35
+ path += @path_pattern.split('?')[0] if path.empty? || @path_pattern != '/'
34
36
  uri.path = path.gsub(/{.+?}/) do |placeholder|
35
37
  param_value_for_placeholder(placeholder, params)
36
38
  end
@@ -90,16 +90,16 @@ module Aws
90
90
  end
91
91
  end
92
92
 
93
- # @param [String, Integer] value
93
+ # @param [String] value
94
94
  # @return [Time]
95
95
  def deserialize_time(value)
96
96
  case value
97
97
  when nil then nil
98
- when /^\d+$/ then Time.at(value.to_i)
98
+ when /^[\d.]+$/ then Time.at(value.to_f).utc
99
99
  else
100
100
  begin
101
- fractional_time = Time.parse(value).utc.to_f
102
- Time.at(fractional_time)
101
+ fractional_time = Time.parse(value).to_f
102
+ Time.at(fractional_time).utc
103
103
  rescue ArgumentError
104
104
  raise "unhandled timestamp format `#{value}'"
105
105
  end
@@ -62,7 +62,7 @@ module Aws
62
62
  def send_request(options)
63
63
  req = options[:client].build_request(@operation_name, options[:params])
64
64
  req.handlers.remove(RAISE_HANDLER)
65
- Aws::Plugins::UserAgent.feature('waiter') do
65
+ Aws::Plugins::UserAgent.metric('WAITER') do
66
66
  req.send_request
67
67
  end
68
68
  end
@@ -89,6 +89,11 @@ module Aws::SSO
89
89
 
90
90
  # @overload initialize(options)
91
91
  # @param [Hash] options
92
+ #
93
+ # @option options [Array<Seahorse::Client::Plugin>] :plugins ([]])
94
+ # A list of plugins to apply to the client. Each plugin is either a
95
+ # class name or an instance of a plugin class.
96
+ #
92
97
  # @option options [required, Aws::CredentialProvider] :credentials
93
98
  # Your AWS credentials. This can be an instance of any one of the
94
99
  # following classes:
@@ -209,7 +214,6 @@ module Aws::SSO
209
214
  # 'https://example.com'
210
215
  # 'http://example.com:123'
211
216
  #
212
- #
213
217
  # @option options [Integer] :endpoint_cache_max_entries (1000)
214
218
  # Used for the maximum size limit of the LRU cache storing endpoints data
215
219
  # for endpoint discovery enabled operations. Defaults to 1000.
@@ -298,7 +302,6 @@ module Aws::SSO
298
302
  # throttling. This is a provisional mode that may change behavior
299
303
  # in the future.
300
304
  #
301
- #
302
305
  # @option options [String] :sdk_ua_app_id
303
306
  # A unique and opaque application ID that is appended to the
304
307
  # User-Agent header as app/sdk_ua_app_id. It should have a
@@ -630,7 +633,7 @@ module Aws::SSO
630
633
  params: params,
631
634
  config: config)
632
635
  context[:gem_name] = 'aws-sdk-core'
633
- context[:gem_version] = '3.196.1'
636
+ context[:gem_version] = '3.198.0'
634
637
  Seahorse::Client::Request.new(handlers, context)
635
638
  end
636
639
 
data/lib/aws-sdk-sso.rb CHANGED
@@ -54,6 +54,6 @@ require_relative 'aws-sdk-sso/customizations'
54
54
  # @!group service
55
55
  module Aws::SSO
56
56
 
57
- GEM_VERSION = '3.196.1'
57
+ GEM_VERSION = '3.198.0'
58
58
 
59
59
  end
@@ -89,6 +89,11 @@ module Aws::SSOOIDC
89
89
 
90
90
  # @overload initialize(options)
91
91
  # @param [Hash] options
92
+ #
93
+ # @option options [Array<Seahorse::Client::Plugin>] :plugins ([]])
94
+ # A list of plugins to apply to the client. Each plugin is either a
95
+ # class name or an instance of a plugin class.
96
+ #
92
97
  # @option options [required, Aws::CredentialProvider] :credentials
93
98
  # Your AWS credentials. This can be an instance of any one of the
94
99
  # following classes:
@@ -209,7 +214,6 @@ module Aws::SSOOIDC
209
214
  # 'https://example.com'
210
215
  # 'http://example.com:123'
211
216
  #
212
- #
213
217
  # @option options [Integer] :endpoint_cache_max_entries (1000)
214
218
  # Used for the maximum size limit of the LRU cache storing endpoints data
215
219
  # for endpoint discovery enabled operations. Defaults to 1000.
@@ -298,7 +302,6 @@ module Aws::SSOOIDC
298
302
  # throttling. This is a provisional mode that may change behavior
299
303
  # in the future.
300
304
  #
301
- #
302
305
  # @option options [String] :sdk_ua_app_id
303
306
  # A unique and opaque application ID that is appended to the
304
307
  # User-Agent header as app/sdk_ua_app_id. It should have a
@@ -983,7 +986,7 @@ module Aws::SSOOIDC
983
986
  params: params,
984
987
  config: config)
985
988
  context[:gem_name] = 'aws-sdk-core'
986
- context[:gem_version] = '3.196.1'
989
+ context[:gem_version] = '3.198.0'
987
990
  Seahorse::Client::Request.new(handlers, context)
988
991
  end
989
992
 
@@ -54,6 +54,6 @@ require_relative 'aws-sdk-ssooidc/customizations'
54
54
  # @!group service
55
55
  module Aws::SSOOIDC
56
56
 
57
- GEM_VERSION = '3.196.1'
57
+ GEM_VERSION = '3.198.0'
58
58
 
59
59
  end
@@ -91,6 +91,11 @@ module Aws::STS
91
91
 
92
92
  # @overload initialize(options)
93
93
  # @param [Hash] options
94
+ #
95
+ # @option options [Array<Seahorse::Client::Plugin>] :plugins ([]])
96
+ # A list of plugins to apply to the client. Each plugin is either a
97
+ # class name or an instance of a plugin class.
98
+ #
94
99
  # @option options [required, Aws::CredentialProvider] :credentials
95
100
  # Your AWS credentials. This can be an instance of any one of the
96
101
  # following classes:
@@ -211,7 +216,6 @@ module Aws::STS
211
216
  # 'https://example.com'
212
217
  # 'http://example.com:123'
213
218
  #
214
- #
215
219
  # @option options [Integer] :endpoint_cache_max_entries (1000)
216
220
  # Used for the maximum size limit of the LRU cache storing endpoints data
217
221
  # for endpoint discovery enabled operations. Defaults to 1000.
@@ -300,7 +304,6 @@ module Aws::STS
300
304
  # throttling. This is a provisional mode that may change behavior
301
305
  # in the future.
302
306
  #
303
- #
304
307
  # @option options [String] :sdk_ua_app_id
305
308
  # A unique and opaque application ID that is appended to the
306
309
  # User-Agent header as app/sdk_ua_app_id. It should have a
@@ -2377,7 +2380,7 @@ module Aws::STS
2377
2380
  params: params,
2378
2381
  config: config)
2379
2382
  context[:gem_name] = 'aws-sdk-core'
2380
- context[:gem_version] = '3.196.1'
2383
+ context[:gem_version] = '3.198.0'
2381
2384
  Seahorse::Client::Request.new(handlers, context)
2382
2385
  end
2383
2386
 
data/lib/aws-sdk-sts.rb CHANGED
@@ -54,6 +54,6 @@ require_relative 'aws-sdk-sts/customizations'
54
54
  # @!group service
55
55
  module Aws::STS
56
56
 
57
- GEM_VERSION = '3.196.1'
57
+ GEM_VERSION = '3.198.0'
58
58
 
59
59
  end
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'thread'
4
-
5
3
  module Seahorse
6
4
  module Client
7
5
  class Base
@@ -60,6 +58,7 @@ module Seahorse
60
58
  def build_config(plugins, options)
61
59
  config = Configuration.new
62
60
  config.add_option(:api)
61
+ config.add_option(:plugins)
63
62
  plugins.each do |plugin|
64
63
  plugin.add_options(config) if plugin.respond_to?(:add_options)
65
64
  end
@@ -96,9 +95,9 @@ module Seahorse
96
95
  class << self
97
96
 
98
97
  def new(options = {})
99
- plugins = build_plugins
100
98
  options = options.dup
101
- before_initialize(plugins, options)
99
+ plugins = build_plugins(self.plugins + options.fetch(:plugins, []))
100
+ plugins = before_initialize(plugins, options)
102
101
  client = allocate
103
102
  client.send(:initialize, plugins, options)
104
103
  client
@@ -209,17 +208,28 @@ module Seahorse
209
208
  include(operations_module)
210
209
  end
211
210
 
212
- def build_plugins
211
+ def build_plugins(plugins)
213
212
  plugins.map { |plugin| plugin.is_a?(Class) ? plugin.new : plugin }
214
213
  end
215
214
 
216
215
  def before_initialize(plugins, options)
217
- plugins.each do |plugin|
218
- plugin.before_initialize(self, options) if plugin.respond_to?(:before_initialize)
216
+ queue = Queue.new
217
+ plugins.each { |plugin| queue.push(plugin) }
218
+ until queue.empty?
219
+ plugin = queue.pop
220
+ next unless plugin.respond_to?(:before_initialize)
221
+
222
+ plugins_before = options.fetch(:plugins, [])
223
+ plugin.before_initialize(self, options)
224
+ plugins_after = build_plugins(options.fetch(:plugins, []) - plugins_before)
225
+ # Plugins with before_initialize can add other plugins
226
+ plugins_after.each { |p| queue.push(p); plugins << p }
219
227
  end
228
+ plugins
220
229
  end
221
230
 
222
231
  def inherited(subclass)
232
+ super
223
233
  subclass.instance_variable_set('@plugins', PluginList.new(@plugins))
224
234
  end
225
235
 
@@ -17,7 +17,6 @@ be a URI formatted like:
17
17
  'http://example.com'
18
18
  'https://example.com'
19
19
  'http://example.com:123'
20
-
21
20
  DOCS
22
21
 
23
22
  def add_handlers(handlers, config)
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.196.1
4
+ version: 3.198.0
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: 2024-05-14 00:00:00.000000000 Z
11
+ date: 2024-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath