aws-sdk-core 3.171.0 → 3.186.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +155 -0
  3. data/VERSION +1 -1
  4. data/lib/aws-defaults/default_configuration.rb +4 -4
  5. data/lib/aws-sdk-core/credential_provider.rb +3 -0
  6. data/lib/aws-sdk-core/endpoints/matchers.rb +13 -9
  7. data/lib/aws-sdk-core/endpoints.rb +5 -1
  8. data/lib/aws-sdk-core/errors.rb +1 -1
  9. data/lib/aws-sdk-core/ini_parser.rb +7 -0
  10. data/lib/aws-sdk-core/instance_profile_credentials.rb +52 -30
  11. data/lib/aws-sdk-core/json/error_handler.rb +15 -5
  12. data/lib/aws-sdk-core/json/parser.rb +1 -1
  13. data/lib/aws-sdk-core/log/formatter.rb +6 -0
  14. data/lib/aws-sdk-core/pageable_response.rb +3 -1
  15. data/lib/aws-sdk-core/param_validator.rb +2 -2
  16. data/lib/aws-sdk-core/plugins/checksum_algorithm.rb +1 -1
  17. data/lib/aws-sdk-core/plugins/regional_endpoint.rb +109 -33
  18. data/lib/aws-sdk-core/plugins/request_compression.rb +217 -0
  19. data/lib/aws-sdk-core/plugins/sign.rb +1 -0
  20. data/lib/aws-sdk-core/plugins/user_agent.rb +117 -14
  21. data/lib/aws-sdk-core/refreshing_credentials.rb +0 -6
  22. data/lib/aws-sdk-core/rest/request/querystring_builder.rb +43 -29
  23. data/lib/aws-sdk-core/shared_config.rb +47 -18
  24. data/lib/aws-sdk-core/sso_credentials.rb +1 -1
  25. data/lib/aws-sdk-core/stubbing/stub_data.rb +11 -0
  26. data/lib/aws-sdk-core/waiters/poller.rb +3 -1
  27. data/lib/aws-sdk-sso/client.rb +21 -1
  28. data/lib/aws-sdk-sso/endpoint_provider.rb +30 -24
  29. data/lib/aws-sdk-sso/endpoints.rb +1 -0
  30. data/lib/aws-sdk-sso.rb +1 -1
  31. data/lib/aws-sdk-ssooidc/client.rb +21 -1
  32. data/lib/aws-sdk-ssooidc/endpoint_provider.rb +30 -24
  33. data/lib/aws-sdk-ssooidc/endpoints.rb +1 -0
  34. data/lib/aws-sdk-ssooidc.rb +1 -1
  35. data/lib/aws-sdk-sts/client.rb +138 -112
  36. data/lib/aws-sdk-sts/client_api.rb +12 -1
  37. data/lib/aws-sdk-sts/endpoint_provider.rb +81 -78
  38. data/lib/aws-sdk-sts/endpoints.rb +1 -0
  39. data/lib/aws-sdk-sts/types.rb +35 -11
  40. data/lib/aws-sdk-sts.rb +1 -1
  41. data/lib/seahorse/client/configuration.rb +0 -4
  42. data/lib/seahorse/client/plugins/request_callback.rb +31 -0
  43. data/lib/seahorse/client/response.rb +6 -0
  44. data/lib/seahorse/model/operation.rb +3 -0
  45. metadata +3 -2
@@ -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
@@ -185,6 +205,7 @@ module Aws
185
205
  :use_fips_endpoint,
186
206
  :ec2_metadata_service_endpoint,
187
207
  :ec2_metadata_service_endpoint_mode,
208
+ :ec2_metadata_v1_disabled,
188
209
  :max_attempts,
189
210
  :retry_mode,
190
211
  :adaptive_retry_wait_to_fill,
@@ -197,7 +218,11 @@ module Aws
197
218
  :s3_use_arn_region,
198
219
  :s3_us_east_1_regional_endpoint,
199
220
  :s3_disable_multiregion_access_points,
200
- :defaults_mode
221
+ :defaults_mode,
222
+ :sdk_ua_app_id,
223
+ :disable_request_compression,
224
+ :request_min_compression_size_bytes,
225
+ :ignore_configured_endpoint_urls
201
226
  )
202
227
 
203
228
  private
@@ -335,12 +360,8 @@ module Aws
335
360
  !(prof_config.keys & SSO_CREDENTIAL_PROFILE_KEYS).empty?
336
361
 
337
362
  if sso_session_name = prof_config['sso_session']
338
- sso_session = cfg["sso-session #{sso_session_name}"]
339
- unless sso_session
340
- raise ArgumentError,
341
- "sso-session #{sso_session_name} must be defined in the config file. " \
342
- "Referenced by profile #{profile}"
343
- end
363
+ sso_session = sso_session(cfg, profile, sso_session_name)
364
+
344
365
  sso_region = sso_session['sso_region']
345
366
  sso_start_url = sso_session['sso_start_url']
346
367
 
@@ -365,7 +386,7 @@ module Aws
365
386
  sso_role_name: prof_config['sso_role_name'],
366
387
  sso_session: prof_config['sso_session'],
367
388
  sso_region: sso_region,
368
- sso_start_url: prof_config['sso_start_url']
389
+ sso_start_url: sso_start_url
369
390
  )
370
391
  end
371
392
  end
@@ -378,16 +399,7 @@ module Aws
378
399
  !(prof_config.keys & SSO_TOKEN_PROFILE_KEYS).empty?
379
400
 
380
401
  sso_session_name = prof_config['sso_session']
381
- sso_session = cfg["sso-session #{sso_session_name}"]
382
- unless sso_session
383
- raise ArgumentError,
384
- "sso-session #{sso_session_name} must be defined in the config file." \
385
- "Referenced by profile #{profile}"
386
- end
387
-
388
- unless sso_session['sso_region']
389
- raise ArgumentError, "sso-session #{sso_session_name} missing required parameter: sso_region"
390
- end
402
+ sso_session = sso_session(cfg, profile, sso_session_name)
391
403
 
392
404
  SSOTokenProvider.new(
393
405
  sso_session: sso_session_name,
@@ -445,5 +457,22 @@ module Aws
445
457
  ret ||= 'default'
446
458
  ret
447
459
  end
460
+
461
+ def sso_session(cfg, profile, sso_session_name)
462
+ # aws sso-configure may add quotes around sso session names with whitespace
463
+ sso_session = cfg["sso-session #{sso_session_name}"] || cfg["sso-session '#{sso_session_name}'"]
464
+
465
+ unless sso_session
466
+ raise ArgumentError,
467
+ "sso-session #{sso_session_name} must be defined in the config file. " \
468
+ "Referenced by profile #{profile}"
469
+ end
470
+
471
+ unless sso_session['sso_region']
472
+ raise ArgumentError, "sso-session #{sso_session_name} missing required parameter: sso_region"
473
+ end
474
+
475
+ sso_session
476
+ end
448
477
  end
449
478
  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|
@@ -62,7 +62,9 @@ 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
- req.send_request
65
+ Aws::Plugins::UserAgent.feature('waiter') do
66
+ req.send_request
67
+ end
66
68
  end
67
69
 
68
70
  def acceptor_matches?(acceptor, response)
@@ -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.
@@ -275,6 +290,11 @@ module Aws::SSO
275
290
  # in the future.
276
291
  #
277
292
  #
293
+ # @option options [String] :sdk_ua_app_id
294
+ # A unique and opaque application ID that is appended to the
295
+ # User-Agent header as app/<sdk_ua_app_id>. It should have a
296
+ # maximum length of 50.
297
+ #
278
298
  # @option options [String] :secret_access_key
279
299
  #
280
300
  # @option options [String] :session_token
@@ -585,7 +605,7 @@ module Aws::SSO
585
605
  params: params,
586
606
  config: config)
587
607
  context[:gem_name] = 'aws-sdk-core'
588
- context[:gem_version] = '3.171.0'
608
+ context[:gem_version] = '3.186.0'
589
609
  Seahorse::Client::Request.new(handlers, context)
590
610
  end
591
611
 
@@ -14,36 +14,42 @@ 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
+ if Aws::Endpoints::Matchers.string_equals?("aws-us-gov", Aws::Endpoints::Matchers.attr(partition_result, "name"))
37
+ return Aws::Endpoints::Endpoint.new(url: "https://portal.sso.#{region}.amazonaws.com", headers: {}, properties: {})
38
+ end
39
+ return Aws::Endpoints::Endpoint.new(url: "https://portal.sso-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://portal.sso.#{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://portal.sso.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
44
50
  end
45
- return Aws::Endpoints::Endpoint.new(url: "https://portal.sso.#{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
@@ -9,6 +9,7 @@
9
9
 
10
10
 
11
11
  module Aws::SSO
12
+ # @api private
12
13
  module Endpoints
13
14
 
14
15
  class GetRoleCredentials
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.171.0'
57
+ GEM_VERSION = '3.186.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.
@@ -275,6 +290,11 @@ module Aws::SSOOIDC
275
290
  # in the future.
276
291
  #
277
292
  #
293
+ # @option options [String] :sdk_ua_app_id
294
+ # A unique and opaque application ID that is appended to the
295
+ # User-Agent header as app/<sdk_ua_app_id>. It should have a
296
+ # maximum length of 50.
297
+ #
278
298
  # @option options [String] :secret_access_key
279
299
  #
280
300
  # @option options [String] :session_token
@@ -581,7 +601,7 @@ module Aws::SSOOIDC
581
601
  params: params,
582
602
  config: config)
583
603
  context[:gem_name] = 'aws-sdk-core'
584
- context[:gem_version] = '3.171.0'
604
+ context[:gem_version] = '3.186.0'
585
605
  Seahorse::Client::Request.new(handlers, context)
586
606
  end
587
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
@@ -9,6 +9,7 @@
9
9
 
10
10
 
11
11
  module Aws::SSOOIDC
12
+ # @api private
12
13
  module Endpoints
13
14
 
14
15
  class CreateToken
@@ -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.171.0'
57
+ GEM_VERSION = '3.186.0'
58
58
 
59
59
  end