aws-sdk-core 3.131.1 → 3.188.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.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +459 -0
  3. data/VERSION +1 -1
  4. data/lib/aws-defaults/default_configuration.rb +4 -4
  5. data/lib/aws-sdk-core/arn.rb +13 -0
  6. data/lib/aws-sdk-core/binary/encode_handler.rb +12 -1
  7. data/lib/aws-sdk-core/credential_provider.rb +3 -0
  8. data/lib/aws-sdk-core/credential_provider_chain.rb +8 -5
  9. data/lib/aws-sdk-core/ecs_credentials.rb +177 -53
  10. data/lib/aws-sdk-core/endpoints/condition.rb +41 -0
  11. data/lib/aws-sdk-core/endpoints/endpoint.rb +17 -0
  12. data/lib/aws-sdk-core/endpoints/endpoint_rule.rb +75 -0
  13. data/lib/aws-sdk-core/endpoints/error_rule.rb +42 -0
  14. data/lib/aws-sdk-core/endpoints/function.rb +80 -0
  15. data/lib/aws-sdk-core/endpoints/matchers.rb +131 -0
  16. data/lib/aws-sdk-core/endpoints/reference.rb +31 -0
  17. data/lib/aws-sdk-core/endpoints/rule.rb +25 -0
  18. data/lib/aws-sdk-core/endpoints/rule_set.rb +52 -0
  19. data/lib/aws-sdk-core/endpoints/rules_provider.rb +37 -0
  20. data/lib/aws-sdk-core/endpoints/templater.rb +58 -0
  21. data/lib/aws-sdk-core/endpoints/tree_rule.rb +45 -0
  22. data/lib/aws-sdk-core/endpoints/url.rb +60 -0
  23. data/lib/aws-sdk-core/endpoints.rb +78 -0
  24. data/lib/aws-sdk-core/errors.rb +14 -1
  25. data/lib/aws-sdk-core/ini_parser.rb +7 -0
  26. data/lib/aws-sdk-core/instance_profile_credentials.rb +52 -30
  27. data/lib/aws-sdk-core/json/error_handler.rb +20 -1
  28. data/lib/aws-sdk-core/json/handler.rb +8 -1
  29. data/lib/aws-sdk-core/json/parser.rb +27 -2
  30. data/lib/aws-sdk-core/log/formatter.rb +6 -0
  31. data/lib/aws-sdk-core/pageable_response.rb +10 -1
  32. data/lib/aws-sdk-core/param_validator.rb +2 -2
  33. data/lib/aws-sdk-core/plugins/bearer_authorization.rb +67 -0
  34. data/lib/aws-sdk-core/plugins/checksum_algorithm.rb +1 -1
  35. data/lib/aws-sdk-core/plugins/credentials_configuration.rb +24 -0
  36. data/lib/aws-sdk-core/plugins/endpoint_discovery.rb +6 -2
  37. data/lib/aws-sdk-core/plugins/jsonvalue_converter.rb +34 -6
  38. data/lib/aws-sdk-core/plugins/recursion_detection.rb +14 -3
  39. data/lib/aws-sdk-core/plugins/regional_endpoint.rb +111 -30
  40. data/lib/aws-sdk-core/plugins/request_compression.rb +217 -0
  41. data/lib/aws-sdk-core/plugins/retries/error_inspector.rb +2 -1
  42. data/lib/aws-sdk-core/plugins/sign.rb +201 -0
  43. data/lib/aws-sdk-core/plugins/signature_v2.rb +1 -0
  44. data/lib/aws-sdk-core/plugins/signature_v4.rb +13 -7
  45. data/lib/aws-sdk-core/plugins/user_agent.rb +117 -14
  46. data/lib/aws-sdk-core/refreshing_credentials.rb +0 -6
  47. data/lib/aws-sdk-core/refreshing_token.rb +71 -0
  48. data/lib/aws-sdk-core/rest/handler.rb +1 -1
  49. data/lib/aws-sdk-core/rest/request/headers.rb +2 -6
  50. data/lib/aws-sdk-core/rest/request/querystring_builder.rb +43 -29
  51. data/lib/aws-sdk-core/shared_config.rb +106 -6
  52. data/lib/aws-sdk-core/sso_credentials.rb +80 -45
  53. data/lib/aws-sdk-core/sso_token_provider.rb +135 -0
  54. data/lib/aws-sdk-core/static_token_provider.rb +14 -0
  55. data/lib/aws-sdk-core/structure.rb +6 -4
  56. data/lib/aws-sdk-core/stubbing/stub_data.rb +11 -0
  57. data/lib/aws-sdk-core/token.rb +31 -0
  58. data/lib/aws-sdk-core/token_provider.rb +15 -0
  59. data/lib/aws-sdk-core/token_provider_chain.rb +51 -0
  60. data/lib/aws-sdk-core/waiters/poller.rb +3 -1
  61. data/lib/aws-sdk-core/xml/error_handler.rb +7 -0
  62. data/lib/aws-sdk-core/xml/parser/engines/oga.rb +2 -0
  63. data/lib/aws-sdk-core.rb +14 -0
  64. data/lib/aws-sdk-sso/client.rb +71 -11
  65. data/lib/aws-sdk-sso/endpoint_parameters.rb +66 -0
  66. data/lib/aws-sdk-sso/endpoint_provider.rb +57 -0
  67. data/lib/aws-sdk-sso/endpoints.rb +72 -0
  68. data/lib/aws-sdk-sso/plugins/endpoints.rb +76 -0
  69. data/lib/aws-sdk-sso/types.rb +8 -43
  70. data/lib/aws-sdk-sso.rb +5 -1
  71. data/lib/aws-sdk-ssooidc/client.rb +935 -0
  72. data/lib/aws-sdk-ssooidc/client_api.rb +271 -0
  73. data/lib/aws-sdk-ssooidc/customizations.rb +1 -0
  74. data/lib/aws-sdk-ssooidc/endpoint_parameters.rb +66 -0
  75. data/lib/aws-sdk-ssooidc/endpoint_provider.rb +57 -0
  76. data/lib/aws-sdk-ssooidc/endpoints.rb +72 -0
  77. data/lib/aws-sdk-ssooidc/errors.rb +321 -0
  78. data/lib/aws-sdk-ssooidc/plugins/endpoints.rb +76 -0
  79. data/lib/aws-sdk-ssooidc/resource.rb +26 -0
  80. data/lib/aws-sdk-ssooidc/types.rb +755 -0
  81. data/lib/aws-sdk-ssooidc.rb +59 -0
  82. data/lib/aws-sdk-sts/client.rb +298 -245
  83. data/lib/aws-sdk-sts/client_api.rb +12 -1
  84. data/lib/aws-sdk-sts/endpoint_parameters.rb +78 -0
  85. data/lib/aws-sdk-sts/endpoint_provider.rb +112 -0
  86. data/lib/aws-sdk-sts/endpoints.rb +136 -0
  87. data/lib/aws-sdk-sts/plugins/endpoints.rb +84 -0
  88. data/lib/aws-sdk-sts/presigner.rb +14 -16
  89. data/lib/aws-sdk-sts/types.rb +128 -197
  90. data/lib/aws-sdk-sts.rb +5 -1
  91. data/lib/seahorse/client/async_base.rb +0 -1
  92. data/lib/seahorse/client/configuration.rb +1 -5
  93. data/lib/seahorse/client/h2/connection.rb +12 -11
  94. data/lib/seahorse/client/net_http/patches.rb +1 -4
  95. data/lib/seahorse/client/plugins/h2.rb +3 -3
  96. data/lib/seahorse/client/plugins/request_callback.rb +40 -9
  97. data/lib/seahorse/client/response.rb +6 -0
  98. data/lib/seahorse/model/operation.rb +3 -0
  99. data/lib/seahorse/util.rb +4 -0
  100. metadata +49 -7
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aws
4
+ class StaticTokenProvider
5
+
6
+ include TokenProvider
7
+
8
+ # @param [String] token
9
+ # @param [Time] expiration
10
+ def initialize(token, expiration=nil)
11
+ @token = Token.new(token, expiration)
12
+ end
13
+ end
14
+ end
@@ -28,18 +28,20 @@ module Aws
28
28
  # in stdlib Struct.
29
29
  #
30
30
  # @return [Hash]
31
- def to_h(obj = self)
31
+ def to_h(obj = self, options = {})
32
32
  case obj
33
33
  when Struct
34
34
  obj.each_pair.with_object({}) do |(member, value), hash|
35
- hash[member] = to_hash(value) unless value.nil?
35
+ member = member.to_s if options[:as_json]
36
+ hash[member] = to_hash(value, options) unless value.nil?
36
37
  end
37
38
  when Hash
38
39
  obj.each.with_object({}) do |(key, value), hash|
39
- hash[key] = to_hash(value)
40
+ key = key.to_s if options[:as_json]
41
+ hash[key] = to_hash(value, options)
40
42
  end
41
43
  when Array
42
- obj.collect { |value| to_hash(value) }
44
+ obj.collect { |value| to_hash(value, options) }
43
45
  else
44
46
  obj
45
47
  end
@@ -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|
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aws
4
+ class Token
5
+
6
+ # @param [String] token
7
+ # @param [Time] expiration
8
+ def initialize(token, expiration=nil)
9
+ @token = token
10
+ @expiration = expiration
11
+ end
12
+
13
+ # @return [String, nil]
14
+ attr_reader :token
15
+
16
+ # @return [Time, nil]
17
+ attr_reader :expiration
18
+
19
+ # @return [Boolean] Returns `true` if token is set
20
+ def set?
21
+ !token.nil? && !token.empty?
22
+ end
23
+
24
+ # Removing the token from the default inspect string.
25
+ # @api private
26
+ def inspect
27
+ "#<#{self.class.name} token=[FILTERED]> expiration=#{expiration}>"
28
+ end
29
+
30
+ end
31
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aws
4
+ module TokenProvider
5
+
6
+ # @return [Token]
7
+ attr_reader :token
8
+
9
+ # @return [Boolean]
10
+ def set?
11
+ !!token && token.set?
12
+ end
13
+
14
+ end
15
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aws
4
+ # @api private
5
+ class TokenProviderChain
6
+ def initialize(config = nil)
7
+ @config = config
8
+ end
9
+
10
+ # @return [TokenProvider, nil]
11
+ def resolve
12
+ providers.each do |method_name, options|
13
+ provider = send(method_name, options.merge(config: @config))
14
+ return provider if provider && provider.set?
15
+ end
16
+ nil
17
+ end
18
+
19
+ private
20
+
21
+ def providers
22
+ [
23
+ [:static_profile_sso_token, {}],
24
+ [:sso_token, {}]
25
+ ]
26
+ end
27
+
28
+ def static_profile_sso_token(options)
29
+ if Aws.shared_config.config_enabled? && options[:config] && options[:config].profile
30
+ Aws.shared_config.sso_token_from_config(
31
+ profile: options[:config].profile
32
+ )
33
+ end
34
+ end
35
+
36
+
37
+ def sso_token(options)
38
+ profile_name = determine_profile_name(options)
39
+ if Aws.shared_config.config_enabled?
40
+ Aws.shared_config.sso_token_from_config(profile: profile_name)
41
+ end
42
+ rescue Errors::NoSuchProfileError
43
+ nil
44
+ end
45
+
46
+ def determine_profile_name(options)
47
+ (options[:config] && options[:config].profile) || ENV['AWS_PROFILE'] || ENV['AWS_DEFAULT_PROFILE'] || 'default'
48
+ end
49
+
50
+ end
51
+ end
@@ -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)
@@ -24,6 +24,7 @@ module Aws
24
24
  else
25
25
  code, message, data = extract_error(body, context)
26
26
  end
27
+ context[:request_id] = request_id(body)
27
28
  errors_module = context.client.class.errors_module
28
29
  error_class = errors_module.error_class(code).new(context, message, data)
29
30
  error_class
@@ -94,6 +95,12 @@ module Aws
94
95
  end
95
96
  end
96
97
 
98
+ def request_id(body)
99
+ if matches = body.match(/<RequestId>(.+?)<\/RequestId>/m)
100
+ matches[1]
101
+ end
102
+ end
103
+
97
104
  def unescape(str)
98
105
  CGI.unescapeHTML(str)
99
106
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Oga Java requires JRuby.runtime
4
+ require 'jruby' if RUBY_PLATFORM == 'java'
3
5
  require 'oga'
4
6
 
5
7
  module Aws
data/lib/aws-sdk-core.rb CHANGED
@@ -20,6 +20,15 @@ require_relative 'aws-sdk-core/shared_credentials'
20
20
  require_relative 'aws-sdk-core/process_credentials'
21
21
  require_relative 'aws-sdk-core/sso_credentials'
22
22
 
23
+ # tokens and token providers
24
+ require_relative 'aws-sdk-core/token'
25
+ require_relative 'aws-sdk-core/token_provider'
26
+ require_relative 'aws-sdk-core/static_token_provider'
27
+ require_relative 'aws-sdk-core/refreshing_token'
28
+ require_relative 'aws-sdk-core/sso_token_provider'
29
+ require_relative 'aws-sdk-core/token_provider_chain'
30
+ require_relative 'aws-sdk-core/plugins/bearer_authorization'
31
+
23
32
  # client modules
24
33
 
25
34
  require_relative 'aws-sdk-core/client_stubs'
@@ -88,6 +97,10 @@ require_relative 'aws-sdk-core/arn'
88
97
  require_relative 'aws-sdk-core/arn_parser'
89
98
  require_relative 'aws-sdk-core/ec2_metadata'
90
99
 
100
+ # dynamic endpoints
101
+ require_relative 'aws-sdk-core/endpoints'
102
+ require_relative 'aws-sdk-core/plugins/signature_v4'
103
+
91
104
  # defaults
92
105
  require_relative 'aws-defaults'
93
106
 
@@ -99,6 +112,7 @@ require_relative 'aws-sdk-sts'
99
112
 
100
113
  # aws-sdk-sso is included to support Aws::SSOCredentials
101
114
  require_relative 'aws-sdk-sso'
115
+ require_relative 'aws-sdk-ssooidc'
102
116
 
103
117
  module Aws
104
118
 
@@ -28,9 +28,10 @@ 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
- require 'aws-sdk-core/plugins/signature_v4.rb'
34
+ require 'aws-sdk-core/plugins/sign.rb'
34
35
  require 'aws-sdk-core/plugins/protocols/rest_json.rb'
35
36
 
36
37
  Aws::Plugins::GlobalConfiguration.add_identifier(:sso)
@@ -77,10 +78,12 @@ 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
- add_plugin(Aws::Plugins::SignatureV4)
84
+ add_plugin(Aws::Plugins::Sign)
83
85
  add_plugin(Aws::Plugins::Protocols::RestJson)
86
+ add_plugin(Aws::SSO::Plugins::Endpoints)
84
87
 
85
88
  # @overload initialize(options)
86
89
  # @param [Hash] options
@@ -189,6 +192,10 @@ module Aws::SSO
189
192
  # Set to true to disable SDK automatically adding host prefix
190
193
  # to default service endpoint when available.
191
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
+ #
192
199
  # @option options [String] :endpoint
193
200
  # The client endpoint is normally constructed from the `:region`
194
201
  # option. You should only configure an `:endpoint` when connecting
@@ -209,6 +216,10 @@ module Aws::SSO
209
216
  # @option options [Boolean] :endpoint_discovery (false)
210
217
  # When set to `true`, endpoint discovery will be enabled for operations when available.
211
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
+ #
212
223
  # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
213
224
  # The log formatter.
214
225
  #
@@ -229,6 +240,11 @@ module Aws::SSO
229
240
  # Used when loading credentials from the shared credentials file
230
241
  # at HOME/.aws/credentials. When not specified, 'default' is used.
231
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
+ #
232
248
  # @option options [Proc] :retry_backoff
233
249
  # A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
234
250
  # This option is only used in the `legacy` retry mode.
@@ -274,6 +290,11 @@ module Aws::SSO
274
290
  # in the future.
275
291
  #
276
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
+ #
277
298
  # @option options [String] :secret_access_key
278
299
  #
279
300
  # @option options [String] :session_token
@@ -287,6 +308,19 @@ module Aws::SSO
287
308
  # ** Please note ** When response stubbing is enabled, no HTTP
288
309
  # requests are made, and retries are disabled.
289
310
  #
311
+ # @option options [Aws::TokenProvider] :token_provider
312
+ # A Bearer Token Provider. This can be an instance of any one of the
313
+ # following classes:
314
+ #
315
+ # * `Aws::StaticTokenProvider` - Used for configuring static, non-refreshing
316
+ # tokens.
317
+ #
318
+ # * `Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an
319
+ # access token generated from `aws login`.
320
+ #
321
+ # When `:token_provider` is not configured directly, the `Aws::TokenProviderChain`
322
+ # will be used to search for tokens configured for your profile in shared configuration files.
323
+ #
290
324
  # @option options [Boolean] :use_dualstack_endpoint
291
325
  # When set to `true`, dualstack enabled endpoints (with `.aws` TLD)
292
326
  # will be used if available.
@@ -300,6 +334,9 @@ module Aws::SSO
300
334
  # When `true`, request parameters are validated before
301
335
  # sending the request.
302
336
  #
337
+ # @option options [Aws::SSO::EndpointProvider] :endpoint_provider
338
+ # The endpoint provider used to resolve endpoints. Any object that responds to `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::SSO::EndpointParameters`
339
+ #
303
340
  # @option options [URI::HTTP,String] :http_proxy A proxy to send
304
341
  # requests through. Formatted like 'http://proxy.com:123'.
305
342
  #
@@ -362,7 +399,8 @@ module Aws::SSO
362
399
  #
363
400
  # @option params [required, String] :access_token
364
401
  # The token issued by the `CreateToken` API call. For more information,
365
- # see [CreateToken][1] in the *AWS SSO OIDC API Reference Guide*.
402
+ # see [CreateToken][1] in the *IAM Identity Center OIDC API Reference
403
+ # Guide*.
366
404
  #
367
405
  #
368
406
  #
@@ -407,7 +445,8 @@ module Aws::SSO
407
445
  #
408
446
  # @option params [required, String] :access_token
409
447
  # The token issued by the `CreateToken` API call. For more information,
410
- # see [CreateToken][1] in the *AWS SSO OIDC API Reference Guide*.
448
+ # see [CreateToken][1] in the *IAM Identity Center OIDC API Reference
449
+ # Guide*.
411
450
  #
412
451
  #
413
452
  #
@@ -450,8 +489,8 @@ module Aws::SSO
450
489
 
451
490
  # Lists all AWS accounts assigned to the user. These AWS accounts are
452
491
  # assigned by the administrator of the account. For more information,
453
- # see [Assign User Access][1] in the *AWS SSO User Guide*. This
454
- # operation returns a paginated response.
492
+ # see [Assign User Access][1] in the *IAM Identity Center User Guide*.
493
+ # This operation returns a paginated response.
455
494
  #
456
495
  #
457
496
  #
@@ -466,7 +505,8 @@ module Aws::SSO
466
505
  #
467
506
  # @option params [required, String] :access_token
468
507
  # The token issued by the `CreateToken` API call. For more information,
469
- # see [CreateToken][1] in the *AWS SSO OIDC API Reference Guide*.
508
+ # see [CreateToken][1] in the *IAM Identity Center OIDC API Reference
509
+ # Guide*.
470
510
  #
471
511
  #
472
512
  #
@@ -504,12 +544,32 @@ module Aws::SSO
504
544
  req.send_request(options)
505
545
  end
506
546
 
507
- # Removes the client- and server-side session that is associated with
508
- # the user.
547
+ # Removes the locally stored SSO tokens from the client-side cache and
548
+ # sends an API call to the IAM Identity Center service to invalidate the
549
+ # corresponding server-side IAM Identity Center sign in session.
550
+ #
551
+ # <note markdown="1"> If a user uses IAM Identity Center to access the AWS CLI, the user’s
552
+ # IAM Identity Center sign in session is used to obtain an IAM session,
553
+ # as specified in the corresponding IAM Identity Center permission set.
554
+ # More specifically, IAM Identity Center assumes an IAM role in the
555
+ # target account on behalf of the user, and the corresponding temporary
556
+ # AWS credentials are returned to the client.
557
+ #
558
+ # After user logout, any existing IAM role sessions that were created by
559
+ # using IAM Identity Center permission sets continue based on the
560
+ # duration configured in the permission set. For more information, see
561
+ # [User authentications][1] in the *IAM Identity Center User Guide*.
562
+ #
563
+ # </note>
564
+ #
565
+ #
566
+ #
567
+ # [1]: https://docs.aws.amazon.com/singlesignon/latest/userguide/authconcept.html
509
568
  #
510
569
  # @option params [required, String] :access_token
511
570
  # The token issued by the `CreateToken` API call. For more information,
512
- # see [CreateToken][1] in the *AWS SSO OIDC API Reference Guide*.
571
+ # see [CreateToken][1] in the *IAM Identity Center OIDC API Reference
572
+ # Guide*.
513
573
  #
514
574
  #
515
575
  #
@@ -545,7 +605,7 @@ module Aws::SSO
545
605
  params: params,
546
606
  config: config)
547
607
  context[:gem_name] = 'aws-sdk-core'
548
- context[:gem_version] = '3.131.1'
608
+ context[:gem_version] = '3.188.0'
549
609
  Seahorse::Client::Request.new(handlers, context)
550
610
  end
551
611
 
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::SSO
11
+ # Endpoint parameters used to influence endpoints per request.
12
+ #
13
+ # @!attribute region
14
+ # The AWS region used to dispatch the request.
15
+ #
16
+ # @return [String]
17
+ #
18
+ # @!attribute use_dual_stack
19
+ # When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
20
+ #
21
+ # @return [Boolean]
22
+ #
23
+ # @!attribute use_fips
24
+ # When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
25
+ #
26
+ # @return [Boolean]
27
+ #
28
+ # @!attribute endpoint
29
+ # Override the endpoint used to send this request
30
+ #
31
+ # @return [String]
32
+ #
33
+ EndpointParameters = Struct.new(
34
+ :region,
35
+ :use_dual_stack,
36
+ :use_fips,
37
+ :endpoint,
38
+ ) do
39
+ include Aws::Structure
40
+
41
+ # @api private
42
+ class << self
43
+ PARAM_MAP = {
44
+ 'Region' => :region,
45
+ 'UseDualStack' => :use_dual_stack,
46
+ 'UseFIPS' => :use_fips,
47
+ 'Endpoint' => :endpoint,
48
+ }.freeze
49
+ end
50
+
51
+ def initialize(options = {})
52
+ self[:region] = options[:region]
53
+ self[:use_dual_stack] = options[:use_dual_stack]
54
+ self[:use_dual_stack] = false if self[:use_dual_stack].nil?
55
+ if self[:use_dual_stack].nil?
56
+ raise ArgumentError, "Missing required EndpointParameter: :use_dual_stack"
57
+ end
58
+ self[:use_fips] = options[:use_fips]
59
+ self[:use_fips] = false if self[:use_fips].nil?
60
+ if self[:use_fips].nil?
61
+ raise ArgumentError, "Missing required EndpointParameter: :use_fips"
62
+ end
63
+ self[:endpoint] = options[:endpoint]
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::SSO
11
+ class EndpointProvider
12
+ def resolve_endpoint(parameters)
13
+ region = parameters.region
14
+ use_dual_stack = parameters.use_dual_stack
15
+ use_fips = parameters.use_fips
16
+ endpoint = parameters.endpoint
17
+ if Aws::Endpoints::Matchers.set?(endpoint)
18
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
19
+ raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
20
+ end
21
+ if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
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"
48
+ end
49
+ return Aws::Endpoints::Endpoint.new(url: "https://portal.sso.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
50
+ end
51
+ end
52
+ raise ArgumentError, "Invalid Configuration: Missing Region"
53
+ raise ArgumentError, 'No endpoint could be resolved'
54
+
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::SSO
12
+ # @api private
13
+ module Endpoints
14
+
15
+ class GetRoleCredentials
16
+ def self.build(context)
17
+ unless context.config.regional_endpoint
18
+ endpoint = context.config.endpoint.to_s
19
+ end
20
+ Aws::SSO::EndpointParameters.new(
21
+ region: context.config.region,
22
+ use_dual_stack: context.config.use_dualstack_endpoint,
23
+ use_fips: context.config.use_fips_endpoint,
24
+ endpoint: endpoint,
25
+ )
26
+ end
27
+ end
28
+
29
+ class ListAccountRoles
30
+ def self.build(context)
31
+ unless context.config.regional_endpoint
32
+ endpoint = context.config.endpoint.to_s
33
+ end
34
+ Aws::SSO::EndpointParameters.new(
35
+ region: context.config.region,
36
+ use_dual_stack: context.config.use_dualstack_endpoint,
37
+ use_fips: context.config.use_fips_endpoint,
38
+ endpoint: endpoint,
39
+ )
40
+ end
41
+ end
42
+
43
+ class ListAccounts
44
+ def self.build(context)
45
+ unless context.config.regional_endpoint
46
+ endpoint = context.config.endpoint.to_s
47
+ end
48
+ Aws::SSO::EndpointParameters.new(
49
+ region: context.config.region,
50
+ use_dual_stack: context.config.use_dualstack_endpoint,
51
+ use_fips: context.config.use_fips_endpoint,
52
+ endpoint: endpoint,
53
+ )
54
+ end
55
+ end
56
+
57
+ class Logout
58
+ def self.build(context)
59
+ unless context.config.regional_endpoint
60
+ endpoint = context.config.endpoint.to_s
61
+ end
62
+ Aws::SSO::EndpointParameters.new(
63
+ region: context.config.region,
64
+ use_dual_stack: context.config.use_dualstack_endpoint,
65
+ use_fips: context.config.use_fips_endpoint,
66
+ endpoint: endpoint,
67
+ )
68
+ end
69
+ end
70
+
71
+ end
72
+ end