aws-sdk-core 3.171.1 → 3.199.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +363 -0
- data/VERSION +1 -1
- data/lib/aws-defaults/default_configuration.rb +4 -4
- data/lib/aws-sdk-core/binary/decode_handler.rb +3 -9
- data/lib/aws-sdk-core/binary/encode_handler.rb +1 -1
- data/lib/aws-sdk-core/binary/event_builder.rb +34 -37
- data/lib/aws-sdk-core/binary/event_stream_decoder.rb +1 -0
- data/lib/aws-sdk-core/binary/event_stream_encoder.rb +4 -3
- data/lib/aws-sdk-core/cbor/cbor_engine.rb +19 -0
- data/lib/aws-sdk-core/cbor/decoder.rb +310 -0
- data/lib/aws-sdk-core/cbor/encoder.rb +243 -0
- data/lib/aws-sdk-core/cbor.rb +106 -0
- data/lib/aws-sdk-core/client_stubs.rb +18 -14
- data/lib/aws-sdk-core/credential_provider.rb +4 -1
- data/lib/aws-sdk-core/ec2_metadata.rb +1 -1
- data/lib/aws-sdk-core/ecs_credentials.rb +78 -11
- data/lib/aws-sdk-core/endpoints/matchers.rb +18 -10
- data/lib/aws-sdk-core/endpoints.rb +6 -2
- data/lib/aws-sdk-core/error_handler.rb +41 -0
- data/lib/aws-sdk-core/errors.rb +3 -3
- data/lib/aws-sdk-core/event_emitter.rb +0 -16
- data/lib/aws-sdk-core/ini_parser.rb +7 -0
- data/lib/aws-sdk-core/instance_profile_credentials.rb +55 -32
- data/lib/aws-sdk-core/json/builder.rb +8 -1
- data/lib/aws-sdk-core/json/error_handler.rb +15 -10
- data/lib/aws-sdk-core/json/handler.rb +12 -6
- data/lib/aws-sdk-core/json/json_engine.rb +3 -1
- data/lib/aws-sdk-core/json/oj_engine.rb +7 -1
- data/lib/aws-sdk-core/json/parser.rb +33 -3
- data/lib/aws-sdk-core/json.rb +43 -14
- data/lib/aws-sdk-core/log/formatter.rb +6 -0
- data/lib/aws-sdk-core/lru_cache.rb +75 -0
- data/lib/aws-sdk-core/pageable_response.rb +3 -1
- data/lib/aws-sdk-core/param_validator.rb +9 -4
- data/lib/aws-sdk-core/plugins/checksum_algorithm.rb +5 -3
- data/lib/aws-sdk-core/plugins/client_metrics_plugin.rb +1 -0
- data/lib/aws-sdk-core/plugins/client_metrics_send_plugin.rb +14 -2
- data/lib/aws-sdk-core/plugins/credentials_configuration.rb +2 -0
- data/lib/aws-sdk-core/plugins/global_configuration.rb +8 -9
- data/lib/aws-sdk-core/plugins/http_checksum.rb +2 -1
- data/lib/aws-sdk-core/plugins/invocation_id.rb +1 -11
- data/lib/aws-sdk-core/plugins/logging.rb +2 -0
- data/lib/aws-sdk-core/plugins/protocols/api_gateway.rb +3 -1
- data/lib/aws-sdk-core/plugins/protocols/ec2.rb +2 -24
- data/lib/aws-sdk-core/plugins/protocols/json_rpc.rb +6 -8
- data/lib/aws-sdk-core/plugins/protocols/query.rb +4 -2
- data/lib/aws-sdk-core/plugins/protocols/rest_json.rb +3 -15
- data/lib/aws-sdk-core/plugins/protocols/rest_xml.rb +3 -0
- data/lib/aws-sdk-core/plugins/protocols/rpc_v2.rb +17 -0
- data/lib/aws-sdk-core/plugins/regional_endpoint.rb +109 -33
- data/lib/aws-sdk-core/plugins/request_compression.rb +226 -0
- data/lib/aws-sdk-core/plugins/retry_errors.rb +12 -3
- data/lib/aws-sdk-core/plugins/sign.rb +24 -13
- data/lib/aws-sdk-core/plugins/stub_responses.rb +1 -0
- data/lib/aws-sdk-core/plugins/user_agent.rb +152 -14
- data/lib/aws-sdk-core/process_credentials.rb +45 -27
- data/lib/aws-sdk-core/query/ec2_handler.rb +27 -0
- data/lib/aws-sdk-core/query/ec2_param_builder.rb +5 -7
- data/lib/aws-sdk-core/query/handler.rb +4 -4
- data/lib/aws-sdk-core/query/param_builder.rb +2 -2
- data/lib/aws-sdk-core/query.rb +2 -1
- data/lib/aws-sdk-core/refreshing_credentials.rb +12 -12
- data/lib/aws-sdk-core/rest/content_type_handler.rb +60 -0
- data/lib/aws-sdk-core/rest/handler.rb +3 -4
- data/lib/aws-sdk-core/rest/request/body.rb +32 -5
- data/lib/aws-sdk-core/rest/request/endpoint.rb +24 -4
- data/lib/aws-sdk-core/rest/request/headers.rb +15 -7
- data/lib/aws-sdk-core/rest/request/querystring_builder.rb +62 -36
- data/lib/aws-sdk-core/rest/response/body.rb +15 -1
- data/lib/aws-sdk-core/rest/response/header_list_parser.rb +79 -0
- data/lib/aws-sdk-core/rest/response/headers.rb +8 -3
- data/lib/aws-sdk-core/rest.rb +1 -0
- data/lib/aws-sdk-core/rpc_v2/builder.rb +62 -0
- data/lib/aws-sdk-core/rpc_v2/content_type_handler.rb +45 -0
- data/lib/aws-sdk-core/rpc_v2/error_handler.rb +84 -0
- data/lib/aws-sdk-core/rpc_v2/handler.rb +74 -0
- data/lib/aws-sdk-core/rpc_v2/parser.rb +90 -0
- data/lib/aws-sdk-core/rpc_v2.rb +6 -0
- data/lib/aws-sdk-core/shared_config.rb +48 -18
- data/lib/aws-sdk-core/sso_credentials.rb +1 -1
- data/lib/aws-sdk-core/stubbing/protocols/rpc_v2.rb +41 -0
- data/lib/aws-sdk-core/stubbing/stub_data.rb +11 -0
- data/lib/aws-sdk-core/util.rb +39 -0
- data/lib/aws-sdk-core/waiters/poller.rb +4 -2
- data/lib/aws-sdk-core/xml/builder.rb +17 -9
- data/lib/aws-sdk-core/xml/error_handler.rb +32 -42
- data/lib/aws-sdk-core/xml/parser/frame.rb +4 -20
- data/lib/aws-sdk-core/xml/parser/stack.rb +2 -0
- data/lib/aws-sdk-core/xml/parser.rb +2 -6
- data/lib/aws-sdk-core.rb +7 -2
- data/lib/aws-sdk-sso/client.rb +94 -46
- data/lib/aws-sdk-sso/endpoint_provider.rb +30 -24
- data/lib/aws-sdk-sso/endpoints.rb +1 -0
- data/lib/aws-sdk-sso/plugins/endpoints.rb +4 -2
- data/lib/aws-sdk-sso.rb +1 -1
- data/lib/aws-sdk-ssooidc/client.rb +479 -74
- data/lib/aws-sdk-ssooidc/client_api.rb +78 -1
- data/lib/aws-sdk-ssooidc/endpoint_provider.rb +30 -24
- data/lib/aws-sdk-ssooidc/endpoints.rb +15 -0
- data/lib/aws-sdk-ssooidc/errors.rb +52 -0
- data/lib/aws-sdk-ssooidc/plugins/endpoints.rb +6 -2
- data/lib/aws-sdk-ssooidc/types.rb +372 -51
- data/lib/aws-sdk-ssooidc.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +219 -157
- data/lib/aws-sdk-sts/client_api.rb +20 -9
- data/lib/aws-sdk-sts/endpoint_provider.rb +81 -78
- data/lib/aws-sdk-sts/endpoints.rb +1 -0
- data/lib/aws-sdk-sts/plugins/endpoints.rb +4 -2
- data/lib/aws-sdk-sts/presigner.rb +1 -1
- data/lib/aws-sdk-sts/types.rb +49 -11
- data/lib/aws-sdk-sts.rb +1 -1
- data/lib/seahorse/client/async_base.rb +1 -1
- data/lib/seahorse/client/async_response.rb +19 -0
- data/lib/seahorse/client/base.rb +18 -7
- data/lib/seahorse/client/configuration.rb +0 -4
- data/lib/seahorse/client/h2/handler.rb +1 -0
- data/lib/seahorse/client/handler.rb +1 -1
- data/lib/seahorse/client/net_http/connection_pool.rb +3 -9
- data/lib/seahorse/client/net_http/patches.rb +1 -4
- data/lib/seahorse/client/plugin.rb +9 -0
- data/lib/seahorse/client/plugins/endpoint.rb +0 -1
- data/lib/seahorse/client/plugins/h2.rb +3 -3
- data/lib/seahorse/client/plugins/net_http.rb +48 -16
- data/lib/seahorse/client/plugins/request_callback.rb +31 -0
- data/lib/seahorse/client/response.rb +6 -0
- data/lib/seahorse/model/operation.rb +3 -0
- data/lib/seahorse/model/shapes.rb +2 -2
- data/sig/aws-sdk-core/client_stubs.rbs +10 -0
- data/sig/aws-sdk-core/errors.rbs +22 -0
- data/sig/aws-sdk-core/resources/collection.rbs +21 -0
- data/sig/aws-sdk-core/structure.rbs +4 -0
- data/sig/aws-sdk-core/waiters/errors.rbs +20 -0
- data/sig/aws-sdk-core.rbs +7 -0
- data/sig/seahorse/client/base.rbs +25 -0
- data/sig/seahorse/client/handler_builder.rbs +16 -0
- data/sig/seahorse/client/response.rbs +61 -0
- metadata +44 -17
- /data/lib/aws-sdk-core/xml/parser/{engines/libxml.rb → libxml_engine.rb} +0 -0
- /data/lib/aws-sdk-core/xml/parser/{engines/nokogiri.rb → nokogiri_engine.rb} +0 -0
- /data/lib/aws-sdk-core/xml/parser/{engines/oga.rb → oga_engine.rb} +0 -0
- /data/lib/aws-sdk-core/xml/parser/{engines/ox.rb → ox_engine.rb} +0 -0
- /data/lib/aws-sdk-core/xml/parser/{engines/rexml.rb → rexml_engine.rb} +0 -0
|
@@ -24,7 +24,7 @@ module Aws::STS
|
|
|
24
24
|
Credentials = Shapes::StructureShape.new(name: 'Credentials')
|
|
25
25
|
DecodeAuthorizationMessageRequest = Shapes::StructureShape.new(name: 'DecodeAuthorizationMessageRequest')
|
|
26
26
|
DecodeAuthorizationMessageResponse = Shapes::StructureShape.new(name: 'DecodeAuthorizationMessageResponse')
|
|
27
|
-
ExpiredTokenException = Shapes::StructureShape.new(name: 'ExpiredTokenException')
|
|
27
|
+
ExpiredTokenException = Shapes::StructureShape.new(name: 'ExpiredTokenException', error: {"code"=>"ExpiredTokenException", "httpStatusCode"=>400, "senderFault"=>true})
|
|
28
28
|
FederatedUser = Shapes::StructureShape.new(name: 'FederatedUser')
|
|
29
29
|
GetAccessKeyInfoRequest = Shapes::StructureShape.new(name: 'GetAccessKeyInfoRequest')
|
|
30
30
|
GetAccessKeyInfoResponse = Shapes::StructureShape.new(name: 'GetAccessKeyInfoResponse')
|
|
@@ -34,16 +34,18 @@ module Aws::STS
|
|
|
34
34
|
GetFederationTokenResponse = Shapes::StructureShape.new(name: 'GetFederationTokenResponse')
|
|
35
35
|
GetSessionTokenRequest = Shapes::StructureShape.new(name: 'GetSessionTokenRequest')
|
|
36
36
|
GetSessionTokenResponse = Shapes::StructureShape.new(name: 'GetSessionTokenResponse')
|
|
37
|
-
IDPCommunicationErrorException = Shapes::StructureShape.new(name: 'IDPCommunicationErrorException')
|
|
38
|
-
IDPRejectedClaimException = Shapes::StructureShape.new(name: 'IDPRejectedClaimException')
|
|
39
|
-
InvalidAuthorizationMessageException = Shapes::StructureShape.new(name: 'InvalidAuthorizationMessageException')
|
|
40
|
-
InvalidIdentityTokenException = Shapes::StructureShape.new(name: 'InvalidIdentityTokenException')
|
|
37
|
+
IDPCommunicationErrorException = Shapes::StructureShape.new(name: 'IDPCommunicationErrorException', error: {"code"=>"IDPCommunicationError", "httpStatusCode"=>400, "senderFault"=>true})
|
|
38
|
+
IDPRejectedClaimException = Shapes::StructureShape.new(name: 'IDPRejectedClaimException', error: {"code"=>"IDPRejectedClaim", "httpStatusCode"=>403, "senderFault"=>true})
|
|
39
|
+
InvalidAuthorizationMessageException = Shapes::StructureShape.new(name: 'InvalidAuthorizationMessageException', error: {"code"=>"InvalidAuthorizationMessageException", "httpStatusCode"=>400, "senderFault"=>true})
|
|
40
|
+
InvalidIdentityTokenException = Shapes::StructureShape.new(name: 'InvalidIdentityTokenException', error: {"code"=>"InvalidIdentityToken", "httpStatusCode"=>400, "senderFault"=>true})
|
|
41
41
|
Issuer = Shapes::StringShape.new(name: 'Issuer')
|
|
42
|
-
MalformedPolicyDocumentException = Shapes::StructureShape.new(name: 'MalformedPolicyDocumentException')
|
|
42
|
+
MalformedPolicyDocumentException = Shapes::StructureShape.new(name: 'MalformedPolicyDocumentException', error: {"code"=>"MalformedPolicyDocument", "httpStatusCode"=>400, "senderFault"=>true})
|
|
43
43
|
NameQualifier = Shapes::StringShape.new(name: 'NameQualifier')
|
|
44
|
-
PackedPolicyTooLargeException = Shapes::StructureShape.new(name: 'PackedPolicyTooLargeException')
|
|
44
|
+
PackedPolicyTooLargeException = Shapes::StructureShape.new(name: 'PackedPolicyTooLargeException', error: {"code"=>"PackedPolicyTooLarge", "httpStatusCode"=>400, "senderFault"=>true})
|
|
45
45
|
PolicyDescriptorType = Shapes::StructureShape.new(name: 'PolicyDescriptorType')
|
|
46
|
-
|
|
46
|
+
ProvidedContext = Shapes::StructureShape.new(name: 'ProvidedContext')
|
|
47
|
+
ProvidedContextsListType = Shapes::ListShape.new(name: 'ProvidedContextsListType')
|
|
48
|
+
RegionDisabledException = Shapes::StructureShape.new(name: 'RegionDisabledException', error: {"code"=>"RegionDisabledException", "httpStatusCode"=>403, "senderFault"=>true})
|
|
47
49
|
SAMLAssertionType = Shapes::StringShape.new(name: 'SAMLAssertionType')
|
|
48
50
|
Subject = Shapes::StringShape.new(name: 'Subject')
|
|
49
51
|
SubjectType = Shapes::StringShape.new(name: 'SubjectType')
|
|
@@ -54,6 +56,7 @@ module Aws::STS
|
|
|
54
56
|
arnType = Shapes::StringShape.new(name: 'arnType')
|
|
55
57
|
assumedRoleIdType = Shapes::StringShape.new(name: 'assumedRoleIdType')
|
|
56
58
|
clientTokenType = Shapes::StringShape.new(name: 'clientTokenType')
|
|
59
|
+
contextAssertionType = Shapes::StringShape.new(name: 'contextAssertionType')
|
|
57
60
|
dateType = Shapes::TimestampShape.new(name: 'dateType')
|
|
58
61
|
decodedMessageType = Shapes::StringShape.new(name: 'decodedMessageType')
|
|
59
62
|
durationSecondsType = Shapes::IntegerShape.new(name: 'durationSecondsType')
|
|
@@ -81,6 +84,7 @@ module Aws::STS
|
|
|
81
84
|
tagValueType = Shapes::StringShape.new(name: 'tagValueType')
|
|
82
85
|
tokenCodeType = Shapes::StringShape.new(name: 'tokenCodeType')
|
|
83
86
|
tokenType = Shapes::StringShape.new(name: 'tokenType')
|
|
87
|
+
unrestrictedSessionPolicyDocumentType = Shapes::StringShape.new(name: 'unrestrictedSessionPolicyDocumentType')
|
|
84
88
|
urlType = Shapes::StringShape.new(name: 'urlType')
|
|
85
89
|
userIdType = Shapes::StringShape.new(name: 'userIdType')
|
|
86
90
|
userNameType = Shapes::StringShape.new(name: 'userNameType')
|
|
@@ -89,7 +93,7 @@ module Aws::STS
|
|
|
89
93
|
AssumeRoleRequest.add_member(:role_arn, Shapes::ShapeRef.new(shape: arnType, required: true, location_name: "RoleArn"))
|
|
90
94
|
AssumeRoleRequest.add_member(:role_session_name, Shapes::ShapeRef.new(shape: roleSessionNameType, required: true, location_name: "RoleSessionName"))
|
|
91
95
|
AssumeRoleRequest.add_member(:policy_arns, Shapes::ShapeRef.new(shape: policyDescriptorListType, location_name: "PolicyArns"))
|
|
92
|
-
AssumeRoleRequest.add_member(:policy, Shapes::ShapeRef.new(shape:
|
|
96
|
+
AssumeRoleRequest.add_member(:policy, Shapes::ShapeRef.new(shape: unrestrictedSessionPolicyDocumentType, location_name: "Policy"))
|
|
93
97
|
AssumeRoleRequest.add_member(:duration_seconds, Shapes::ShapeRef.new(shape: roleDurationSecondsType, location_name: "DurationSeconds"))
|
|
94
98
|
AssumeRoleRequest.add_member(:tags, Shapes::ShapeRef.new(shape: tagListType, location_name: "Tags"))
|
|
95
99
|
AssumeRoleRequest.add_member(:transitive_tag_keys, Shapes::ShapeRef.new(shape: tagKeyListType, location_name: "TransitiveTagKeys"))
|
|
@@ -97,6 +101,7 @@ module Aws::STS
|
|
|
97
101
|
AssumeRoleRequest.add_member(:serial_number, Shapes::ShapeRef.new(shape: serialNumberType, location_name: "SerialNumber"))
|
|
98
102
|
AssumeRoleRequest.add_member(:token_code, Shapes::ShapeRef.new(shape: tokenCodeType, location_name: "TokenCode"))
|
|
99
103
|
AssumeRoleRequest.add_member(:source_identity, Shapes::ShapeRef.new(shape: sourceIdentityType, location_name: "SourceIdentity"))
|
|
104
|
+
AssumeRoleRequest.add_member(:provided_contexts, Shapes::ShapeRef.new(shape: ProvidedContextsListType, location_name: "ProvidedContexts"))
|
|
100
105
|
AssumeRoleRequest.struct_class = Types::AssumeRoleRequest
|
|
101
106
|
|
|
102
107
|
AssumeRoleResponse.add_member(:credentials, Shapes::ShapeRef.new(shape: Credentials, location_name: "Credentials"))
|
|
@@ -219,6 +224,12 @@ module Aws::STS
|
|
|
219
224
|
PolicyDescriptorType.add_member(:arn, Shapes::ShapeRef.new(shape: arnType, location_name: "arn"))
|
|
220
225
|
PolicyDescriptorType.struct_class = Types::PolicyDescriptorType
|
|
221
226
|
|
|
227
|
+
ProvidedContext.add_member(:provider_arn, Shapes::ShapeRef.new(shape: arnType, location_name: "ProviderArn"))
|
|
228
|
+
ProvidedContext.add_member(:context_assertion, Shapes::ShapeRef.new(shape: contextAssertionType, location_name: "ContextAssertion"))
|
|
229
|
+
ProvidedContext.struct_class = Types::ProvidedContext
|
|
230
|
+
|
|
231
|
+
ProvidedContextsListType.member = Shapes::ShapeRef.new(shape: ProvidedContext)
|
|
232
|
+
|
|
222
233
|
RegionDisabledException.add_member(:message, Shapes::ShapeRef.new(shape: regionDisabledMessage, location_name: "message"))
|
|
223
234
|
RegionDisabledException.struct_class = Types::RegionDisabledException
|
|
224
235
|
|
|
@@ -15,93 +15,96 @@ module Aws::STS
|
|
|
15
15
|
use_fips = parameters.use_fips
|
|
16
16
|
endpoint = parameters.endpoint
|
|
17
17
|
use_global_endpoint = parameters.use_global_endpoint
|
|
18
|
-
if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
|
|
19
|
-
if Aws::Endpoints::Matchers.
|
|
20
|
-
|
|
21
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
22
|
-
end
|
|
23
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "ap-south-1")
|
|
24
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
25
|
-
end
|
|
26
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "ap-southeast-1")
|
|
27
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
28
|
-
end
|
|
29
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "ap-southeast-2")
|
|
30
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
31
|
-
end
|
|
32
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "aws-global")
|
|
33
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
34
|
-
end
|
|
35
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "ca-central-1")
|
|
36
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
37
|
-
end
|
|
38
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "eu-central-1")
|
|
39
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
40
|
-
end
|
|
41
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "eu-north-1")
|
|
42
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
43
|
-
end
|
|
44
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "eu-west-1")
|
|
45
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
46
|
-
end
|
|
47
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "eu-west-2")
|
|
48
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
49
|
-
end
|
|
50
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "eu-west-3")
|
|
51
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
52
|
-
end
|
|
53
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "sa-east-1")
|
|
54
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
55
|
-
end
|
|
56
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "us-east-1")
|
|
57
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
58
|
-
end
|
|
59
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "us-east-2")
|
|
60
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
61
|
-
end
|
|
62
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "us-west-1")
|
|
63
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
64
|
-
end
|
|
65
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "us-west-2")
|
|
66
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
|
67
|
-
end
|
|
68
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"#{region}", "signingName"=>"sts"}]})
|
|
18
|
+
if Aws::Endpoints::Matchers.boolean_equals?(use_global_endpoint, true) && Aws::Endpoints::Matchers.not(Aws::Endpoints::Matchers.set?(endpoint)) && Aws::Endpoints::Matchers.set?(region) && (partition_result = Aws::Endpoints::Matchers.aws_partition(region)) && Aws::Endpoints::Matchers.boolean_equals?(use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, false)
|
|
19
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "ap-northeast-1")
|
|
20
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
69
21
|
end
|
|
70
|
-
if Aws::Endpoints::Matchers.
|
|
71
|
-
|
|
72
|
-
raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
|
|
73
|
-
end
|
|
74
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
|
75
|
-
raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
|
|
76
|
-
end
|
|
77
|
-
return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
|
|
22
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "ap-south-1")
|
|
23
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
78
24
|
end
|
|
79
|
-
if Aws::Endpoints::Matchers.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
25
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "ap-southeast-1")
|
|
26
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
27
|
+
end
|
|
28
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "ap-southeast-2")
|
|
29
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
30
|
+
end
|
|
31
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "aws-global")
|
|
32
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
33
|
+
end
|
|
34
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "ca-central-1")
|
|
35
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
84
36
|
end
|
|
37
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "eu-central-1")
|
|
38
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
39
|
+
end
|
|
40
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "eu-north-1")
|
|
41
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
42
|
+
end
|
|
43
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "eu-west-1")
|
|
44
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
45
|
+
end
|
|
46
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "eu-west-2")
|
|
47
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
48
|
+
end
|
|
49
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "eu-west-3")
|
|
50
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
51
|
+
end
|
|
52
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "sa-east-1")
|
|
53
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
54
|
+
end
|
|
55
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "us-east-1")
|
|
56
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
57
|
+
end
|
|
58
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "us-east-2")
|
|
59
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
60
|
+
end
|
|
61
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "us-west-1")
|
|
62
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
63
|
+
end
|
|
64
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "us-west-2")
|
|
65
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
66
|
+
end
|
|
67
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"#{region}"}]})
|
|
68
|
+
end
|
|
69
|
+
if Aws::Endpoints::Matchers.set?(endpoint)
|
|
85
70
|
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
|
|
86
|
-
|
|
87
|
-
if Aws::Endpoints::Matchers.string_equals?("aws-us-gov", Aws::Endpoints::Matchers.attr(partition_result, "name"))
|
|
88
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
|
89
|
-
end
|
|
90
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
|
91
|
-
end
|
|
92
|
-
raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
|
|
71
|
+
raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
|
|
93
72
|
end
|
|
94
73
|
if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
|
95
|
-
|
|
96
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
|
97
|
-
end
|
|
98
|
-
raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
|
|
74
|
+
raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
|
|
99
75
|
end
|
|
100
|
-
|
|
101
|
-
|
|
76
|
+
return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
|
|
77
|
+
end
|
|
78
|
+
if Aws::Endpoints::Matchers.set?(region)
|
|
79
|
+
if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
|
|
80
|
+
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
|
81
|
+
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"))
|
|
82
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
|
83
|
+
end
|
|
84
|
+
raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
|
|
85
|
+
end
|
|
86
|
+
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
|
|
87
|
+
if Aws::Endpoints::Matchers.boolean_equals?(Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"), true)
|
|
88
|
+
if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-us-gov")
|
|
89
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.#{region}.amazonaws.com", headers: {}, properties: {})
|
|
90
|
+
end
|
|
91
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
|
92
|
+
end
|
|
93
|
+
raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
|
|
94
|
+
end
|
|
95
|
+
if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
|
96
|
+
if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
|
|
97
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
|
98
|
+
end
|
|
99
|
+
raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
|
|
100
|
+
end
|
|
101
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "aws-global")
|
|
102
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
|
103
|
+
end
|
|
104
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
|
102
105
|
end
|
|
103
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
|
104
106
|
end
|
|
107
|
+
raise ArgumentError, "Invalid Configuration: Missing Region"
|
|
105
108
|
raise ArgumentError, 'No endpoint could be resolved'
|
|
106
109
|
|
|
107
110
|
end
|
|
@@ -14,6 +14,7 @@ module Aws::STS
|
|
|
14
14
|
option(
|
|
15
15
|
:endpoint_provider,
|
|
16
16
|
doc_type: 'Aws::STS::EndpointProvider',
|
|
17
|
+
rbs_type: 'untyped',
|
|
17
18
|
docstring: 'The endpoint provider used to resolve endpoints. Any '\
|
|
18
19
|
'object that responds to `#resolve_endpoint(parameters)` '\
|
|
19
20
|
'where `parameters` is a Struct similar to '\
|
|
@@ -25,16 +26,17 @@ module Aws::STS
|
|
|
25
26
|
# @api private
|
|
26
27
|
class Handler < Seahorse::Client::Handler
|
|
27
28
|
def call(context)
|
|
28
|
-
# If endpoint was discovered, do not resolve or apply the endpoint.
|
|
29
29
|
unless context[:discovered_endpoint]
|
|
30
30
|
params = parameters_for_operation(context)
|
|
31
31
|
endpoint = context.config.endpoint_provider.resolve_endpoint(params)
|
|
32
32
|
|
|
33
33
|
context.http_request.endpoint = endpoint.url
|
|
34
34
|
apply_endpoint_headers(context, endpoint.headers)
|
|
35
|
+
|
|
36
|
+
context[:endpoint_params] = params
|
|
37
|
+
context[:endpoint_properties] = endpoint.properties
|
|
35
38
|
end
|
|
36
39
|
|
|
37
|
-
context[:endpoint_params] = params
|
|
38
40
|
context[:auth_scheme] =
|
|
39
41
|
Aws::Endpoints.resolve_auth_scheme(context, endpoint)
|
|
40
42
|
|
|
@@ -35,7 +35,7 @@ module Aws
|
|
|
35
35
|
# )
|
|
36
36
|
#
|
|
37
37
|
# This can be easily converted to a token used by the EKS service:
|
|
38
|
-
# {https://ruby-
|
|
38
|
+
# {https://docs.ruby-lang.org/en/3.2/Base64.html#method-i-encode64}
|
|
39
39
|
# "k8s-aws-v1." + Base64.urlsafe_encode64(url).chomp("==")
|
|
40
40
|
def get_caller_identity_presigned_url(options = {})
|
|
41
41
|
req = @client.build_request(:get_caller_identity, {})
|
data/lib/aws-sdk-sts/types.rb
CHANGED
|
@@ -287,6 +287,19 @@ module Aws::STS
|
|
|
287
287
|
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html
|
|
288
288
|
# @return [String]
|
|
289
289
|
#
|
|
290
|
+
# @!attribute [rw] provided_contexts
|
|
291
|
+
# A list of previously acquired trusted context assertions in the
|
|
292
|
+
# format of a JSON array. The trusted context assertion is signed and
|
|
293
|
+
# encrypted by Amazon Web Services STS.
|
|
294
|
+
#
|
|
295
|
+
# The following is an example of a `ProvidedContext` value that
|
|
296
|
+
# includes a single trusted context assertion and the ARN of the
|
|
297
|
+
# context provider from which the trusted context assertion was
|
|
298
|
+
# generated.
|
|
299
|
+
#
|
|
300
|
+
# `[\{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"\}]`
|
|
301
|
+
# @return [Array<Types::ProvidedContext>]
|
|
302
|
+
#
|
|
290
303
|
# @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleRequest AWS API Documentation
|
|
291
304
|
#
|
|
292
305
|
class AssumeRoleRequest < Struct.new(
|
|
@@ -300,7 +313,8 @@ module Aws::STS
|
|
|
300
313
|
:external_id,
|
|
301
314
|
:serial_number,
|
|
302
315
|
:token_code,
|
|
303
|
-
:source_identity
|
|
316
|
+
:source_identity,
|
|
317
|
+
:provided_contexts)
|
|
304
318
|
SENSITIVE = []
|
|
305
319
|
include Aws::Structure
|
|
306
320
|
end
|
|
@@ -508,7 +522,7 @@ module Aws::STS
|
|
|
508
522
|
:policy_arns,
|
|
509
523
|
:policy,
|
|
510
524
|
:duration_seconds)
|
|
511
|
-
SENSITIVE = []
|
|
525
|
+
SENSITIVE = [:saml_assertion]
|
|
512
526
|
include Aws::Structure
|
|
513
527
|
end
|
|
514
528
|
|
|
@@ -576,7 +590,7 @@ module Aws::STS
|
|
|
576
590
|
# in IAM.
|
|
577
591
|
#
|
|
578
592
|
# The combination of `NameQualifier` and `Subject` can be used to
|
|
579
|
-
# uniquely identify a
|
|
593
|
+
# uniquely identify a user.
|
|
580
594
|
#
|
|
581
595
|
# The following pseudocode shows how the hash value is calculated:
|
|
582
596
|
#
|
|
@@ -652,7 +666,8 @@ module Aws::STS
|
|
|
652
666
|
# provided by the identity provider. Your application must get this
|
|
653
667
|
# token by authenticating the user who is using your application with
|
|
654
668
|
# a web identity provider before the application makes an
|
|
655
|
-
# `AssumeRoleWithWebIdentity` call.
|
|
669
|
+
# `AssumeRoleWithWebIdentity` call. Only tokens with RSA algorithms
|
|
670
|
+
# (RS256) are supported.
|
|
656
671
|
# @return [String]
|
|
657
672
|
#
|
|
658
673
|
# @!attribute [rw] provider_id
|
|
@@ -780,7 +795,7 @@ module Aws::STS
|
|
|
780
795
|
:policy_arns,
|
|
781
796
|
:policy,
|
|
782
797
|
:duration_seconds)
|
|
783
|
-
SENSITIVE = []
|
|
798
|
+
SENSITIVE = [:web_identity_token]
|
|
784
799
|
include Aws::Structure
|
|
785
800
|
end
|
|
786
801
|
|
|
@@ -941,7 +956,7 @@ module Aws::STS
|
|
|
941
956
|
:secret_access_key,
|
|
942
957
|
:session_token,
|
|
943
958
|
:expiration)
|
|
944
|
-
SENSITIVE = []
|
|
959
|
+
SENSITIVE = [:secret_access_key]
|
|
945
960
|
include Aws::Structure
|
|
946
961
|
end
|
|
947
962
|
|
|
@@ -1200,11 +1215,10 @@ module Aws::STS
|
|
|
1200
1215
|
# The duration, in seconds, that the session should last. Acceptable
|
|
1201
1216
|
# durations for federation sessions range from 900 seconds (15
|
|
1202
1217
|
# minutes) to 129,600 seconds (36 hours), with 43,200 seconds (12
|
|
1203
|
-
# hours) as the default. Sessions obtained using
|
|
1204
|
-
#
|
|
1205
|
-
#
|
|
1206
|
-
#
|
|
1207
|
-
# to one hour.
|
|
1218
|
+
# hours) as the default. Sessions obtained using root user credentials
|
|
1219
|
+
# are restricted to a maximum of 3,600 seconds (one hour). If the
|
|
1220
|
+
# specified duration is longer than one hour, the session obtained by
|
|
1221
|
+
# using root user credentials defaults to one hour.
|
|
1208
1222
|
# @return [Integer]
|
|
1209
1223
|
#
|
|
1210
1224
|
# @!attribute [rw] tags
|
|
@@ -1498,6 +1512,30 @@ module Aws::STS
|
|
|
1498
1512
|
include Aws::Structure
|
|
1499
1513
|
end
|
|
1500
1514
|
|
|
1515
|
+
# Contains information about the provided context. This includes the
|
|
1516
|
+
# signed and encrypted trusted context assertion and the context
|
|
1517
|
+
# provider ARN from which the trusted context assertion was generated.
|
|
1518
|
+
#
|
|
1519
|
+
# @!attribute [rw] provider_arn
|
|
1520
|
+
# The context provider ARN from which the trusted context assertion
|
|
1521
|
+
# was generated.
|
|
1522
|
+
# @return [String]
|
|
1523
|
+
#
|
|
1524
|
+
# @!attribute [rw] context_assertion
|
|
1525
|
+
# The signed and encrypted trusted context assertion generated by the
|
|
1526
|
+
# context provider. The trusted context assertion is signed and
|
|
1527
|
+
# encrypted by Amazon Web Services STS.
|
|
1528
|
+
# @return [String]
|
|
1529
|
+
#
|
|
1530
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/ProvidedContext AWS API Documentation
|
|
1531
|
+
#
|
|
1532
|
+
class ProvidedContext < Struct.new(
|
|
1533
|
+
:provider_arn,
|
|
1534
|
+
:context_assertion)
|
|
1535
|
+
SENSITIVE = []
|
|
1536
|
+
include Aws::Structure
|
|
1537
|
+
end
|
|
1538
|
+
|
|
1501
1539
|
# STS is not activated in the requested region for the account that is
|
|
1502
1540
|
# being asked to generate credentials. The account administrator must
|
|
1503
1541
|
# use the IAM console to activate STS in that region. For more
|
data/lib/aws-sdk-sts.rb
CHANGED
|
@@ -5,12 +5,12 @@ module Seahorse
|
|
|
5
5
|
class AsyncBase < Seahorse::Client::Base
|
|
6
6
|
|
|
7
7
|
# default H2 plugins
|
|
8
|
+
# @api private
|
|
8
9
|
@plugins = PluginList.new([
|
|
9
10
|
Plugins::Endpoint,
|
|
10
11
|
Plugins::H2,
|
|
11
12
|
Plugins::ResponseTarget
|
|
12
13
|
])
|
|
13
|
-
|
|
14
14
|
def initialize(plugins, options)
|
|
15
15
|
super
|
|
16
16
|
@connection = H2::Connection.new(options)
|
|
@@ -12,24 +12,43 @@ module Seahorse
|
|
|
12
12
|
@sync_queue = options[:sync_queue]
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
# @return [RequestContext]
|
|
15
16
|
def context
|
|
16
17
|
@response.context
|
|
17
18
|
end
|
|
18
19
|
|
|
20
|
+
# @return [StandardError, nil]
|
|
19
21
|
def error
|
|
20
22
|
@response.error
|
|
21
23
|
end
|
|
22
24
|
|
|
25
|
+
# @overload on(status_code, &block)
|
|
26
|
+
# @param [Integer] status_code The block will be
|
|
27
|
+
# triggered only for responses with the given status code.
|
|
28
|
+
#
|
|
29
|
+
# @overload on(status_code_range, &block)
|
|
30
|
+
# @param [Range<Integer>] status_code_range The block will be
|
|
31
|
+
# triggered only for responses with a status code that falls
|
|
32
|
+
# witin the given range.
|
|
33
|
+
#
|
|
34
|
+
# @return [self]
|
|
23
35
|
def on(range, &block)
|
|
24
36
|
@response.on(range, &block)
|
|
25
37
|
self
|
|
26
38
|
end
|
|
27
39
|
|
|
40
|
+
# @api private
|
|
28
41
|
def on_complete(&block)
|
|
29
42
|
@response.on_complete(&block)
|
|
30
43
|
self
|
|
31
44
|
end
|
|
32
45
|
|
|
46
|
+
# @return [Boolean] Returns `true` if the response is complete with
|
|
47
|
+
# no error.
|
|
48
|
+
def successful?
|
|
49
|
+
@response.error.nil?
|
|
50
|
+
end
|
|
51
|
+
|
|
33
52
|
def wait
|
|
34
53
|
if error && context.config.raise_response_errors
|
|
35
54
|
raise error
|
data/lib/seahorse/client/base.rb
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'thread'
|
|
4
|
-
|
|
5
3
|
module Seahorse
|
|
6
4
|
module Client
|
|
7
5
|
class Base
|
|
@@ -9,6 +7,7 @@ module Seahorse
|
|
|
9
7
|
include HandlerBuilder
|
|
10
8
|
|
|
11
9
|
# default plugins
|
|
10
|
+
# @api private
|
|
12
11
|
@plugins = PluginList.new([
|
|
13
12
|
Plugins::Endpoint,
|
|
14
13
|
Plugins::NetHttp,
|
|
@@ -59,6 +58,7 @@ module Seahorse
|
|
|
59
58
|
def build_config(plugins, options)
|
|
60
59
|
config = Configuration.new
|
|
61
60
|
config.add_option(:api)
|
|
61
|
+
config.add_option(:plugins)
|
|
62
62
|
plugins.each do |plugin|
|
|
63
63
|
plugin.add_options(config) if plugin.respond_to?(:add_options)
|
|
64
64
|
end
|
|
@@ -95,9 +95,9 @@ module Seahorse
|
|
|
95
95
|
class << self
|
|
96
96
|
|
|
97
97
|
def new(options = {})
|
|
98
|
-
plugins = build_plugins
|
|
99
98
|
options = options.dup
|
|
100
|
-
|
|
99
|
+
plugins = build_plugins(self.plugins + options.fetch(:plugins, []))
|
|
100
|
+
plugins = before_initialize(plugins, options)
|
|
101
101
|
client = allocate
|
|
102
102
|
client.send(:initialize, plugins, options)
|
|
103
103
|
client
|
|
@@ -208,17 +208,28 @@ module Seahorse
|
|
|
208
208
|
include(operations_module)
|
|
209
209
|
end
|
|
210
210
|
|
|
211
|
-
def build_plugins
|
|
211
|
+
def build_plugins(plugins)
|
|
212
212
|
plugins.map { |plugin| plugin.is_a?(Class) ? plugin.new : plugin }
|
|
213
213
|
end
|
|
214
214
|
|
|
215
215
|
def before_initialize(plugins, options)
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
queue = Queue.new
|
|
217
|
+
plugins.each { |plugin| queue.push(plugin) }
|
|
218
|
+
until queue.empty?
|
|
219
|
+
plugin = queue.pop
|
|
220
|
+
next unless plugin.respond_to?(:before_initialize)
|
|
221
|
+
|
|
222
|
+
plugins_before = options.fetch(:plugins, [])
|
|
223
|
+
plugin.before_initialize(self, options)
|
|
224
|
+
plugins_after = build_plugins(options.fetch(:plugins, []) - plugins_before)
|
|
225
|
+
# Plugins with before_initialize can add other plugins
|
|
226
|
+
plugins_after.each { |p| queue.push(p); plugins << p }
|
|
218
227
|
end
|
|
228
|
+
plugins
|
|
219
229
|
end
|
|
220
230
|
|
|
221
231
|
def inherited(subclass)
|
|
232
|
+
super
|
|
222
233
|
subclass.instance_variable_set('@plugins', PluginList.new(@plugins))
|
|
223
234
|
end
|
|
224
235
|
|
|
@@ -204,10 +204,6 @@ module Seahorse
|
|
|
204
204
|
def value_at(opt_name)
|
|
205
205
|
value = @struct[opt_name]
|
|
206
206
|
if value.is_a?(Defaults)
|
|
207
|
-
# Legacy endpoints must continue to exist.
|
|
208
|
-
if opt_name == :endpoint && @struct.members.include?(:regional_endpoint)
|
|
209
|
-
@struct[:regional_endpoint] = true
|
|
210
|
-
end
|
|
211
207
|
resolve_defaults(opt_name, value)
|
|
212
208
|
else
|
|
213
209
|
value
|
|
@@ -126,6 +126,7 @@ module Seahorse
|
|
|
126
126
|
# https://http2.github.io/http2-spec/#rfc.section.8.1.2.3
|
|
127
127
|
def _h2_headers(req)
|
|
128
128
|
headers = {}
|
|
129
|
+
headers[':authority'] = req.endpoint.host
|
|
129
130
|
headers[':method'] = req.http_method.upcase
|
|
130
131
|
headers[':scheme'] = req.endpoint.scheme
|
|
131
132
|
headers[':path'] = req.endpoint.path.empty? ? '/' : req.endpoint.path
|
|
@@ -119,11 +119,7 @@ module Seahorse
|
|
|
119
119
|
# pool, not counting those currently in use.
|
|
120
120
|
def size
|
|
121
121
|
@pool_mutex.synchronize do
|
|
122
|
-
size
|
|
123
|
-
@pool.each_pair do |endpoint,sessions|
|
|
124
|
-
size += sessions.size
|
|
125
|
-
end
|
|
126
|
-
size
|
|
122
|
+
@pool.values.flatten.size
|
|
127
123
|
end
|
|
128
124
|
end
|
|
129
125
|
|
|
@@ -142,9 +138,7 @@ module Seahorse
|
|
|
142
138
|
# @return [nil]
|
|
143
139
|
def empty!
|
|
144
140
|
@pool_mutex.synchronize do
|
|
145
|
-
@pool.
|
|
146
|
-
sessions.each(&:finish)
|
|
147
|
-
end
|
|
141
|
+
@pool.values.flatten.map(&:finish)
|
|
148
142
|
@pool.clear
|
|
149
143
|
end
|
|
150
144
|
nil
|
|
@@ -312,7 +306,7 @@ module Seahorse
|
|
|
312
306
|
# @note **Must** be called behind a `@pool_mutex` synchronize block.
|
|
313
307
|
def _clean
|
|
314
308
|
now = Aws::Util.monotonic_milliseconds
|
|
315
|
-
@pool.
|
|
309
|
+
@pool.values.each do |sessions|
|
|
316
310
|
sessions.delete_if do |session|
|
|
317
311
|
if session.last_used.nil? or now - session.last_used > http_idle_timeout * 1000
|
|
318
312
|
session.finish
|