aws-sdk-core 3.46.2 → 3.126.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +1258 -0
  3. data/LICENSE.txt +202 -0
  4. data/VERSION +1 -1
  5. data/lib/aws-defaults/default_configuration.rb +153 -0
  6. data/lib/aws-defaults/defaults_mode_config_resolver.rb +107 -0
  7. data/lib/aws-defaults.rb +3 -0
  8. data/lib/aws-sdk-core/arn.rb +92 -0
  9. data/lib/aws-sdk-core/arn_parser.rb +40 -0
  10. data/lib/aws-sdk-core/assume_role_credentials.rb +20 -0
  11. data/lib/aws-sdk-core/assume_role_web_identity_credentials.rb +109 -0
  12. data/lib/aws-sdk-core/async_client_stubs.rb +82 -0
  13. data/lib/aws-sdk-core/binary/decode_handler.rb +11 -1
  14. data/lib/aws-sdk-core/binary/encode_handler.rb +34 -0
  15. data/lib/aws-sdk-core/binary/event_builder.rb +124 -0
  16. data/lib/aws-sdk-core/binary/event_parser.rb +50 -18
  17. data/lib/aws-sdk-core/binary/event_stream_decoder.rb +7 -2
  18. data/lib/aws-sdk-core/binary/event_stream_encoder.rb +55 -0
  19. data/lib/aws-sdk-core/binary.rb +5 -0
  20. data/lib/aws-sdk-core/client_side_monitoring/publisher.rb +11 -1
  21. data/lib/aws-sdk-core/client_side_monitoring/request_metrics.rb +2 -0
  22. data/lib/aws-sdk-core/client_stubs.rb +16 -13
  23. data/lib/aws-sdk-core/credential_provider.rb +1 -30
  24. data/lib/aws-sdk-core/credential_provider_chain.rb +102 -40
  25. data/lib/aws-sdk-core/credentials.rb +2 -0
  26. data/lib/aws-sdk-core/deprecations.rb +17 -11
  27. data/lib/aws-sdk-core/eager_loader.rb +2 -0
  28. data/lib/aws-sdk-core/ec2_metadata.rb +238 -0
  29. data/lib/aws-sdk-core/ecs_credentials.rb +18 -9
  30. data/lib/aws-sdk-core/endpoint_cache.rb +16 -11
  31. data/lib/aws-sdk-core/errors.rb +138 -15
  32. data/lib/aws-sdk-core/event_emitter.rb +44 -0
  33. data/lib/aws-sdk-core/ini_parser.rb +2 -0
  34. data/lib/aws-sdk-core/instance_profile_credentials.rb +179 -42
  35. data/lib/aws-sdk-core/json/builder.rb +2 -0
  36. data/lib/aws-sdk-core/json/error_handler.rb +21 -2
  37. data/lib/aws-sdk-core/json/handler.rb +21 -1
  38. data/lib/aws-sdk-core/json/json_engine.rb +12 -8
  39. data/lib/aws-sdk-core/json/oj_engine.rb +35 -6
  40. data/lib/aws-sdk-core/json/parser.rb +10 -0
  41. data/lib/aws-sdk-core/json.rb +11 -28
  42. data/lib/aws-sdk-core/log/formatter.rb +16 -4
  43. data/lib/aws-sdk-core/log/handler.rb +2 -0
  44. data/lib/aws-sdk-core/log/param_filter.rb +38 -13
  45. data/lib/aws-sdk-core/log/param_formatter.rb +2 -0
  46. data/lib/aws-sdk-core/pageable_response.rb +48 -24
  47. data/lib/aws-sdk-core/pager.rb +5 -0
  48. data/lib/aws-sdk-core/param_converter.rb +2 -0
  49. data/lib/aws-sdk-core/param_validator.rb +63 -7
  50. data/lib/aws-sdk-core/plugins/api_key.rb +5 -1
  51. data/lib/aws-sdk-core/plugins/apig_authorizer_token.rb +2 -0
  52. data/lib/aws-sdk-core/plugins/apig_credentials_configuration.rb +2 -0
  53. data/lib/aws-sdk-core/plugins/apig_user_agent.rb +2 -0
  54. data/lib/aws-sdk-core/plugins/client_metrics_plugin.rb +28 -1
  55. data/lib/aws-sdk-core/plugins/client_metrics_send_plugin.rb +2 -0
  56. data/lib/aws-sdk-core/plugins/credentials_configuration.rb +26 -7
  57. data/lib/aws-sdk-core/plugins/defaults_mode.rb +40 -0
  58. data/lib/aws-sdk-core/plugins/endpoint_discovery.rb +12 -4
  59. data/lib/aws-sdk-core/plugins/endpoint_pattern.rb +8 -6
  60. data/lib/aws-sdk-core/plugins/event_stream_configuration.rb +16 -0
  61. data/lib/aws-sdk-core/plugins/global_configuration.rb +2 -0
  62. data/lib/aws-sdk-core/plugins/helpful_socket_errors.rb +2 -0
  63. data/lib/aws-sdk-core/plugins/http_checksum.rb +57 -0
  64. data/lib/aws-sdk-core/plugins/idempotency_token.rb +2 -0
  65. data/lib/aws-sdk-core/plugins/invocation_id.rb +35 -0
  66. data/lib/aws-sdk-core/plugins/jsonvalue_converter.rb +2 -0
  67. data/lib/aws-sdk-core/plugins/logging.rb +2 -0
  68. data/lib/aws-sdk-core/plugins/param_converter.rb +2 -0
  69. data/lib/aws-sdk-core/plugins/param_validator.rb +2 -0
  70. data/lib/aws-sdk-core/plugins/protocols/api_gateway.rb +19 -0
  71. data/lib/aws-sdk-core/plugins/protocols/ec2.rb +2 -0
  72. data/lib/aws-sdk-core/plugins/protocols/json_rpc.rb +2 -0
  73. data/lib/aws-sdk-core/plugins/protocols/query.rb +2 -0
  74. data/lib/aws-sdk-core/plugins/protocols/rest_json.rb +18 -1
  75. data/lib/aws-sdk-core/plugins/protocols/rest_xml.rb +2 -0
  76. data/lib/aws-sdk-core/plugins/recursion_detection.rb +27 -0
  77. data/lib/aws-sdk-core/plugins/regional_endpoint.rb +74 -16
  78. data/lib/aws-sdk-core/plugins/response_paging.rb +2 -0
  79. data/lib/aws-sdk-core/plugins/retries/client_rate_limiter.rb +139 -0
  80. data/lib/aws-sdk-core/plugins/retries/clock_skew.rb +100 -0
  81. data/lib/aws-sdk-core/plugins/retries/error_inspector.rb +146 -0
  82. data/lib/aws-sdk-core/plugins/retries/retry_quota.rb +59 -0
  83. data/lib/aws-sdk-core/plugins/retry_errors.rb +295 -107
  84. data/lib/aws-sdk-core/plugins/signature_v2.rb +2 -0
  85. data/lib/aws-sdk-core/plugins/signature_v4.rb +28 -25
  86. data/lib/aws-sdk-core/plugins/stub_responses.rb +24 -7
  87. data/lib/aws-sdk-core/plugins/transfer_encoding.rb +53 -0
  88. data/lib/aws-sdk-core/plugins/user_agent.rb +6 -8
  89. data/lib/aws-sdk-core/process_credentials.rb +12 -5
  90. data/lib/aws-sdk-core/query/ec2_param_builder.rb +2 -0
  91. data/lib/aws-sdk-core/query/handler.rb +2 -0
  92. data/lib/aws-sdk-core/query/param.rb +2 -0
  93. data/lib/aws-sdk-core/query/param_builder.rb +2 -0
  94. data/lib/aws-sdk-core/query/param_list.rb +2 -0
  95. data/lib/aws-sdk-core/query.rb +2 -0
  96. data/lib/aws-sdk-core/refreshing_credentials.rb +15 -2
  97. data/lib/aws-sdk-core/resources/collection.rb +2 -0
  98. data/lib/aws-sdk-core/rest/handler.rb +2 -0
  99. data/lib/aws-sdk-core/rest/request/body.rb +21 -1
  100. data/lib/aws-sdk-core/rest/request/builder.rb +2 -0
  101. data/lib/aws-sdk-core/rest/request/endpoint.rb +10 -3
  102. data/lib/aws-sdk-core/rest/request/headers.rb +20 -6
  103. data/lib/aws-sdk-core/rest/request/querystring_builder.rb +4 -2
  104. data/lib/aws-sdk-core/rest/response/body.rb +2 -0
  105. data/lib/aws-sdk-core/rest/response/headers.rb +6 -3
  106. data/lib/aws-sdk-core/rest/response/parser.rb +2 -0
  107. data/lib/aws-sdk-core/rest/response/status_code.rb +2 -0
  108. data/lib/aws-sdk-core/rest.rb +2 -0
  109. data/lib/aws-sdk-core/shared_config.rb +153 -127
  110. data/lib/aws-sdk-core/shared_credentials.rb +9 -1
  111. data/lib/aws-sdk-core/sso_credentials.rb +136 -0
  112. data/lib/aws-sdk-core/structure.rb +14 -4
  113. data/lib/aws-sdk-core/stubbing/data_applicator.rb +2 -0
  114. data/lib/aws-sdk-core/stubbing/empty_stub.rb +2 -0
  115. data/lib/aws-sdk-core/stubbing/protocols/api_gateway.rb +2 -0
  116. data/lib/aws-sdk-core/stubbing/protocols/ec2.rb +2 -0
  117. data/lib/aws-sdk-core/stubbing/protocols/json.rb +3 -1
  118. data/lib/aws-sdk-core/stubbing/protocols/query.rb +4 -2
  119. data/lib/aws-sdk-core/stubbing/protocols/rest.rb +52 -7
  120. data/lib/aws-sdk-core/stubbing/protocols/rest_json.rb +3 -1
  121. data/lib/aws-sdk-core/stubbing/protocols/rest_xml.rb +2 -2
  122. data/lib/aws-sdk-core/stubbing/stub_data.rb +15 -4
  123. data/lib/aws-sdk-core/stubbing/xml_error.rb +2 -0
  124. data/lib/aws-sdk-core/type_builder.rb +2 -0
  125. data/lib/aws-sdk-core/util.rb +6 -0
  126. data/lib/aws-sdk-core/waiters/errors.rb +2 -0
  127. data/lib/aws-sdk-core/waiters/poller.rb +2 -0
  128. data/lib/aws-sdk-core/waiters/waiter.rb +4 -2
  129. data/lib/aws-sdk-core/waiters.rb +2 -0
  130. data/lib/aws-sdk-core/xml/builder.rb +5 -3
  131. data/lib/aws-sdk-core/xml/default_list.rb +2 -0
  132. data/lib/aws-sdk-core/xml/default_map.rb +2 -0
  133. data/lib/aws-sdk-core/xml/doc_builder.rb +15 -4
  134. data/lib/aws-sdk-core/xml/error_handler.rb +29 -4
  135. data/lib/aws-sdk-core/xml/parser/engines/libxml.rb +2 -0
  136. data/lib/aws-sdk-core/xml/parser/engines/nokogiri.rb +2 -0
  137. data/lib/aws-sdk-core/xml/parser/engines/oga.rb +2 -0
  138. data/lib/aws-sdk-core/xml/parser/engines/ox.rb +3 -1
  139. data/lib/aws-sdk-core/xml/parser/engines/rexml.rb +4 -1
  140. data/lib/aws-sdk-core/xml/parser/frame.rb +25 -0
  141. data/lib/aws-sdk-core/xml/parser/parsing_error.rb +2 -0
  142. data/lib/aws-sdk-core/xml/parser/stack.rb +2 -0
  143. data/lib/aws-sdk-core/xml/parser.rb +7 -0
  144. data/lib/aws-sdk-core/xml.rb +2 -0
  145. data/lib/aws-sdk-core.rb +23 -4
  146. data/lib/aws-sdk-sso/client.rb +568 -0
  147. data/lib/aws-sdk-sso/client_api.rb +190 -0
  148. data/lib/aws-sdk-sso/customizations.rb +1 -0
  149. data/lib/aws-sdk-sso/errors.rb +102 -0
  150. data/lib/aws-sdk-sso/resource.rb +26 -0
  151. data/lib/aws-sdk-sso/types.rb +352 -0
  152. data/lib/aws-sdk-sso.rb +55 -0
  153. data/lib/aws-sdk-sts/client.rb +1282 -531
  154. data/lib/aws-sdk-sts/client_api.rb +76 -1
  155. data/lib/aws-sdk-sts/customizations.rb +4 -0
  156. data/lib/aws-sdk-sts/errors.rb +153 -1
  157. data/lib/aws-sdk-sts/plugins/sts_regional_endpoints.rb +38 -0
  158. data/lib/aws-sdk-sts/presigner.rb +75 -0
  159. data/lib/aws-sdk-sts/resource.rb +4 -1
  160. data/lib/aws-sdk-sts/types.rb +958 -229
  161. data/lib/aws-sdk-sts.rb +16 -6
  162. data/lib/seahorse/client/async_base.rb +52 -0
  163. data/lib/seahorse/client/async_response.rb +64 -0
  164. data/lib/seahorse/client/base.rb +7 -2
  165. data/lib/seahorse/client/block_io.rb +6 -2
  166. data/lib/seahorse/client/configuration.rb +7 -1
  167. data/lib/seahorse/client/events.rb +3 -1
  168. data/lib/seahorse/client/h2/connection.rb +250 -0
  169. data/lib/seahorse/client/h2/handler.rb +152 -0
  170. data/lib/seahorse/client/handler.rb +2 -0
  171. data/lib/seahorse/client/handler_builder.rb +2 -0
  172. data/lib/seahorse/client/handler_list.rb +2 -0
  173. data/lib/seahorse/client/handler_list_entry.rb +6 -4
  174. data/lib/seahorse/client/http/async_response.rb +44 -0
  175. data/lib/seahorse/client/http/headers.rb +2 -0
  176. data/lib/seahorse/client/http/request.rb +5 -3
  177. data/lib/seahorse/client/http/response.rb +18 -11
  178. data/lib/seahorse/client/logging/formatter.rb +6 -2
  179. data/lib/seahorse/client/logging/handler.rb +2 -0
  180. data/lib/seahorse/client/managed_file.rb +2 -0
  181. data/lib/seahorse/client/net_http/connection_pool.rb +30 -23
  182. data/lib/seahorse/client/net_http/handler.rb +24 -7
  183. data/lib/seahorse/client/net_http/patches.rb +15 -84
  184. data/lib/seahorse/client/networking_error.rb +30 -0
  185. data/lib/seahorse/client/plugin.rb +10 -7
  186. data/lib/seahorse/client/plugin_list.rb +2 -0
  187. data/lib/seahorse/client/plugins/content_length.rb +14 -3
  188. data/lib/seahorse/client/plugins/endpoint.rb +4 -2
  189. data/lib/seahorse/client/plugins/h2.rb +69 -0
  190. data/lib/seahorse/client/plugins/logging.rb +2 -0
  191. data/lib/seahorse/client/plugins/net_http.rb +39 -3
  192. data/lib/seahorse/client/plugins/operation_methods.rb +2 -0
  193. data/lib/seahorse/client/plugins/raise_response_errors.rb +2 -0
  194. data/lib/seahorse/client/plugins/request_callback.rb +110 -0
  195. data/lib/seahorse/client/plugins/response_target.rb +23 -14
  196. data/lib/seahorse/client/request.rb +2 -0
  197. data/lib/seahorse/client/request_context.rb +2 -0
  198. data/lib/seahorse/client/response.rb +5 -5
  199. data/lib/seahorse/model/api.rb +10 -0
  200. data/lib/seahorse/model/authorizer.rb +2 -0
  201. data/lib/seahorse/model/operation.rb +9 -0
  202. data/lib/seahorse/model/shapes.rb +29 -2
  203. data/lib/seahorse/util.rb +8 -1
  204. data/lib/seahorse/version.rb +2 -0
  205. data/lib/seahorse.rb +12 -0
  206. metadata +64 -14
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # WARNING ABOUT GENERATED CODE
2
4
  #
3
5
  # This file is generated. See the contributing guide for more information:
4
- # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
5
7
  #
6
8
  # WARNING ABOUT GENERATED CODE
7
9
 
@@ -24,6 +26,8 @@ module Aws::STS
24
26
  DecodeAuthorizationMessageResponse = Shapes::StructureShape.new(name: 'DecodeAuthorizationMessageResponse')
25
27
  ExpiredTokenException = Shapes::StructureShape.new(name: 'ExpiredTokenException')
26
28
  FederatedUser = Shapes::StructureShape.new(name: 'FederatedUser')
29
+ GetAccessKeyInfoRequest = Shapes::StructureShape.new(name: 'GetAccessKeyInfoRequest')
30
+ GetAccessKeyInfoResponse = Shapes::StructureShape.new(name: 'GetAccessKeyInfoResponse')
27
31
  GetCallerIdentityRequest = Shapes::StructureShape.new(name: 'GetCallerIdentityRequest')
28
32
  GetCallerIdentityResponse = Shapes::StructureShape.new(name: 'GetCallerIdentityResponse')
29
33
  GetFederationTokenRequest = Shapes::StructureShape.new(name: 'GetFederationTokenRequest')
@@ -38,10 +42,12 @@ module Aws::STS
38
42
  MalformedPolicyDocumentException = Shapes::StructureShape.new(name: 'MalformedPolicyDocumentException')
39
43
  NameQualifier = Shapes::StringShape.new(name: 'NameQualifier')
40
44
  PackedPolicyTooLargeException = Shapes::StructureShape.new(name: 'PackedPolicyTooLargeException')
45
+ PolicyDescriptorType = Shapes::StructureShape.new(name: 'PolicyDescriptorType')
41
46
  RegionDisabledException = Shapes::StructureShape.new(name: 'RegionDisabledException')
42
47
  SAMLAssertionType = Shapes::StringShape.new(name: 'SAMLAssertionType')
43
48
  Subject = Shapes::StringShape.new(name: 'Subject')
44
49
  SubjectType = Shapes::StringShape.new(name: 'SubjectType')
50
+ Tag = Shapes::StructureShape.new(name: 'Tag')
45
51
  accessKeyIdType = Shapes::StringShape.new(name: 'accessKeyIdType')
46
52
  accessKeySecretType = Shapes::StringShape.new(name: 'accessKeySecretType')
47
53
  accountType = Shapes::StringShape.new(name: 'accountType')
@@ -62,11 +68,17 @@ module Aws::STS
62
68
  malformedPolicyDocumentMessage = Shapes::StringShape.new(name: 'malformedPolicyDocumentMessage')
63
69
  nonNegativeIntegerType = Shapes::IntegerShape.new(name: 'nonNegativeIntegerType')
64
70
  packedPolicyTooLargeMessage = Shapes::StringShape.new(name: 'packedPolicyTooLargeMessage')
71
+ policyDescriptorListType = Shapes::ListShape.new(name: 'policyDescriptorListType')
65
72
  regionDisabledMessage = Shapes::StringShape.new(name: 'regionDisabledMessage')
66
73
  roleDurationSecondsType = Shapes::IntegerShape.new(name: 'roleDurationSecondsType')
67
74
  roleSessionNameType = Shapes::StringShape.new(name: 'roleSessionNameType')
68
75
  serialNumberType = Shapes::StringShape.new(name: 'serialNumberType')
69
76
  sessionPolicyDocumentType = Shapes::StringShape.new(name: 'sessionPolicyDocumentType')
77
+ sourceIdentityType = Shapes::StringShape.new(name: 'sourceIdentityType')
78
+ tagKeyListType = Shapes::ListShape.new(name: 'tagKeyListType')
79
+ tagKeyType = Shapes::StringShape.new(name: 'tagKeyType')
80
+ tagListType = Shapes::ListShape.new(name: 'tagListType')
81
+ tagValueType = Shapes::StringShape.new(name: 'tagValueType')
70
82
  tokenCodeType = Shapes::StringShape.new(name: 'tokenCodeType')
71
83
  tokenType = Shapes::StringShape.new(name: 'tokenType')
72
84
  urlType = Shapes::StringShape.new(name: 'urlType')
@@ -76,21 +88,27 @@ module Aws::STS
76
88
 
77
89
  AssumeRoleRequest.add_member(:role_arn, Shapes::ShapeRef.new(shape: arnType, required: true, location_name: "RoleArn"))
78
90
  AssumeRoleRequest.add_member(:role_session_name, Shapes::ShapeRef.new(shape: roleSessionNameType, required: true, location_name: "RoleSessionName"))
91
+ AssumeRoleRequest.add_member(:policy_arns, Shapes::ShapeRef.new(shape: policyDescriptorListType, location_name: "PolicyArns"))
79
92
  AssumeRoleRequest.add_member(:policy, Shapes::ShapeRef.new(shape: sessionPolicyDocumentType, location_name: "Policy"))
80
93
  AssumeRoleRequest.add_member(:duration_seconds, Shapes::ShapeRef.new(shape: roleDurationSecondsType, location_name: "DurationSeconds"))
94
+ AssumeRoleRequest.add_member(:tags, Shapes::ShapeRef.new(shape: tagListType, location_name: "Tags"))
95
+ AssumeRoleRequest.add_member(:transitive_tag_keys, Shapes::ShapeRef.new(shape: tagKeyListType, location_name: "TransitiveTagKeys"))
81
96
  AssumeRoleRequest.add_member(:external_id, Shapes::ShapeRef.new(shape: externalIdType, location_name: "ExternalId"))
82
97
  AssumeRoleRequest.add_member(:serial_number, Shapes::ShapeRef.new(shape: serialNumberType, location_name: "SerialNumber"))
83
98
  AssumeRoleRequest.add_member(:token_code, Shapes::ShapeRef.new(shape: tokenCodeType, location_name: "TokenCode"))
99
+ AssumeRoleRequest.add_member(:source_identity, Shapes::ShapeRef.new(shape: sourceIdentityType, location_name: "SourceIdentity"))
84
100
  AssumeRoleRequest.struct_class = Types::AssumeRoleRequest
85
101
 
86
102
  AssumeRoleResponse.add_member(:credentials, Shapes::ShapeRef.new(shape: Credentials, location_name: "Credentials"))
87
103
  AssumeRoleResponse.add_member(:assumed_role_user, Shapes::ShapeRef.new(shape: AssumedRoleUser, location_name: "AssumedRoleUser"))
88
104
  AssumeRoleResponse.add_member(:packed_policy_size, Shapes::ShapeRef.new(shape: nonNegativeIntegerType, location_name: "PackedPolicySize"))
105
+ AssumeRoleResponse.add_member(:source_identity, Shapes::ShapeRef.new(shape: sourceIdentityType, location_name: "SourceIdentity"))
89
106
  AssumeRoleResponse.struct_class = Types::AssumeRoleResponse
90
107
 
91
108
  AssumeRoleWithSAMLRequest.add_member(:role_arn, Shapes::ShapeRef.new(shape: arnType, required: true, location_name: "RoleArn"))
92
109
  AssumeRoleWithSAMLRequest.add_member(:principal_arn, Shapes::ShapeRef.new(shape: arnType, required: true, location_name: "PrincipalArn"))
93
110
  AssumeRoleWithSAMLRequest.add_member(:saml_assertion, Shapes::ShapeRef.new(shape: SAMLAssertionType, required: true, location_name: "SAMLAssertion"))
111
+ AssumeRoleWithSAMLRequest.add_member(:policy_arns, Shapes::ShapeRef.new(shape: policyDescriptorListType, location_name: "PolicyArns"))
94
112
  AssumeRoleWithSAMLRequest.add_member(:policy, Shapes::ShapeRef.new(shape: sessionPolicyDocumentType, location_name: "Policy"))
95
113
  AssumeRoleWithSAMLRequest.add_member(:duration_seconds, Shapes::ShapeRef.new(shape: roleDurationSecondsType, location_name: "DurationSeconds"))
96
114
  AssumeRoleWithSAMLRequest.struct_class = Types::AssumeRoleWithSAMLRequest
@@ -103,12 +121,14 @@ module Aws::STS
103
121
  AssumeRoleWithSAMLResponse.add_member(:issuer, Shapes::ShapeRef.new(shape: Issuer, location_name: "Issuer"))
104
122
  AssumeRoleWithSAMLResponse.add_member(:audience, Shapes::ShapeRef.new(shape: Audience, location_name: "Audience"))
105
123
  AssumeRoleWithSAMLResponse.add_member(:name_qualifier, Shapes::ShapeRef.new(shape: NameQualifier, location_name: "NameQualifier"))
124
+ AssumeRoleWithSAMLResponse.add_member(:source_identity, Shapes::ShapeRef.new(shape: sourceIdentityType, location_name: "SourceIdentity"))
106
125
  AssumeRoleWithSAMLResponse.struct_class = Types::AssumeRoleWithSAMLResponse
107
126
 
108
127
  AssumeRoleWithWebIdentityRequest.add_member(:role_arn, Shapes::ShapeRef.new(shape: arnType, required: true, location_name: "RoleArn"))
109
128
  AssumeRoleWithWebIdentityRequest.add_member(:role_session_name, Shapes::ShapeRef.new(shape: roleSessionNameType, required: true, location_name: "RoleSessionName"))
110
129
  AssumeRoleWithWebIdentityRequest.add_member(:web_identity_token, Shapes::ShapeRef.new(shape: clientTokenType, required: true, location_name: "WebIdentityToken"))
111
130
  AssumeRoleWithWebIdentityRequest.add_member(:provider_id, Shapes::ShapeRef.new(shape: urlType, location_name: "ProviderId"))
131
+ AssumeRoleWithWebIdentityRequest.add_member(:policy_arns, Shapes::ShapeRef.new(shape: policyDescriptorListType, location_name: "PolicyArns"))
112
132
  AssumeRoleWithWebIdentityRequest.add_member(:policy, Shapes::ShapeRef.new(shape: sessionPolicyDocumentType, location_name: "Policy"))
113
133
  AssumeRoleWithWebIdentityRequest.add_member(:duration_seconds, Shapes::ShapeRef.new(shape: roleDurationSecondsType, location_name: "DurationSeconds"))
114
134
  AssumeRoleWithWebIdentityRequest.struct_class = Types::AssumeRoleWithWebIdentityRequest
@@ -119,6 +139,7 @@ module Aws::STS
119
139
  AssumeRoleWithWebIdentityResponse.add_member(:packed_policy_size, Shapes::ShapeRef.new(shape: nonNegativeIntegerType, location_name: "PackedPolicySize"))
120
140
  AssumeRoleWithWebIdentityResponse.add_member(:provider, Shapes::ShapeRef.new(shape: Issuer, location_name: "Provider"))
121
141
  AssumeRoleWithWebIdentityResponse.add_member(:audience, Shapes::ShapeRef.new(shape: Audience, location_name: "Audience"))
142
+ AssumeRoleWithWebIdentityResponse.add_member(:source_identity, Shapes::ShapeRef.new(shape: sourceIdentityType, location_name: "SourceIdentity"))
122
143
  AssumeRoleWithWebIdentityResponse.struct_class = Types::AssumeRoleWithWebIdentityResponse
123
144
 
124
145
  AssumedRoleUser.add_member(:assumed_role_id, Shapes::ShapeRef.new(shape: assumedRoleIdType, required: true, location_name: "AssumedRoleId"))
@@ -137,10 +158,19 @@ module Aws::STS
137
158
  DecodeAuthorizationMessageResponse.add_member(:decoded_message, Shapes::ShapeRef.new(shape: decodedMessageType, location_name: "DecodedMessage"))
138
159
  DecodeAuthorizationMessageResponse.struct_class = Types::DecodeAuthorizationMessageResponse
139
160
 
161
+ ExpiredTokenException.add_member(:message, Shapes::ShapeRef.new(shape: expiredIdentityTokenMessage, location_name: "message"))
162
+ ExpiredTokenException.struct_class = Types::ExpiredTokenException
163
+
140
164
  FederatedUser.add_member(:federated_user_id, Shapes::ShapeRef.new(shape: federatedIdType, required: true, location_name: "FederatedUserId"))
141
165
  FederatedUser.add_member(:arn, Shapes::ShapeRef.new(shape: arnType, required: true, location_name: "Arn"))
142
166
  FederatedUser.struct_class = Types::FederatedUser
143
167
 
168
+ GetAccessKeyInfoRequest.add_member(:access_key_id, Shapes::ShapeRef.new(shape: accessKeyIdType, required: true, location_name: "AccessKeyId"))
169
+ GetAccessKeyInfoRequest.struct_class = Types::GetAccessKeyInfoRequest
170
+
171
+ GetAccessKeyInfoResponse.add_member(:account, Shapes::ShapeRef.new(shape: accountType, location_name: "Account"))
172
+ GetAccessKeyInfoResponse.struct_class = Types::GetAccessKeyInfoResponse
173
+
144
174
  GetCallerIdentityRequest.struct_class = Types::GetCallerIdentityRequest
145
175
 
146
176
  GetCallerIdentityResponse.add_member(:user_id, Shapes::ShapeRef.new(shape: userIdType, location_name: "UserId"))
@@ -150,7 +180,9 @@ module Aws::STS
150
180
 
151
181
  GetFederationTokenRequest.add_member(:name, Shapes::ShapeRef.new(shape: userNameType, required: true, location_name: "Name"))
152
182
  GetFederationTokenRequest.add_member(:policy, Shapes::ShapeRef.new(shape: sessionPolicyDocumentType, location_name: "Policy"))
183
+ GetFederationTokenRequest.add_member(:policy_arns, Shapes::ShapeRef.new(shape: policyDescriptorListType, location_name: "PolicyArns"))
153
184
  GetFederationTokenRequest.add_member(:duration_seconds, Shapes::ShapeRef.new(shape: durationSecondsType, location_name: "DurationSeconds"))
185
+ GetFederationTokenRequest.add_member(:tags, Shapes::ShapeRef.new(shape: tagListType, location_name: "Tags"))
154
186
  GetFederationTokenRequest.struct_class = Types::GetFederationTokenRequest
155
187
 
156
188
  GetFederationTokenResponse.add_member(:credentials, Shapes::ShapeRef.new(shape: Credentials, location_name: "Credentials"))
@@ -166,6 +198,40 @@ module Aws::STS
166
198
  GetSessionTokenResponse.add_member(:credentials, Shapes::ShapeRef.new(shape: Credentials, location_name: "Credentials"))
167
199
  GetSessionTokenResponse.struct_class = Types::GetSessionTokenResponse
168
200
 
201
+ IDPCommunicationErrorException.add_member(:message, Shapes::ShapeRef.new(shape: idpCommunicationErrorMessage, location_name: "message"))
202
+ IDPCommunicationErrorException.struct_class = Types::IDPCommunicationErrorException
203
+
204
+ IDPRejectedClaimException.add_member(:message, Shapes::ShapeRef.new(shape: idpRejectedClaimMessage, location_name: "message"))
205
+ IDPRejectedClaimException.struct_class = Types::IDPRejectedClaimException
206
+
207
+ InvalidAuthorizationMessageException.add_member(:message, Shapes::ShapeRef.new(shape: invalidAuthorizationMessage, location_name: "message"))
208
+ InvalidAuthorizationMessageException.struct_class = Types::InvalidAuthorizationMessageException
209
+
210
+ InvalidIdentityTokenException.add_member(:message, Shapes::ShapeRef.new(shape: invalidIdentityTokenMessage, location_name: "message"))
211
+ InvalidIdentityTokenException.struct_class = Types::InvalidIdentityTokenException
212
+
213
+ MalformedPolicyDocumentException.add_member(:message, Shapes::ShapeRef.new(shape: malformedPolicyDocumentMessage, location_name: "message"))
214
+ MalformedPolicyDocumentException.struct_class = Types::MalformedPolicyDocumentException
215
+
216
+ PackedPolicyTooLargeException.add_member(:message, Shapes::ShapeRef.new(shape: packedPolicyTooLargeMessage, location_name: "message"))
217
+ PackedPolicyTooLargeException.struct_class = Types::PackedPolicyTooLargeException
218
+
219
+ PolicyDescriptorType.add_member(:arn, Shapes::ShapeRef.new(shape: arnType, location_name: "arn"))
220
+ PolicyDescriptorType.struct_class = Types::PolicyDescriptorType
221
+
222
+ RegionDisabledException.add_member(:message, Shapes::ShapeRef.new(shape: regionDisabledMessage, location_name: "message"))
223
+ RegionDisabledException.struct_class = Types::RegionDisabledException
224
+
225
+ Tag.add_member(:key, Shapes::ShapeRef.new(shape: tagKeyType, required: true, location_name: "Key"))
226
+ Tag.add_member(:value, Shapes::ShapeRef.new(shape: tagValueType, required: true, location_name: "Value"))
227
+ Tag.struct_class = Types::Tag
228
+
229
+ policyDescriptorListType.member = Shapes::ShapeRef.new(shape: PolicyDescriptorType)
230
+
231
+ tagKeyListType.member = Shapes::ShapeRef.new(shape: tagKeyType)
232
+
233
+ tagListType.member = Shapes::ShapeRef.new(shape: Tag)
234
+
169
235
 
170
236
  # @api private
171
237
  API = Seahorse::Model::Api.new.tap do |api|
@@ -194,6 +260,7 @@ module Aws::STS
194
260
  o.errors << Shapes::ShapeRef.new(shape: MalformedPolicyDocumentException)
195
261
  o.errors << Shapes::ShapeRef.new(shape: PackedPolicyTooLargeException)
196
262
  o.errors << Shapes::ShapeRef.new(shape: RegionDisabledException)
263
+ o.errors << Shapes::ShapeRef.new(shape: ExpiredTokenException)
197
264
  end)
198
265
 
199
266
  api.add_operation(:assume_role_with_saml, Seahorse::Model::Operation.new.tap do |o|
@@ -236,6 +303,14 @@ module Aws::STS
236
303
  o.errors << Shapes::ShapeRef.new(shape: InvalidAuthorizationMessageException)
237
304
  end)
238
305
 
306
+ api.add_operation(:get_access_key_info, Seahorse::Model::Operation.new.tap do |o|
307
+ o.name = "GetAccessKeyInfo"
308
+ o.http_method = "POST"
309
+ o.http_request_uri = "/"
310
+ o.input = Shapes::ShapeRef.new(shape: GetAccessKeyInfoRequest)
311
+ o.output = Shapes::ShapeRef.new(shape: GetAccessKeyInfoResponse)
312
+ end)
313
+
239
314
  api.add_operation(:get_caller_identity, Seahorse::Model::Operation.new.tap do |o|
240
315
  o.name = "GetCallerIdentity"
241
316
  o.http_method = "POST"
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ # utility classes
4
+ require 'aws-sdk-sts/presigner'
@@ -1,14 +1,166 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # WARNING ABOUT GENERATED CODE
2
4
  #
3
5
  # This file is generated. See the contributing guide for more information:
4
- # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
5
7
  #
6
8
  # WARNING ABOUT GENERATED CODE
7
9
 
8
10
  module Aws::STS
11
+
12
+ # When STS returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::STS::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all STS errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::STS::Errors::ServiceError
20
+ # # rescues all STS 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
+ # * {ExpiredTokenException}
31
+ # * {IDPCommunicationErrorException}
32
+ # * {IDPRejectedClaimException}
33
+ # * {InvalidAuthorizationMessageException}
34
+ # * {InvalidIdentityTokenException}
35
+ # * {MalformedPolicyDocumentException}
36
+ # * {PackedPolicyTooLargeException}
37
+ # * {RegionDisabledException}
38
+ #
39
+ # Additionally, error classes are dynamically generated for service errors based on the error code
40
+ # if they are not defined above.
9
41
  module Errors
10
42
 
11
43
  extend Aws::Errors::DynamicErrors
12
44
 
45
+ class ExpiredTokenException < ServiceError
46
+
47
+ # @param [Seahorse::Client::RequestContext] context
48
+ # @param [String] message
49
+ # @param [Aws::STS::Types::ExpiredTokenException] data
50
+ def initialize(context, message, data = Aws::EmptyStructure.new)
51
+ super(context, message, data)
52
+ end
53
+
54
+ # @return [String]
55
+ def message
56
+ @message || @data[:message]
57
+ end
58
+ end
59
+
60
+ class IDPCommunicationErrorException < ServiceError
61
+
62
+ # @param [Seahorse::Client::RequestContext] context
63
+ # @param [String] message
64
+ # @param [Aws::STS::Types::IDPCommunicationErrorException] data
65
+ def initialize(context, message, data = Aws::EmptyStructure.new)
66
+ super(context, message, data)
67
+ end
68
+
69
+ # @return [String]
70
+ def message
71
+ @message || @data[:message]
72
+ end
73
+ end
74
+
75
+ class IDPRejectedClaimException < ServiceError
76
+
77
+ # @param [Seahorse::Client::RequestContext] context
78
+ # @param [String] message
79
+ # @param [Aws::STS::Types::IDPRejectedClaimException] data
80
+ def initialize(context, message, data = Aws::EmptyStructure.new)
81
+ super(context, message, data)
82
+ end
83
+
84
+ # @return [String]
85
+ def message
86
+ @message || @data[:message]
87
+ end
88
+ end
89
+
90
+ class InvalidAuthorizationMessageException < ServiceError
91
+
92
+ # @param [Seahorse::Client::RequestContext] context
93
+ # @param [String] message
94
+ # @param [Aws::STS::Types::InvalidAuthorizationMessageException] data
95
+ def initialize(context, message, data = Aws::EmptyStructure.new)
96
+ super(context, message, data)
97
+ end
98
+
99
+ # @return [String]
100
+ def message
101
+ @message || @data[:message]
102
+ end
103
+ end
104
+
105
+ class InvalidIdentityTokenException < ServiceError
106
+
107
+ # @param [Seahorse::Client::RequestContext] context
108
+ # @param [String] message
109
+ # @param [Aws::STS::Types::InvalidIdentityTokenException] data
110
+ def initialize(context, message, data = Aws::EmptyStructure.new)
111
+ super(context, message, data)
112
+ end
113
+
114
+ # @return [String]
115
+ def message
116
+ @message || @data[:message]
117
+ end
118
+ end
119
+
120
+ class MalformedPolicyDocumentException < ServiceError
121
+
122
+ # @param [Seahorse::Client::RequestContext] context
123
+ # @param [String] message
124
+ # @param [Aws::STS::Types::MalformedPolicyDocumentException] data
125
+ def initialize(context, message, data = Aws::EmptyStructure.new)
126
+ super(context, message, data)
127
+ end
128
+
129
+ # @return [String]
130
+ def message
131
+ @message || @data[:message]
132
+ end
133
+ end
134
+
135
+ class PackedPolicyTooLargeException < ServiceError
136
+
137
+ # @param [Seahorse::Client::RequestContext] context
138
+ # @param [String] message
139
+ # @param [Aws::STS::Types::PackedPolicyTooLargeException] data
140
+ def initialize(context, message, data = Aws::EmptyStructure.new)
141
+ super(context, message, data)
142
+ end
143
+
144
+ # @return [String]
145
+ def message
146
+ @message || @data[:message]
147
+ end
148
+ end
149
+
150
+ class RegionDisabledException < ServiceError
151
+
152
+ # @param [Seahorse::Client::RequestContext] context
153
+ # @param [String] message
154
+ # @param [Aws::STS::Types::RegionDisabledException] data
155
+ def initialize(context, message, data = Aws::EmptyStructure.new)
156
+ super(context, message, data)
157
+ end
158
+
159
+ # @return [String]
160
+ def message
161
+ @message || @data[:message]
162
+ end
163
+ end
164
+
13
165
  end
14
166
  end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aws
4
+ module STS
5
+ module Plugins
6
+
7
+ class STSRegionalEndpoints < Seahorse::Client::Plugin
8
+
9
+ option(:sts_regional_endpoints,
10
+ default: 'regional',
11
+ doc_type: String,
12
+ docstring: <<-DOCS) do |cfg|
13
+ Passing in 'regional' to enable regional endpoint for STS for all supported
14
+ regions (except 'aws-global'). Using 'legacy' mode will force all legacy
15
+ regions to resolve to the STS global endpoint.
16
+ DOCS
17
+ resolve_sts_regional_endpoints(cfg)
18
+ end
19
+
20
+ private
21
+
22
+ def self.resolve_sts_regional_endpoints(cfg)
23
+ env_mode = ENV['AWS_STS_REGIONAL_ENDPOINTS']
24
+ env_mode = nil if env_mode == ''
25
+ cfg_mode = Aws.shared_config.sts_regional_endpoints(
26
+ profile: cfg.profile)
27
+ default_mode_value =
28
+ if cfg.respond_to?(:defaults_mode_config_resolver)
29
+ cfg.defaults_mode_config_resolver.resolve(:sts_regional_endpoints)
30
+ end
31
+ env_mode || cfg_mode || default_mode_value || 'regional'
32
+ end
33
+
34
+ end
35
+
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'aws-sigv4'
4
+
5
+ module Aws
6
+ module STS
7
+ # Allows you to create presigned URLs for STS operations.
8
+ #
9
+ # @example
10
+ #
11
+ # signer = Aws::STS::Presigner.new
12
+ # url = signer.get_caller_identity_presigned_url(
13
+ # headers: {"X-K8s-Aws-Id" => 'my-eks-cluster'}
14
+ # )
15
+ class Presigner
16
+ # @option options [Client] :client Optionally provide an existing
17
+ # STS client
18
+ def initialize(options = {})
19
+ @client = options[:client] || Aws::STS::Client.new
20
+ end
21
+
22
+ # Returns a presigned url for get_caller_identity.
23
+ #
24
+ # @option options [Hash] :headers
25
+ # Headers that should be signed and sent along with the request. All
26
+ # x-amz-* headers must be present during signing. Other headers are
27
+ # optional.
28
+ #
29
+ # @return [String] A presigned url string.
30
+ #
31
+ # @example
32
+ #
33
+ # url = signer.get_caller_identity_presigned_url(
34
+ # headers: {"X-K8s-Aws-Id" => 'my-eks-cluster'},
35
+ # )
36
+ #
37
+ # This can be easily converted to a token used by the EKS service:
38
+ # {https://ruby-doc.org/stdlib-2.3.1/libdoc/base64/rdoc/Base64.html#method-i-encode64}
39
+ # "k8s-aws-v1." + Base64.urlsafe_encode64(url).chomp("==")
40
+ def get_caller_identity_presigned_url(options = {})
41
+ req = @client.build_request(:get_session_token, {})
42
+
43
+ param_list = Aws::Query::ParamList.new
44
+ param_list.set('Action', 'GetCallerIdentity')
45
+ param_list.set('Version', req.context.config.api.version)
46
+ Aws::Query::EC2ParamBuilder.new(param_list)
47
+ .apply(req.context.operation.input, {})
48
+
49
+ signer = Aws::Sigv4::Signer.new(
50
+ service: 'sts',
51
+ region: req.context.config.region,
52
+ credentials_provider: req.context.config.credentials
53
+ )
54
+
55
+ url = Aws::Partitions::EndpointProvider.resolve(
56
+ req.context.config.region,
57
+ 'sts',
58
+ req.context.config.sts_regional_endpoints,
59
+ {
60
+ dualstack: req.context.config.use_dualstack_endpoint,
61
+ fips: req.context.config.use_fips_endpoint
62
+ }
63
+ )
64
+ url += "/?#{param_list}"
65
+
66
+ signer.presign_url(
67
+ http_method: 'GET',
68
+ url: url,
69
+ body: '',
70
+ headers: options[:headers]
71
+ ).to_s
72
+ end
73
+ end
74
+ end
75
+ end
@@ -1,11 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # WARNING ABOUT GENERATED CODE
2
4
  #
3
5
  # This file is generated. See the contributing guide for more information:
4
- # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
5
7
  #
6
8
  # WARNING ABOUT GENERATED CODE
7
9
 
8
10
  module Aws::STS
11
+
9
12
  class Resource
10
13
 
11
14
  # @param options ({})