aws-sdk-core 3.173.0 → 3.254.1

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 (213) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +947 -0
  3. data/VERSION +1 -1
  4. data/lib/aws-defaults/default_configuration.rb +5 -6
  5. data/lib/aws-defaults.rb +4 -1
  6. data/lib/aws-sdk-core/arn.rb +1 -3
  7. data/lib/aws-sdk-core/assume_role_credentials.rb +21 -13
  8. data/lib/aws-sdk-core/assume_role_web_identity_credentials.rb +16 -9
  9. data/lib/aws-sdk-core/binary/decode_handler.rb +3 -9
  10. data/lib/aws-sdk-core/binary/encode_handler.rb +1 -1
  11. data/lib/aws-sdk-core/binary/event_builder.rb +34 -37
  12. data/lib/aws-sdk-core/binary/event_stream_decoder.rb +1 -0
  13. data/lib/aws-sdk-core/binary/event_stream_encoder.rb +4 -3
  14. data/lib/aws-sdk-core/cbor/decoder.rb +309 -0
  15. data/lib/aws-sdk-core/cbor/encoder.rb +243 -0
  16. data/lib/aws-sdk-core/cbor.rb +53 -0
  17. data/lib/aws-sdk-core/client_side_monitoring.rb +9 -0
  18. data/lib/aws-sdk-core/client_stubs.rb +39 -55
  19. data/lib/aws-sdk-core/credential_provider.rb +8 -1
  20. data/lib/aws-sdk-core/credential_provider_chain.rb +101 -25
  21. data/lib/aws-sdk-core/credentials.rb +19 -6
  22. data/lib/aws-sdk-core/ec2_metadata.rb +1 -1
  23. data/lib/aws-sdk-core/ecs_credentials.rb +104 -26
  24. data/lib/aws-sdk-core/endpoints/endpoint.rb +3 -1
  25. data/lib/aws-sdk-core/endpoints/matchers.rb +21 -19
  26. data/lib/aws-sdk-core/endpoints.rb +106 -22
  27. data/lib/aws-sdk-core/error_handler.rb +46 -0
  28. data/lib/aws-sdk-core/errors.rb +17 -5
  29. data/lib/aws-sdk-core/event_emitter.rb +1 -17
  30. data/lib/aws-sdk-core/ini_parser.rb +7 -0
  31. data/lib/aws-sdk-core/instance_profile_credentials.rb +181 -158
  32. data/lib/aws-sdk-core/json/builder.rb +23 -1
  33. data/lib/aws-sdk-core/json/error_handler.rb +31 -14
  34. data/lib/aws-sdk-core/json/handler.rb +13 -6
  35. data/lib/aws-sdk-core/json/json_engine.rb +3 -1
  36. data/lib/aws-sdk-core/json/oj_engine.rb +7 -1
  37. data/lib/aws-sdk-core/json/parser.rb +33 -3
  38. data/lib/aws-sdk-core/json.rb +43 -14
  39. data/lib/aws-sdk-core/log/param_filter.rb +2 -2
  40. data/lib/aws-sdk-core/log/param_formatter.rb +7 -3
  41. data/lib/aws-sdk-core/log.rb +10 -0
  42. data/lib/aws-sdk-core/login_credentials.rb +230 -0
  43. data/lib/aws-sdk-core/lru_cache.rb +75 -0
  44. data/lib/aws-sdk-core/pageable_response.rb +3 -1
  45. data/lib/aws-sdk-core/param_validator.rb +9 -4
  46. data/lib/aws-sdk-core/plugins/bearer_authorization.rb +2 -0
  47. data/lib/aws-sdk-core/plugins/checksum_algorithm.rb +437 -201
  48. data/lib/aws-sdk-core/plugins/client_metrics_plugin.rb +1 -1
  49. data/lib/aws-sdk-core/plugins/client_metrics_send_plugin.rb +14 -2
  50. data/lib/aws-sdk-core/plugins/credentials_configuration.rb +78 -56
  51. data/lib/aws-sdk-core/plugins/endpoint_pattern.rb +40 -32
  52. data/lib/aws-sdk-core/plugins/global_configuration.rb +8 -9
  53. data/lib/aws-sdk-core/plugins/http_checksum.rb +3 -8
  54. data/lib/aws-sdk-core/plugins/invocation_id.rb +1 -11
  55. data/lib/aws-sdk-core/plugins/logging.rb +2 -0
  56. data/lib/aws-sdk-core/plugins/protocols/api_gateway.rb +3 -1
  57. data/lib/aws-sdk-core/plugins/protocols/ec2.rb +2 -24
  58. data/lib/aws-sdk-core/plugins/protocols/json_rpc.rb +6 -8
  59. data/lib/aws-sdk-core/plugins/protocols/query.rb +4 -2
  60. data/lib/aws-sdk-core/plugins/protocols/rest_json.rb +3 -15
  61. data/lib/aws-sdk-core/plugins/protocols/rest_xml.rb +3 -0
  62. data/lib/aws-sdk-core/plugins/protocols/rpc_v2.rb +17 -0
  63. data/lib/aws-sdk-core/plugins/regional_endpoint.rb +162 -37
  64. data/lib/aws-sdk-core/plugins/request_compression.rb +226 -0
  65. data/lib/aws-sdk-core/plugins/retries/clock_skew.rb +28 -16
  66. data/lib/aws-sdk-core/plugins/retries/retry_quota.rb +11 -8
  67. data/lib/aws-sdk-core/plugins/retry_errors.rb +211 -110
  68. data/lib/aws-sdk-core/plugins/sign.rb +55 -33
  69. data/lib/aws-sdk-core/plugins/signature_v2.rb +2 -1
  70. data/lib/aws-sdk-core/plugins/signature_v4.rb +2 -1
  71. data/lib/aws-sdk-core/plugins/stub_responses.rb +59 -9
  72. data/lib/aws-sdk-core/plugins/telemetry.rb +75 -0
  73. data/lib/aws-sdk-core/plugins/transfer_encoding.rb +16 -9
  74. data/lib/aws-sdk-core/plugins/user_agent.rb +205 -14
  75. data/lib/aws-sdk-core/plugins.rb +39 -0
  76. data/lib/aws-sdk-core/process_credentials.rb +48 -29
  77. data/lib/aws-sdk-core/query/ec2_handler.rb +27 -0
  78. data/lib/aws-sdk-core/query/ec2_param_builder.rb +5 -7
  79. data/lib/aws-sdk-core/query/handler.rb +4 -4
  80. data/lib/aws-sdk-core/query/param_builder.rb +2 -2
  81. data/lib/aws-sdk-core/query.rb +2 -1
  82. data/lib/aws-sdk-core/refreshing_credentials.rb +20 -23
  83. data/lib/aws-sdk-core/resources.rb +8 -0
  84. data/lib/aws-sdk-core/rest/content_type_handler.rb +60 -0
  85. data/lib/aws-sdk-core/rest/handler.rb +3 -4
  86. data/lib/aws-sdk-core/rest/request/body.rb +32 -5
  87. data/lib/aws-sdk-core/rest/request/endpoint.rb +24 -4
  88. data/lib/aws-sdk-core/rest/request/headers.rb +15 -7
  89. data/lib/aws-sdk-core/rest/request/querystring_builder.rb +62 -36
  90. data/lib/aws-sdk-core/rest/response/body.rb +15 -1
  91. data/lib/aws-sdk-core/rest/response/header_list_parser.rb +79 -0
  92. data/lib/aws-sdk-core/rest/response/headers.rb +8 -3
  93. data/lib/aws-sdk-core/rest.rb +1 -0
  94. data/lib/aws-sdk-core/rpc_v2/builder.rb +62 -0
  95. data/lib/aws-sdk-core/rpc_v2/cbor_engine.rb +18 -0
  96. data/lib/aws-sdk-core/rpc_v2/content_type_handler.rb +47 -0
  97. data/lib/aws-sdk-core/rpc_v2/error_handler.rb +95 -0
  98. data/lib/aws-sdk-core/rpc_v2/handler.rb +79 -0
  99. data/lib/aws-sdk-core/rpc_v2/parser.rb +98 -0
  100. data/lib/aws-sdk-core/rpc_v2.rb +69 -0
  101. data/lib/aws-sdk-core/shared_config.rb +155 -39
  102. data/lib/aws-sdk-core/shared_credentials.rb +1 -7
  103. data/lib/aws-sdk-core/sso_credentials.rb +6 -3
  104. data/lib/aws-sdk-core/sso_token_provider.rb +1 -0
  105. data/lib/aws-sdk-core/static_token_provider.rb +1 -2
  106. data/lib/aws-sdk-core/stubbing/protocols/ec2.rb +12 -11
  107. data/lib/aws-sdk-core/stubbing/protocols/json.rb +11 -10
  108. data/lib/aws-sdk-core/stubbing/protocols/query.rb +7 -6
  109. data/lib/aws-sdk-core/stubbing/protocols/rest.rb +2 -1
  110. data/lib/aws-sdk-core/stubbing/protocols/rest_json.rb +9 -8
  111. data/lib/aws-sdk-core/stubbing/protocols/rest_xml.rb +6 -5
  112. data/lib/aws-sdk-core/stubbing/protocols/rpc_v2.rb +39 -0
  113. data/lib/aws-sdk-core/stubbing/stub_data.rb +11 -0
  114. data/lib/aws-sdk-core/stubbing.rb +22 -0
  115. data/lib/aws-sdk-core/telemetry/base.rb +177 -0
  116. data/lib/aws-sdk-core/telemetry/no_op.rb +70 -0
  117. data/lib/aws-sdk-core/telemetry/otel.rb +235 -0
  118. data/lib/aws-sdk-core/telemetry/span_kind.rb +22 -0
  119. data/lib/aws-sdk-core/telemetry/span_status.rb +59 -0
  120. data/lib/aws-sdk-core/telemetry.rb +78 -0
  121. data/lib/aws-sdk-core/token.rb +3 -3
  122. data/lib/aws-sdk-core/token_provider.rb +4 -0
  123. data/lib/aws-sdk-core/token_provider_chain.rb +2 -6
  124. data/lib/aws-sdk-core/util.rb +41 -1
  125. data/lib/aws-sdk-core/waiters/poller.rb +12 -5
  126. data/lib/aws-sdk-core/xml/builder.rb +17 -9
  127. data/lib/aws-sdk-core/xml/error_handler.rb +35 -43
  128. data/lib/aws-sdk-core/xml/parser/frame.rb +4 -20
  129. data/lib/aws-sdk-core/xml/parser/stack.rb +2 -0
  130. data/lib/aws-sdk-core/xml/parser.rb +2 -6
  131. data/lib/aws-sdk-core.rb +86 -107
  132. data/lib/aws-sdk-signin/client.rb +1008 -0
  133. data/lib/aws-sdk-signin/client_api.rb +444 -0
  134. data/lib/aws-sdk-signin/customizations.rb +1 -0
  135. data/lib/aws-sdk-signin/endpoint_parameters.rb +85 -0
  136. data/lib/aws-sdk-signin/endpoint_provider.rb +107 -0
  137. data/lib/aws-sdk-signin/endpoints.rb +133 -0
  138. data/lib/aws-sdk-signin/errors.rb +185 -0
  139. data/lib/aws-sdk-signin/plugins/endpoints.rb +77 -0
  140. data/lib/aws-sdk-signin/resource.rb +26 -0
  141. data/lib/aws-sdk-signin/types.rb +909 -0
  142. data/lib/aws-sdk-signin.rb +63 -0
  143. data/lib/aws-sdk-sso/client.rb +210 -99
  144. data/lib/aws-sdk-sso/client_api.rb +7 -0
  145. data/lib/aws-sdk-sso/endpoint_parameters.rb +13 -10
  146. data/lib/aws-sdk-sso/endpoint_provider.rb +30 -28
  147. data/lib/aws-sdk-sso/endpoints.rb +3 -54
  148. data/lib/aws-sdk-sso/plugins/endpoints.rb +23 -22
  149. data/lib/aws-sdk-sso/types.rb +1 -0
  150. data/lib/aws-sdk-sso.rb +15 -11
  151. data/lib/aws-sdk-ssooidc/client.rb +630 -132
  152. data/lib/aws-sdk-ssooidc/client_api.rb +94 -1
  153. data/lib/aws-sdk-ssooidc/endpoint_parameters.rb +13 -10
  154. data/lib/aws-sdk-ssooidc/endpoint_provider.rb +30 -28
  155. data/lib/aws-sdk-ssooidc/endpoints.rb +3 -40
  156. data/lib/aws-sdk-ssooidc/errors.rb +62 -0
  157. data/lib/aws-sdk-ssooidc/plugins/endpoints.rb +23 -20
  158. data/lib/aws-sdk-ssooidc/types.rb +419 -53
  159. data/lib/aws-sdk-ssooidc.rb +15 -11
  160. data/lib/aws-sdk-sts/client.rb +567 -158
  161. data/lib/aws-sdk-sts/client_api.rb +120 -9
  162. data/lib/aws-sdk-sts/customizations.rb +5 -2
  163. data/lib/aws-sdk-sts/endpoint_parameters.rb +15 -14
  164. data/lib/aws-sdk-sts/endpoint_provider.rb +52 -57
  165. data/lib/aws-sdk-sts/endpoints.rb +3 -118
  166. data/lib/aws-sdk-sts/errors.rb +79 -0
  167. data/lib/aws-sdk-sts/plugins/endpoints.rb +23 -30
  168. data/lib/aws-sdk-sts/presigner.rb +3 -7
  169. data/lib/aws-sdk-sts/types.rb +382 -31
  170. data/lib/aws-sdk-sts.rb +15 -11
  171. data/lib/seahorse/client/async_base.rb +4 -5
  172. data/lib/seahorse/client/async_response.rb +19 -0
  173. data/lib/seahorse/client/base.rb +18 -21
  174. data/lib/seahorse/client/configuration.rb +0 -4
  175. data/lib/seahorse/client/h2/connection.rb +18 -28
  176. data/lib/seahorse/client/h2/handler.rb +19 -3
  177. data/lib/seahorse/client/handler.rb +1 -1
  178. data/lib/seahorse/client/http/response.rb +1 -1
  179. data/lib/seahorse/client/net_http/connection_pool.rb +15 -12
  180. data/lib/seahorse/client/net_http/handler.rb +21 -9
  181. data/lib/seahorse/client/net_http/patches.rb +44 -14
  182. data/lib/seahorse/client/networking_error.rb +1 -1
  183. data/lib/seahorse/client/plugin.rb +9 -0
  184. data/lib/seahorse/client/plugins/endpoint.rb +0 -1
  185. data/lib/seahorse/client/plugins/h2.rb +4 -4
  186. data/lib/seahorse/client/plugins/net_http.rb +57 -16
  187. data/lib/seahorse/client/plugins/request_callback.rb +31 -0
  188. data/lib/seahorse/client/request_context.rb +9 -2
  189. data/lib/seahorse/client/response.rb +8 -0
  190. data/lib/seahorse/model/operation.rb +3 -0
  191. data/lib/seahorse/model/shapes.rb +2 -2
  192. data/lib/seahorse/util.rb +2 -1
  193. data/sig/aws-sdk-core/async_client_stubs.rbs +21 -0
  194. data/sig/aws-sdk-core/client_stubs.rbs +10 -0
  195. data/sig/aws-sdk-core/errors.rbs +22 -0
  196. data/sig/aws-sdk-core/resources/collection.rbs +21 -0
  197. data/sig/aws-sdk-core/structure.rbs +4 -0
  198. data/sig/aws-sdk-core/telemetry/base.rbs +46 -0
  199. data/sig/aws-sdk-core/telemetry/otel.rbs +22 -0
  200. data/sig/aws-sdk-core/telemetry/span_kind.rbs +15 -0
  201. data/sig/aws-sdk-core/telemetry/span_status.rbs +24 -0
  202. data/sig/aws-sdk-core/waiters/errors.rbs +20 -0
  203. data/sig/aws-sdk-core.rbs +7 -0
  204. data/sig/seahorse/client/async_base.rbs +18 -0
  205. data/sig/seahorse/client/base.rbs +25 -0
  206. data/sig/seahorse/client/handler_builder.rbs +16 -0
  207. data/sig/seahorse/client/response.rbs +61 -0
  208. metadata +118 -23
  209. /data/lib/aws-sdk-core/xml/parser/{engines/libxml.rb → libxml_engine.rb} +0 -0
  210. /data/lib/aws-sdk-core/xml/parser/{engines/nokogiri.rb → nokogiri_engine.rb} +0 -0
  211. /data/lib/aws-sdk-core/xml/parser/{engines/oga.rb → oga_engine.rb} +0 -0
  212. /data/lib/aws-sdk-core/xml/parser/{engines/ox.rb → ox_engine.rb} +0 -0
  213. /data/lib/aws-sdk-core/xml/parser/{engines/rexml.rb → rexml_engine.rb} +0 -0
@@ -0,0 +1,107 @@
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::Signin
11
+ class EndpointProvider
12
+ def resolve_endpoint(parameters)
13
+ if Aws::Endpoints::Matchers.set?(parameters.is_control_plane) && Aws::Endpoints::Matchers.boolean_equals?(parameters.is_control_plane, true) && Aws::Endpoints::Matchers.set?(parameters.region) && (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region))
14
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws")
15
+ return Aws::Endpoints::Endpoint.new(url: "https://signin.#{parameters.region}.api.aws", headers: {}, properties: {"authSchemes" => [{"name" => "sigv4", "signingName" => "signin", "signingRegion" => "#{parameters.region}"}]})
16
+ end
17
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-cn")
18
+ return Aws::Endpoints::Endpoint.new(url: "https://signin.#{parameters.region}.api.amazonwebservices.com.cn", headers: {}, properties: {"authSchemes" => [{"name" => "sigv4", "signingName" => "signin", "signingRegion" => "#{parameters.region}"}]})
19
+ end
20
+ return Aws::Endpoints::Endpoint.new(url: "https://signin.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {"authSchemes" => [{"name" => "sigv4", "signingName" => "signin", "signingRegion" => "#{parameters.region}"}]})
21
+ end
22
+ if Aws::Endpoints::Matchers.set?(parameters.is_o_auth_endpoint) && Aws::Endpoints::Matchers.boolean_equals?(parameters.is_o_auth_endpoint, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true)
23
+ raise ArgumentError, "FIPS endpoints are not supported for OAuth operations. Disable FIPS or use a non-OAuth operation."
24
+ end
25
+ if Aws::Endpoints::Matchers.set?(parameters.is_o_auth_endpoint) && Aws::Endpoints::Matchers.boolean_equals?(parameters.is_o_auth_endpoint, true) && Aws::Endpoints::Matchers.set?(parameters.region) && Aws::Endpoints::Matchers.not(Aws::Endpoints::Matchers.set?(parameters.endpoint)) && (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region)) && Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws")
26
+ return Aws::Endpoints::Endpoint.new(url: "https://#{parameters.region}.oauth.signin.aws", headers: {}, properties: {"authSchemes" => [{"name" => "sigv4", "signingName" => "signin", "signingRegion" => "#{parameters.region}"}]})
27
+ end
28
+ if Aws::Endpoints::Matchers.set?(parameters.region) && Aws::Endpoints::Matchers.not(Aws::Endpoints::Matchers.set?(parameters.endpoint)) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false) && (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region)) && Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws")
29
+ return Aws::Endpoints::Endpoint.new(url: "https://#{parameters.region}.signin.aws.amazon.com", headers: {}, properties: {})
30
+ end
31
+ if Aws::Endpoints::Matchers.set?(parameters.region) && Aws::Endpoints::Matchers.not(Aws::Endpoints::Matchers.set?(parameters.endpoint)) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false) && (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region)) && Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-cn")
32
+ return Aws::Endpoints::Endpoint.new(url: "https://#{parameters.region}.signin.amazonaws.cn", headers: {}, properties: {})
33
+ end
34
+ if Aws::Endpoints::Matchers.set?(parameters.region) && Aws::Endpoints::Matchers.not(Aws::Endpoints::Matchers.set?(parameters.endpoint)) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false) && (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region)) && Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-us-gov")
35
+ return Aws::Endpoints::Endpoint.new(url: "https://#{parameters.region}.signin.amazonaws-us-gov.com", headers: {}, properties: {})
36
+ end
37
+ if Aws::Endpoints::Matchers.set?(parameters.region) && Aws::Endpoints::Matchers.not(Aws::Endpoints::Matchers.set?(parameters.endpoint)) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false) && (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region)) && Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-iso")
38
+ return Aws::Endpoints::Endpoint.new(url: "https://#{parameters.region}.signin.c2shome.ic.gov", headers: {}, properties: {})
39
+ end
40
+ if Aws::Endpoints::Matchers.set?(parameters.region) && Aws::Endpoints::Matchers.not(Aws::Endpoints::Matchers.set?(parameters.endpoint)) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false) && (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region)) && Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-iso-b")
41
+ return Aws::Endpoints::Endpoint.new(url: "https://#{parameters.region}.signin.sc2shome.sgov.gov", headers: {}, properties: {})
42
+ end
43
+ if Aws::Endpoints::Matchers.set?(parameters.region) && Aws::Endpoints::Matchers.not(Aws::Endpoints::Matchers.set?(parameters.endpoint)) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false) && (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region)) && Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-iso-f")
44
+ return Aws::Endpoints::Endpoint.new(url: "https://#{parameters.region}.signin.csphome.hci.ic.gov", headers: {}, properties: {})
45
+ end
46
+ if Aws::Endpoints::Matchers.set?(parameters.region) && Aws::Endpoints::Matchers.not(Aws::Endpoints::Matchers.set?(parameters.endpoint)) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false) && (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region)) && Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-iso-e")
47
+ return Aws::Endpoints::Endpoint.new(url: "https://#{parameters.region}.signin.csphome.adc-e.uk", headers: {}, properties: {})
48
+ end
49
+ if Aws::Endpoints::Matchers.set?(parameters.region) && Aws::Endpoints::Matchers.not(Aws::Endpoints::Matchers.set?(parameters.endpoint)) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false) && (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region)) && Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-eusc")
50
+ return Aws::Endpoints::Endpoint.new(url: "https://#{parameters.region}.signin.amazonaws-eusc.eu", headers: {}, properties: {})
51
+ end
52
+ if Aws::Endpoints::Matchers.set?(parameters.region) && Aws::Endpoints::Matchers.not(Aws::Endpoints::Matchers.set?(parameters.endpoint)) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false) && Aws::Endpoints::Matchers.string_equals?(parameters.region, "us-gov-west-1")
53
+ return Aws::Endpoints::Endpoint.new(url: "https://signin-fips.amazonaws-us-gov.com", headers: {}, properties: {})
54
+ end
55
+ if Aws::Endpoints::Matchers.set?(parameters.region) && Aws::Endpoints::Matchers.not(Aws::Endpoints::Matchers.set?(parameters.endpoint)) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false) && (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region)) && Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-us-gov")
56
+ return Aws::Endpoints::Endpoint.new(url: "https://#{parameters.region}.signin-fips.amazonaws-us-gov.com", headers: {}, properties: {})
57
+ end
58
+ if Aws::Endpoints::Matchers.set?(parameters.region) && Aws::Endpoints::Matchers.not(Aws::Endpoints::Matchers.set?(parameters.endpoint)) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false) && (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region))
59
+ return Aws::Endpoints::Endpoint.new(url: "https://#{parameters.region}.signin.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
60
+ end
61
+ if Aws::Endpoints::Matchers.set?(parameters.endpoint)
62
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true)
63
+ raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
64
+ end
65
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
66
+ raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
67
+ end
68
+ return Aws::Endpoints::Endpoint.new(url: parameters.endpoint, headers: {}, properties: {})
69
+ end
70
+ if Aws::Endpoints::Matchers.set?(parameters.region)
71
+ if (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region))
72
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws") && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false)
73
+ return Aws::Endpoints::Endpoint.new(url: "https://#{parameters.region}.signin.aws.amazon.com", headers: {}, properties: {})
74
+ end
75
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-cn") && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false)
76
+ return Aws::Endpoints::Endpoint.new(url: "https://#{parameters.region}.signin.amazonaws.cn", headers: {}, properties: {})
77
+ end
78
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-us-gov") && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false)
79
+ return Aws::Endpoints::Endpoint.new(url: "https://#{parameters.region}.signin.amazonaws-us-gov.com", headers: {}, properties: {})
80
+ end
81
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
82
+ 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"))
83
+ return Aws::Endpoints::Endpoint.new(url: "https://signin-fips.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
84
+ end
85
+ raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
86
+ end
87
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false)
88
+ if Aws::Endpoints::Matchers.boolean_equals?(Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"), true)
89
+ return Aws::Endpoints::Endpoint.new(url: "https://signin-fips.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
90
+ end
91
+ raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
92
+ end
93
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
94
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
95
+ return Aws::Endpoints::Endpoint.new(url: "https://signin.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
96
+ end
97
+ raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
98
+ end
99
+ return Aws::Endpoints::Endpoint.new(url: "https://signin.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
100
+ end
101
+ end
102
+ raise ArgumentError, "Invalid Configuration: Missing Region"
103
+ raise ArgumentError, 'No endpoint could be resolved'
104
+
105
+ end
106
+ end
107
+ end
@@ -0,0 +1,133 @@
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::Signin
12
+ # @api private
13
+ module Endpoints
14
+
15
+ class CreateOAuth2TokenWithIAM
16
+ def self.build(context)
17
+ Aws::Signin::EndpointParameters.create(
18
+ context.config,
19
+ is_o_auth_endpoint: true,
20
+ )
21
+ end
22
+ end
23
+
24
+ class DeleteConsoleAuthorizationConfiguration
25
+ def self.build(context)
26
+ Aws::Signin::EndpointParameters.create(
27
+ context.config,
28
+ is_control_plane: true,
29
+ )
30
+ end
31
+ end
32
+
33
+ class DeleteResourcePermissionStatement
34
+ def self.build(context)
35
+ Aws::Signin::EndpointParameters.create(
36
+ context.config,
37
+ is_control_plane: true,
38
+ )
39
+ end
40
+ end
41
+
42
+ class GetConsoleAuthorizationConfiguration
43
+ def self.build(context)
44
+ Aws::Signin::EndpointParameters.create(
45
+ context.config,
46
+ is_control_plane: true,
47
+ )
48
+ end
49
+ end
50
+
51
+ class GetResourcePolicy
52
+ def self.build(context)
53
+ Aws::Signin::EndpointParameters.create(
54
+ context.config,
55
+ is_control_plane: true,
56
+ )
57
+ end
58
+ end
59
+
60
+ class IntrospectOAuth2TokenWithIAM
61
+ def self.build(context)
62
+ Aws::Signin::EndpointParameters.create(
63
+ context.config,
64
+ is_o_auth_endpoint: true,
65
+ )
66
+ end
67
+ end
68
+
69
+ class ListResourcePermissionStatements
70
+ def self.build(context)
71
+ Aws::Signin::EndpointParameters.create(
72
+ context.config,
73
+ is_control_plane: true,
74
+ )
75
+ end
76
+ end
77
+
78
+ class PutConsoleAuthorizationConfiguration
79
+ def self.build(context)
80
+ Aws::Signin::EndpointParameters.create(
81
+ context.config,
82
+ is_control_plane: true,
83
+ )
84
+ end
85
+ end
86
+
87
+ class PutResourcePermissionStatement
88
+ def self.build(context)
89
+ Aws::Signin::EndpointParameters.create(
90
+ context.config,
91
+ is_control_plane: true,
92
+ )
93
+ end
94
+ end
95
+
96
+ class RevokeOAuth2TokenWithIAM
97
+ def self.build(context)
98
+ Aws::Signin::EndpointParameters.create(
99
+ context.config,
100
+ is_o_auth_endpoint: true,
101
+ )
102
+ end
103
+ end
104
+
105
+
106
+ def self.parameters_for_operation(context)
107
+ case context.operation_name
108
+ when :create_o_auth_2_token_with_iam
109
+ CreateOAuth2TokenWithIAM.build(context)
110
+ when :delete_console_authorization_configuration
111
+ DeleteConsoleAuthorizationConfiguration.build(context)
112
+ when :delete_resource_permission_statement
113
+ DeleteResourcePermissionStatement.build(context)
114
+ when :get_console_authorization_configuration
115
+ GetConsoleAuthorizationConfiguration.build(context)
116
+ when :get_resource_policy
117
+ GetResourcePolicy.build(context)
118
+ when :introspect_o_auth_2_token_with_iam
119
+ IntrospectOAuth2TokenWithIAM.build(context)
120
+ when :list_resource_permission_statements
121
+ ListResourcePermissionStatements.build(context)
122
+ when :put_console_authorization_configuration
123
+ PutConsoleAuthorizationConfiguration.build(context)
124
+ when :put_resource_permission_statement
125
+ PutResourcePermissionStatement.build(context)
126
+ when :revoke_o_auth_2_token_with_iam
127
+ RevokeOAuth2TokenWithIAM.build(context)
128
+ else
129
+ Aws::Signin::EndpointParameters.create(context.config)
130
+ end
131
+ end
132
+ end
133
+ end
@@ -0,0 +1,185 @@
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::Signin
11
+
12
+ # When Signin returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::Signin::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all Signin errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::Signin::Errors::ServiceError
20
+ # # rescues all Signin API errors
21
+ # end
22
+ #
23
+ #
24
+ # ## Request Context
25
+ # ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns
26
+ # information about the request that generated the error.
27
+ # See {Seahorse::Client::RequestContext} for more information.
28
+ #
29
+ # ## Error Classes
30
+ # * {AccessDeniedException}
31
+ # * {ConflictException}
32
+ # * {InternalServerException}
33
+ # * {ResourceNotFoundException}
34
+ # * {ServiceQuotaExceededException}
35
+ # * {TooManyRequestsError}
36
+ # * {ValidationException}
37
+ #
38
+ # Additionally, error classes are dynamically generated for service errors based on the error code
39
+ # if they are not defined above.
40
+ module Errors
41
+
42
+ extend Aws::Errors::DynamicErrors
43
+
44
+ class AccessDeniedException < ServiceError
45
+
46
+ # @param [Seahorse::Client::RequestContext] context
47
+ # @param [String] message
48
+ # @param [Aws::Signin::Types::AccessDeniedException] data
49
+ def initialize(context, message, data = Aws::EmptyStructure.new)
50
+ super(context, message, data)
51
+ end
52
+
53
+ # @return [String]
54
+ def error
55
+ @data[:error]
56
+ end
57
+
58
+ # @return [String]
59
+ def message
60
+ @message || @data[:message]
61
+ end
62
+ end
63
+
64
+ class ConflictException < ServiceError
65
+
66
+ # @param [Seahorse::Client::RequestContext] context
67
+ # @param [String] message
68
+ # @param [Aws::Signin::Types::ConflictException] data
69
+ def initialize(context, message, data = Aws::EmptyStructure.new)
70
+ super(context, message, data)
71
+ end
72
+
73
+ # @return [String]
74
+ def error
75
+ @data[:error]
76
+ end
77
+
78
+ # @return [String]
79
+ def message
80
+ @message || @data[:message]
81
+ end
82
+ end
83
+
84
+ class InternalServerException < ServiceError
85
+
86
+ # @param [Seahorse::Client::RequestContext] context
87
+ # @param [String] message
88
+ # @param [Aws::Signin::Types::InternalServerException] data
89
+ def initialize(context, message, data = Aws::EmptyStructure.new)
90
+ super(context, message, data)
91
+ end
92
+
93
+ # @return [String]
94
+ def error
95
+ @data[:error]
96
+ end
97
+
98
+ # @return [String]
99
+ def message
100
+ @message || @data[:message]
101
+ end
102
+ end
103
+
104
+ class ResourceNotFoundException < ServiceError
105
+
106
+ # @param [Seahorse::Client::RequestContext] context
107
+ # @param [String] message
108
+ # @param [Aws::Signin::Types::ResourceNotFoundException] data
109
+ def initialize(context, message, data = Aws::EmptyStructure.new)
110
+ super(context, message, data)
111
+ end
112
+
113
+ # @return [String]
114
+ def error
115
+ @data[:error]
116
+ end
117
+
118
+ # @return [String]
119
+ def message
120
+ @message || @data[:message]
121
+ end
122
+ end
123
+
124
+ class ServiceQuotaExceededException < ServiceError
125
+
126
+ # @param [Seahorse::Client::RequestContext] context
127
+ # @param [String] message
128
+ # @param [Aws::Signin::Types::ServiceQuotaExceededException] data
129
+ def initialize(context, message, data = Aws::EmptyStructure.new)
130
+ super(context, message, data)
131
+ end
132
+
133
+ # @return [String]
134
+ def error
135
+ @data[:error]
136
+ end
137
+
138
+ # @return [String]
139
+ def message
140
+ @message || @data[:message]
141
+ end
142
+ end
143
+
144
+ class TooManyRequestsError < ServiceError
145
+
146
+ # @param [Seahorse::Client::RequestContext] context
147
+ # @param [String] message
148
+ # @param [Aws::Signin::Types::TooManyRequestsError] data
149
+ def initialize(context, message, data = Aws::EmptyStructure.new)
150
+ super(context, message, data)
151
+ end
152
+
153
+ # @return [String]
154
+ def error
155
+ @data[:error]
156
+ end
157
+
158
+ # @return [String]
159
+ def message
160
+ @message || @data[:message]
161
+ end
162
+ end
163
+
164
+ class ValidationException < ServiceError
165
+
166
+ # @param [Seahorse::Client::RequestContext] context
167
+ # @param [String] message
168
+ # @param [Aws::Signin::Types::ValidationException] data
169
+ def initialize(context, message, data = Aws::EmptyStructure.new)
170
+ super(context, message, data)
171
+ end
172
+
173
+ # @return [String]
174
+ def error
175
+ @data[:error]
176
+ end
177
+
178
+ # @return [String]
179
+ def message
180
+ @message || @data[:message]
181
+ end
182
+ end
183
+
184
+ end
185
+ end
@@ -0,0 +1,77 @@
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::Signin
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::Signin::EndpointProvider',
17
+ rbs_type: 'untyped',
18
+ docstring: <<~DOCS) do |_cfg|
19
+ The endpoint provider used to resolve endpoints. Any object that responds to
20
+ `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
21
+ `Aws::Signin::EndpointParameters`.
22
+ DOCS
23
+ Aws::Signin::EndpointProvider.new
24
+ end
25
+
26
+ # @api private
27
+ class Handler < Seahorse::Client::Handler
28
+ def call(context)
29
+ unless context[:discovered_endpoint]
30
+ params = Aws::Signin::Endpoints.parameters_for_operation(context)
31
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
32
+
33
+ context.http_request.endpoint = endpoint.url
34
+ apply_endpoint_headers(context, endpoint.headers)
35
+
36
+ context[:endpoint_params] = params
37
+ context[:endpoint_properties] = endpoint.properties
38
+ end
39
+
40
+ context[:auth_scheme] =
41
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
42
+
43
+ with_metrics(context) { @handler.call(context) }
44
+ end
45
+
46
+ private
47
+
48
+ def with_metrics(context, &block)
49
+ metrics = []
50
+ metrics << 'ENDPOINT_OVERRIDE' unless context.config.regional_endpoint
51
+ if context[:auth_scheme] && context[:auth_scheme]['name'] == 'sigv4a'
52
+ metrics << 'SIGV4A_SIGNING'
53
+ end
54
+ if context.config.credentials&.credentials&.account_id
55
+ metrics << 'RESOLVED_ACCOUNT_ID'
56
+ end
57
+ Aws::Plugins::UserAgent.metric(*metrics, &block)
58
+ end
59
+
60
+ def apply_endpoint_headers(context, headers)
61
+ headers.each do |key, values|
62
+ value = values
63
+ .compact
64
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
65
+ .join(',')
66
+
67
+ context.http_request.headers[key] = value
68
+ end
69
+ end
70
+ end
71
+
72
+ def add_handlers(handlers, _config)
73
+ handlers.add(Handler, step: :build, priority: 75)
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,26 @@
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::Signin
11
+
12
+ class Resource
13
+
14
+ # @param options ({})
15
+ # @option options [Client] :client
16
+ def initialize(options = {})
17
+ @client = options[:client] || Client.new(options)
18
+ end
19
+
20
+ # @return [Client]
21
+ def client
22
+ @client
23
+ end
24
+
25
+ end
26
+ end