aws-sdk-core 3.175.0 → 3.184.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.
@@ -167,6 +167,26 @@ module Aws
167
167
  token
168
168
  end
169
169
 
170
+ # Source a custom configured endpoint from the shared configuration file
171
+ #
172
+ # @param [Hash] opts
173
+ # @option opts [String] :profile
174
+ # @option opts [String] :service_id
175
+ def configured_endpoint(opts = {})
176
+ # services section is only allowed in the shared config file (not credentials)
177
+ profile = opts[:profile] || @profile_name
178
+ service_id = opts[:service_id]&.gsub(" ", "_")&.downcase
179
+ if @parsed_config && (prof_config = @parsed_config[profile])
180
+ services_section_name = prof_config['services']
181
+ if (services_config = @parsed_config["services #{services_section_name}"]) &&
182
+ (service_config = services_config[service_id])
183
+ return service_config['endpoint_url'] if service_config['endpoint_url']
184
+ end
185
+ return prof_config['endpoint_url']
186
+ end
187
+ nil
188
+ end
189
+
170
190
  # Add an accessor method (similar to attr_reader) to return a configuration value
171
191
  # Uses the get_config_value below to control where
172
192
  # values are loaded from
@@ -198,7 +218,10 @@ module Aws
198
218
  :s3_us_east_1_regional_endpoint,
199
219
  :s3_disable_multiregion_access_points,
200
220
  :defaults_mode,
201
- :sdk_ua_app_id
221
+ :sdk_ua_app_id,
222
+ :disable_request_compression,
223
+ :request_min_compression_size_bytes,
224
+ :ignore_configured_endpoint_urls
202
225
  )
203
226
 
204
227
  private
@@ -336,12 +359,8 @@ module Aws
336
359
  !(prof_config.keys & SSO_CREDENTIAL_PROFILE_KEYS).empty?
337
360
 
338
361
  if sso_session_name = prof_config['sso_session']
339
- sso_session = cfg["sso-session #{sso_session_name}"]
340
- unless sso_session
341
- raise ArgumentError,
342
- "sso-session #{sso_session_name} must be defined in the config file. " \
343
- "Referenced by profile #{profile}"
344
- end
362
+ sso_session = sso_session(cfg, profile, sso_session_name)
363
+
345
364
  sso_region = sso_session['sso_region']
346
365
  sso_start_url = sso_session['sso_start_url']
347
366
 
@@ -366,7 +385,7 @@ module Aws
366
385
  sso_role_name: prof_config['sso_role_name'],
367
386
  sso_session: prof_config['sso_session'],
368
387
  sso_region: sso_region,
369
- sso_start_url: prof_config['sso_start_url']
388
+ sso_start_url: sso_start_url
370
389
  )
371
390
  end
372
391
  end
@@ -379,16 +398,7 @@ module Aws
379
398
  !(prof_config.keys & SSO_TOKEN_PROFILE_KEYS).empty?
380
399
 
381
400
  sso_session_name = prof_config['sso_session']
382
- sso_session = cfg["sso-session #{sso_session_name}"]
383
- unless sso_session
384
- raise ArgumentError,
385
- "sso-session #{sso_session_name} must be defined in the config file." \
386
- "Referenced by profile #{profile}"
387
- end
388
-
389
- unless sso_session['sso_region']
390
- raise ArgumentError, "sso-session #{sso_session_name} missing required parameter: sso_region"
391
- end
401
+ sso_session = sso_session(cfg, profile, sso_session_name)
392
402
 
393
403
  SSOTokenProvider.new(
394
404
  sso_session: sso_session_name,
@@ -446,5 +456,22 @@ module Aws
446
456
  ret ||= 'default'
447
457
  ret
448
458
  end
459
+
460
+ def sso_session(cfg, profile, sso_session_name)
461
+ # aws sso-configure may add quotes around sso session names with whitespace
462
+ sso_session = cfg["sso-session #{sso_session_name}"] || cfg["sso-session '#{sso_session_name}'"]
463
+
464
+ unless sso_session
465
+ raise ArgumentError,
466
+ "sso-session #{sso_session_name} must be defined in the config file. " \
467
+ "Referenced by profile #{profile}"
468
+ end
469
+
470
+ unless sso_session['sso_region']
471
+ raise ArgumentError, "sso-session #{sso_session_name} missing required parameter: sso_region"
472
+ end
473
+
474
+ sso_session
475
+ end
449
476
  end
450
477
  end
@@ -158,7 +158,7 @@ module Aws
158
158
  c.secret_access_key,
159
159
  c.session_token
160
160
  )
161
- @expiration = c.expiration
161
+ @expiration = Time.at(c.expiration / 1000.0)
162
162
  end
163
163
 
164
164
  def sso_cache_file
@@ -13,12 +13,23 @@ module Aws
13
13
  def stub(data = {})
14
14
  stub = EmptyStub.new(@rules).stub
15
15
  remove_paging_tokens(stub)
16
+ remove_checksums(stub)
16
17
  apply_data(data, stub)
17
18
  stub
18
19
  end
19
20
 
20
21
  private
21
22
 
23
+ def remove_checksums(stub)
24
+ if @rules && @rules.shape.is_a?(Seahorse::Model::Shapes::StructureShape)
25
+ @rules.shape.members.each do |key, member|
26
+ if member.location == 'header' && member.location_name.start_with?('x-amz-checksum-')
27
+ stub[key] = nil
28
+ end
29
+ end
30
+ end
31
+ end
32
+
22
33
  def remove_paging_tokens(stub)
23
34
  if @pager
24
35
  @pager.instance_variable_get("@tokens").keys.each do |path|
@@ -28,6 +28,7 @@ require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
28
28
  require 'aws-sdk-core/plugins/transfer_encoding.rb'
29
29
  require 'aws-sdk-core/plugins/http_checksum.rb'
30
30
  require 'aws-sdk-core/plugins/checksum_algorithm.rb'
31
+ require 'aws-sdk-core/plugins/request_compression.rb'
31
32
  require 'aws-sdk-core/plugins/defaults_mode.rb'
32
33
  require 'aws-sdk-core/plugins/recursion_detection.rb'
33
34
  require 'aws-sdk-core/plugins/sign.rb'
@@ -77,6 +78,7 @@ module Aws::SSO
77
78
  add_plugin(Aws::Plugins::TransferEncoding)
78
79
  add_plugin(Aws::Plugins::HttpChecksum)
79
80
  add_plugin(Aws::Plugins::ChecksumAlgorithm)
81
+ add_plugin(Aws::Plugins::RequestCompression)
80
82
  add_plugin(Aws::Plugins::DefaultsMode)
81
83
  add_plugin(Aws::Plugins::RecursionDetection)
82
84
  add_plugin(Aws::Plugins::Sign)
@@ -190,6 +192,10 @@ module Aws::SSO
190
192
  # Set to true to disable SDK automatically adding host prefix
191
193
  # to default service endpoint when available.
192
194
  #
195
+ # @option options [Boolean] :disable_request_compression (false)
196
+ # When set to 'true' the request body will not be compressed
197
+ # for supported operations.
198
+ #
193
199
  # @option options [String] :endpoint
194
200
  # The client endpoint is normally constructed from the `:region`
195
201
  # option. You should only configure an `:endpoint` when connecting
@@ -210,6 +216,10 @@ module Aws::SSO
210
216
  # @option options [Boolean] :endpoint_discovery (false)
211
217
  # When set to `true`, endpoint discovery will be enabled for operations when available.
212
218
  #
219
+ # @option options [Boolean] :ignore_configured_endpoint_urls
220
+ # Setting to true disables use of endpoint URLs provided via environment
221
+ # variables and the shared configuration file.
222
+ #
213
223
  # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
214
224
  # The log formatter.
215
225
  #
@@ -230,6 +240,11 @@ module Aws::SSO
230
240
  # Used when loading credentials from the shared credentials file
231
241
  # at HOME/.aws/credentials. When not specified, 'default' is used.
232
242
  #
243
+ # @option options [Integer] :request_min_compression_size_bytes (10240)
244
+ # The minimum size in bytes that triggers compression for request
245
+ # bodies. The value must be non-negative integer value between 0
246
+ # and 10485780 bytes inclusive.
247
+ #
233
248
  # @option options [Proc] :retry_backoff
234
249
  # A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
235
250
  # This option is only used in the `legacy` retry mode.
@@ -590,7 +605,7 @@ module Aws::SSO
590
605
  params: params,
591
606
  config: config)
592
607
  context[:gem_name] = 'aws-sdk-core'
593
- context[:gem_version] = '3.175.0'
608
+ context[:gem_version] = '3.184.0'
594
609
  Seahorse::Client::Request.new(handlers, context)
595
610
  end
596
611
 
@@ -14,36 +14,39 @@ module Aws::SSO
14
14
  use_dual_stack = parameters.use_dual_stack
15
15
  use_fips = parameters.use_fips
16
16
  endpoint = parameters.endpoint
17
- if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
18
- if Aws::Endpoints::Matchers.set?(endpoint) && (url = Aws::Endpoints::Matchers.parse_url(endpoint))
19
- if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
20
- raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
21
- end
22
- if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
23
- raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
24
- end
25
- return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
26
- end
27
- if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
28
- if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
29
- return Aws::Endpoints::Endpoint.new(url: "https://portal.sso-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
30
- end
31
- raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
32
- end
17
+ if Aws::Endpoints::Matchers.set?(endpoint)
33
18
  if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
34
- if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"))
35
- return Aws::Endpoints::Endpoint.new(url: "https://portal.sso-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
36
- end
37
- raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
19
+ raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
38
20
  end
39
21
  if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
40
- if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
41
- return Aws::Endpoints::Endpoint.new(url: "https://portal.sso.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
22
+ raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
23
+ end
24
+ return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
25
+ end
26
+ if Aws::Endpoints::Matchers.set?(region)
27
+ if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
28
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
29
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
30
+ return Aws::Endpoints::Endpoint.new(url: "https://portal.sso-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
31
+ end
32
+ raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
33
+ end
34
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
35
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"))
36
+ return Aws::Endpoints::Endpoint.new(url: "https://portal.sso-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
37
+ end
38
+ raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
39
+ end
40
+ if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
41
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
42
+ return Aws::Endpoints::Endpoint.new(url: "https://portal.sso.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
43
+ end
44
+ raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
42
45
  end
43
- raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
46
+ return Aws::Endpoints::Endpoint.new(url: "https://portal.sso.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
44
47
  end
45
- return Aws::Endpoints::Endpoint.new(url: "https://portal.sso.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
46
48
  end
49
+ raise ArgumentError, "Invalid Configuration: Missing Region"
47
50
  raise ArgumentError, 'No endpoint could be resolved'
48
51
 
49
52
  end
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.175.0'
57
+ GEM_VERSION = '3.184.0'
58
58
 
59
59
  end
@@ -28,6 +28,7 @@ require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
28
28
  require 'aws-sdk-core/plugins/transfer_encoding.rb'
29
29
  require 'aws-sdk-core/plugins/http_checksum.rb'
30
30
  require 'aws-sdk-core/plugins/checksum_algorithm.rb'
31
+ require 'aws-sdk-core/plugins/request_compression.rb'
31
32
  require 'aws-sdk-core/plugins/defaults_mode.rb'
32
33
  require 'aws-sdk-core/plugins/recursion_detection.rb'
33
34
  require 'aws-sdk-core/plugins/sign.rb'
@@ -77,6 +78,7 @@ module Aws::SSOOIDC
77
78
  add_plugin(Aws::Plugins::TransferEncoding)
78
79
  add_plugin(Aws::Plugins::HttpChecksum)
79
80
  add_plugin(Aws::Plugins::ChecksumAlgorithm)
81
+ add_plugin(Aws::Plugins::RequestCompression)
80
82
  add_plugin(Aws::Plugins::DefaultsMode)
81
83
  add_plugin(Aws::Plugins::RecursionDetection)
82
84
  add_plugin(Aws::Plugins::Sign)
@@ -190,6 +192,10 @@ module Aws::SSOOIDC
190
192
  # Set to true to disable SDK automatically adding host prefix
191
193
  # to default service endpoint when available.
192
194
  #
195
+ # @option options [Boolean] :disable_request_compression (false)
196
+ # When set to 'true' the request body will not be compressed
197
+ # for supported operations.
198
+ #
193
199
  # @option options [String] :endpoint
194
200
  # The client endpoint is normally constructed from the `:region`
195
201
  # option. You should only configure an `:endpoint` when connecting
@@ -210,6 +216,10 @@ module Aws::SSOOIDC
210
216
  # @option options [Boolean] :endpoint_discovery (false)
211
217
  # When set to `true`, endpoint discovery will be enabled for operations when available.
212
218
  #
219
+ # @option options [Boolean] :ignore_configured_endpoint_urls
220
+ # Setting to true disables use of endpoint URLs provided via environment
221
+ # variables and the shared configuration file.
222
+ #
213
223
  # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
214
224
  # The log formatter.
215
225
  #
@@ -230,6 +240,11 @@ module Aws::SSOOIDC
230
240
  # Used when loading credentials from the shared credentials file
231
241
  # at HOME/.aws/credentials. When not specified, 'default' is used.
232
242
  #
243
+ # @option options [Integer] :request_min_compression_size_bytes (10240)
244
+ # The minimum size in bytes that triggers compression for request
245
+ # bodies. The value must be non-negative integer value between 0
246
+ # and 10485780 bytes inclusive.
247
+ #
233
248
  # @option options [Proc] :retry_backoff
234
249
  # A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
235
250
  # This option is only used in the `legacy` retry mode.
@@ -586,7 +601,7 @@ module Aws::SSOOIDC
586
601
  params: params,
587
602
  config: config)
588
603
  context[:gem_name] = 'aws-sdk-core'
589
- context[:gem_version] = '3.175.0'
604
+ context[:gem_version] = '3.184.0'
590
605
  Seahorse::Client::Request.new(handlers, context)
591
606
  end
592
607
 
@@ -14,36 +14,42 @@ module Aws::SSOOIDC
14
14
  use_dual_stack = parameters.use_dual_stack
15
15
  use_fips = parameters.use_fips
16
16
  endpoint = parameters.endpoint
17
- if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
18
- if Aws::Endpoints::Matchers.set?(endpoint) && (url = Aws::Endpoints::Matchers.parse_url(endpoint))
19
- if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
20
- raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
21
- end
22
- if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
23
- raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
24
- end
25
- return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
26
- end
27
- if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
28
- if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
29
- return Aws::Endpoints::Endpoint.new(url: "https://oidc-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
30
- end
31
- raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
32
- end
17
+ if Aws::Endpoints::Matchers.set?(endpoint)
33
18
  if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
34
- if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"))
35
- return Aws::Endpoints::Endpoint.new(url: "https://oidc-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
36
- end
37
- raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
19
+ raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
38
20
  end
39
21
  if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
40
- if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
41
- return Aws::Endpoints::Endpoint.new(url: "https://oidc.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
22
+ raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
23
+ end
24
+ return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
25
+ end
26
+ if Aws::Endpoints::Matchers.set?(region)
27
+ if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
28
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
29
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
30
+ return Aws::Endpoints::Endpoint.new(url: "https://oidc-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
31
+ end
32
+ raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
33
+ end
34
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
35
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"))
36
+ if Aws::Endpoints::Matchers.string_equals?("aws-us-gov", Aws::Endpoints::Matchers.attr(partition_result, "name"))
37
+ return Aws::Endpoints::Endpoint.new(url: "https://oidc.#{region}.amazonaws.com", headers: {}, properties: {})
38
+ end
39
+ return Aws::Endpoints::Endpoint.new(url: "https://oidc-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
40
+ end
41
+ raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
42
+ end
43
+ if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
44
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
45
+ return Aws::Endpoints::Endpoint.new(url: "https://oidc.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
46
+ end
47
+ raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
42
48
  end
43
- raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
49
+ return Aws::Endpoints::Endpoint.new(url: "https://oidc.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
44
50
  end
45
- return Aws::Endpoints::Endpoint.new(url: "https://oidc.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
46
51
  end
52
+ raise ArgumentError, "Invalid Configuration: Missing Region"
47
53
  raise ArgumentError, 'No endpoint could be resolved'
48
54
 
49
55
  end
@@ -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.175.0'
57
+ GEM_VERSION = '3.184.0'
58
58
 
59
59
  end
@@ -28,6 +28,7 @@ require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
28
28
  require 'aws-sdk-core/plugins/transfer_encoding.rb'
29
29
  require 'aws-sdk-core/plugins/http_checksum.rb'
30
30
  require 'aws-sdk-core/plugins/checksum_algorithm.rb'
31
+ require 'aws-sdk-core/plugins/request_compression.rb'
31
32
  require 'aws-sdk-core/plugins/defaults_mode.rb'
32
33
  require 'aws-sdk-core/plugins/recursion_detection.rb'
33
34
  require 'aws-sdk-core/plugins/sign.rb'
@@ -78,6 +79,7 @@ module Aws::STS
78
79
  add_plugin(Aws::Plugins::TransferEncoding)
79
80
  add_plugin(Aws::Plugins::HttpChecksum)
80
81
  add_plugin(Aws::Plugins::ChecksumAlgorithm)
82
+ add_plugin(Aws::Plugins::RequestCompression)
81
83
  add_plugin(Aws::Plugins::DefaultsMode)
82
84
  add_plugin(Aws::Plugins::RecursionDetection)
83
85
  add_plugin(Aws::Plugins::Sign)
@@ -192,6 +194,10 @@ module Aws::STS
192
194
  # Set to true to disable SDK automatically adding host prefix
193
195
  # to default service endpoint when available.
194
196
  #
197
+ # @option options [Boolean] :disable_request_compression (false)
198
+ # When set to 'true' the request body will not be compressed
199
+ # for supported operations.
200
+ #
195
201
  # @option options [String] :endpoint
196
202
  # The client endpoint is normally constructed from the `:region`
197
203
  # option. You should only configure an `:endpoint` when connecting
@@ -212,6 +218,10 @@ module Aws::STS
212
218
  # @option options [Boolean] :endpoint_discovery (false)
213
219
  # When set to `true`, endpoint discovery will be enabled for operations when available.
214
220
  #
221
+ # @option options [Boolean] :ignore_configured_endpoint_urls
222
+ # Setting to true disables use of endpoint URLs provided via environment
223
+ # variables and the shared configuration file.
224
+ #
215
225
  # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
216
226
  # The log formatter.
217
227
  #
@@ -232,6 +242,11 @@ module Aws::STS
232
242
  # Used when loading credentials from the shared credentials file
233
243
  # at HOME/.aws/credentials. When not specified, 'default' is used.
234
244
  #
245
+ # @option options [Integer] :request_min_compression_size_bytes (10240)
246
+ # The minimum size in bytes that triggers compression for request
247
+ # bodies. The value must be non-negative integer value between 0
248
+ # and 10485780 bytes inclusive.
249
+ #
235
250
  # @option options [Proc] :retry_backoff
236
251
  # A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
237
252
  # This option is only used in the `legacy` retry mode.
@@ -751,6 +766,9 @@ module Aws::STS
751
766
  #
752
767
  # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html
753
768
  #
769
+ # @option params [Array<Types::ProvidedContext>] :provided_contexts
770
+ # Reserved for future use.
771
+ #
754
772
  # @return [Types::AssumeRoleResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
755
773
  #
756
774
  # * {Types::AssumeRoleResponse#credentials #credentials} => Types::Credentials
@@ -824,6 +842,12 @@ module Aws::STS
824
842
  # serial_number: "serialNumberType",
825
843
  # token_code: "tokenCodeType",
826
844
  # source_identity: "sourceIdentityType",
845
+ # provided_contexts: [
846
+ # {
847
+ # provider_arn: "arnType",
848
+ # context_assertion: "contextAssertionType",
849
+ # },
850
+ # ],
827
851
  # })
828
852
  #
829
853
  # @example Response structure
@@ -1386,7 +1410,8 @@ module Aws::STS
1386
1410
  # by the identity provider. Your application must get this token by
1387
1411
  # authenticating the user who is using your application with a web
1388
1412
  # identity provider before the application makes an
1389
- # `AssumeRoleWithWebIdentity` call.
1413
+ # `AssumeRoleWithWebIdentity` call. Only tokens with RSA algorithms
1414
+ # (RS256) are supported.
1390
1415
  #
1391
1416
  # @option params [String] :provider_id
1392
1417
  # The fully qualified host component of the domain name of the OAuth 2.0
@@ -2319,7 +2344,7 @@ module Aws::STS
2319
2344
  params: params,
2320
2345
  config: config)
2321
2346
  context[:gem_name] = 'aws-sdk-core'
2322
- context[:gem_version] = '3.175.0'
2347
+ context[:gem_version] = '3.184.0'
2323
2348
  Seahorse::Client::Request.new(handlers, context)
2324
2349
  end
2325
2350
 
@@ -43,6 +43,8 @@ module Aws::STS
43
43
  NameQualifier = Shapes::StringShape.new(name: 'NameQualifier')
44
44
  PackedPolicyTooLargeException = Shapes::StructureShape.new(name: 'PackedPolicyTooLargeException')
45
45
  PolicyDescriptorType = Shapes::StructureShape.new(name: 'PolicyDescriptorType')
46
+ ProvidedContext = Shapes::StructureShape.new(name: 'ProvidedContext')
47
+ ProvidedContextsListType = Shapes::ListShape.new(name: 'ProvidedContextsListType')
46
48
  RegionDisabledException = Shapes::StructureShape.new(name: 'RegionDisabledException')
47
49
  SAMLAssertionType = Shapes::StringShape.new(name: 'SAMLAssertionType')
48
50
  Subject = Shapes::StringShape.new(name: 'Subject')
@@ -54,6 +56,7 @@ module Aws::STS
54
56
  arnType = Shapes::StringShape.new(name: 'arnType')
55
57
  assumedRoleIdType = Shapes::StringShape.new(name: 'assumedRoleIdType')
56
58
  clientTokenType = Shapes::StringShape.new(name: 'clientTokenType')
59
+ contextAssertionType = Shapes::StringShape.new(name: 'contextAssertionType')
57
60
  dateType = Shapes::TimestampShape.new(name: 'dateType')
58
61
  decodedMessageType = Shapes::StringShape.new(name: 'decodedMessageType')
59
62
  durationSecondsType = Shapes::IntegerShape.new(name: 'durationSecondsType')
@@ -97,6 +100,7 @@ module Aws::STS
97
100
  AssumeRoleRequest.add_member(:serial_number, Shapes::ShapeRef.new(shape: serialNumberType, location_name: "SerialNumber"))
98
101
  AssumeRoleRequest.add_member(:token_code, Shapes::ShapeRef.new(shape: tokenCodeType, location_name: "TokenCode"))
99
102
  AssumeRoleRequest.add_member(:source_identity, Shapes::ShapeRef.new(shape: sourceIdentityType, location_name: "SourceIdentity"))
103
+ AssumeRoleRequest.add_member(:provided_contexts, Shapes::ShapeRef.new(shape: ProvidedContextsListType, location_name: "ProvidedContexts"))
100
104
  AssumeRoleRequest.struct_class = Types::AssumeRoleRequest
101
105
 
102
106
  AssumeRoleResponse.add_member(:credentials, Shapes::ShapeRef.new(shape: Credentials, location_name: "Credentials"))
@@ -219,6 +223,12 @@ module Aws::STS
219
223
  PolicyDescriptorType.add_member(:arn, Shapes::ShapeRef.new(shape: arnType, location_name: "arn"))
220
224
  PolicyDescriptorType.struct_class = Types::PolicyDescriptorType
221
225
 
226
+ ProvidedContext.add_member(:provider_arn, Shapes::ShapeRef.new(shape: arnType, location_name: "ProviderArn"))
227
+ ProvidedContext.add_member(:context_assertion, Shapes::ShapeRef.new(shape: contextAssertionType, location_name: "ContextAssertion"))
228
+ ProvidedContext.struct_class = Types::ProvidedContext
229
+
230
+ ProvidedContextsListType.member = Shapes::ShapeRef.new(shape: ProvidedContext)
231
+
222
232
  RegionDisabledException.add_member(:message, Shapes::ShapeRef.new(shape: regionDisabledMessage, location_name: "message"))
223
233
  RegionDisabledException.struct_class = Types::RegionDisabledException
224
234
 
@@ -287,6 +287,10 @@ module Aws::STS
287
287
  # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html
288
288
  # @return [String]
289
289
  #
290
+ # @!attribute [rw] provided_contexts
291
+ # Reserved for future use.
292
+ # @return [Array<Types::ProvidedContext>]
293
+ #
290
294
  # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleRequest AWS API Documentation
291
295
  #
292
296
  class AssumeRoleRequest < Struct.new(
@@ -300,7 +304,8 @@ module Aws::STS
300
304
  :external_id,
301
305
  :serial_number,
302
306
  :token_code,
303
- :source_identity)
307
+ :source_identity,
308
+ :provided_contexts)
304
309
  SENSITIVE = []
305
310
  include Aws::Structure
306
311
  end
@@ -652,7 +657,8 @@ module Aws::STS
652
657
  # provided by the identity provider. Your application must get this
653
658
  # token by authenticating the user who is using your application with
654
659
  # a web identity provider before the application makes an
655
- # `AssumeRoleWithWebIdentity` call.
660
+ # `AssumeRoleWithWebIdentity` call. Only tokens with RSA algorithms
661
+ # (RS256) are supported.
656
662
  # @return [String]
657
663
  #
658
664
  # @!attribute [rw] provider_id
@@ -1497,6 +1503,25 @@ module Aws::STS
1497
1503
  include Aws::Structure
1498
1504
  end
1499
1505
 
1506
+ # Reserved for future use.
1507
+ #
1508
+ # @!attribute [rw] provider_arn
1509
+ # Reserved for future use.
1510
+ # @return [String]
1511
+ #
1512
+ # @!attribute [rw] context_assertion
1513
+ # Reserved for future use.
1514
+ # @return [String]
1515
+ #
1516
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/ProvidedContext AWS API Documentation
1517
+ #
1518
+ class ProvidedContext < Struct.new(
1519
+ :provider_arn,
1520
+ :context_assertion)
1521
+ SENSITIVE = []
1522
+ include Aws::Structure
1523
+ end
1524
+
1500
1525
  # STS is not activated in the requested region for the account that is
1501
1526
  # being asked to generate credentials. The account administrator must
1502
1527
  # use the IAM console to activate STS in that region. For more
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.175.0'
57
+ GEM_VERSION = '3.184.0'
58
58
 
59
59
  end
@@ -204,10 +204,6 @@ module Seahorse
204
204
  def value_at(opt_name)
205
205
  value = @struct[opt_name]
206
206
  if value.is_a?(Defaults)
207
- # Legacy endpoints must continue to exist.
208
- if opt_name == :endpoint && @struct.members.include?(:regional_endpoint)
209
- @struct[:regional_endpoint] = true
210
- end
211
207
  resolve_defaults(opt_name, value)
212
208
  else
213
209
  value
@@ -60,6 +60,16 @@ the number of bytes read from the body, and the total number of
60
60
  bytes in the body.
61
61
  DOCS
62
62
 
63
+ option(:on_chunk_received,
64
+ default: nil,
65
+ doc_type: 'Proc',
66
+ docstring: <<-DOCS)
67
+ When a Proc object is provided, it will be used as callback when each chunk
68
+ of the response body is received. It provides three arguments: the chunk,
69
+ the number of bytes received, and the total number of
70
+ bytes in the response (or nil if the server did not send a `content-length`).
71
+ DOCS
72
+
63
73
  # @api private
64
74
  class OptionHandler < Client::Handler
65
75
  def call(context)
@@ -68,8 +78,29 @@ bytes in the body.
68
78
  end
69
79
  on_chunk_sent = context.config.on_chunk_sent if on_chunk_sent.nil?
70
80
  context[:on_chunk_sent] = on_chunk_sent if on_chunk_sent
81
+
82
+ if context.params.is_a?(Hash) && context.params[:on_chunk_received]
83
+ on_chunk_received = context.params.delete(:on_chunk_received)
84
+ end
85
+ on_chunk_received = context.config.on_chunk_received if on_chunk_received.nil?
86
+
87
+ add_response_events(on_chunk_received, context) if on_chunk_received
88
+
71
89
  @handler.call(context)
72
90
  end
91
+
92
+ def add_response_events(on_chunk_received, context)
93
+ shared_data = {bytes_received: 0}
94
+
95
+ context.http_response.on_headers do |_status, headers|
96
+ shared_data[:content_length] = headers['content-length']&.to_i
97
+ end
98
+
99
+ context.http_response.on_data do |chunk|
100
+ shared_data[:bytes_received] += chunk.bytesize if chunk && chunk.respond_to?(:bytesize)
101
+ on_chunk_received.call(chunk, shared_data[:bytes_received], shared_data[:content_length])
102
+ end
103
+ end
73
104
  end
74
105
 
75
106
  # @api private