aws-sdk-core 3.197.0 → 3.220.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 +297 -0
- data/VERSION +1 -1
- data/lib/aws-defaults/default_configuration.rb +1 -2
- data/lib/aws-defaults.rb +4 -1
- data/lib/aws-sdk-core/arn.rb +1 -3
- data/lib/aws-sdk-core/assume_role_credentials.rb +12 -5
- data/lib/aws-sdk-core/assume_role_web_identity_credentials.rb +13 -7
- data/lib/aws-sdk-core/binary/decode_handler.rb +3 -4
- data/lib/aws-sdk-core/binary/encode_handler.rb +1 -1
- 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/decoder.rb +308 -0
- data/lib/aws-sdk-core/cbor/encoder.rb +243 -0
- data/lib/aws-sdk-core/cbor.rb +53 -0
- data/lib/aws-sdk-core/client_side_monitoring.rb +9 -0
- data/lib/aws-sdk-core/client_stubs.rb +8 -7
- data/lib/aws-sdk-core/credential_provider_chain.rb +13 -6
- data/lib/aws-sdk-core/credentials.rb +13 -6
- data/lib/aws-sdk-core/endpoints/endpoint.rb +3 -1
- data/lib/aws-sdk-core/endpoints/matchers.rb +6 -9
- data/lib/aws-sdk-core/endpoints.rb +74 -18
- data/lib/aws-sdk-core/error_handler.rb +41 -0
- data/lib/aws-sdk-core/errors.rb +9 -0
- data/lib/aws-sdk-core/json/error_handler.rb +8 -9
- data/lib/aws-sdk-core/json/handler.rb +6 -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 +2 -0
- data/lib/aws-sdk-core/json.rb +43 -14
- data/lib/aws-sdk-core/log/param_filter.rb +2 -2
- data/lib/aws-sdk-core/log/param_formatter.rb +7 -3
- data/lib/aws-sdk-core/log.rb +10 -0
- data/lib/aws-sdk-core/param_validator.rb +1 -1
- data/lib/aws-sdk-core/plugins/bearer_authorization.rb +2 -0
- data/lib/aws-sdk-core/plugins/checksum_algorithm.rb +332 -169
- data/lib/aws-sdk-core/plugins/credentials_configuration.rb +7 -3
- data/lib/aws-sdk-core/plugins/global_configuration.rb +8 -9
- data/lib/aws-sdk-core/plugins/http_checksum.rb +2 -8
- 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 +4 -3
- data/lib/aws-sdk-core/plugins/protocols/rest_xml.rb +5 -1
- data/lib/aws-sdk-core/plugins/protocols/rpc_v2.rb +17 -0
- data/lib/aws-sdk-core/plugins/regional_endpoint.rb +74 -25
- data/lib/aws-sdk-core/plugins/retry_errors.rb +0 -1
- data/lib/aws-sdk-core/plugins/sign.rb +13 -11
- data/lib/aws-sdk-core/plugins/signature_v2.rb +2 -1
- data/lib/aws-sdk-core/plugins/signature_v4.rb +2 -1
- data/lib/aws-sdk-core/plugins/stub_responses.rb +29 -2
- data/lib/aws-sdk-core/plugins/telemetry.rb +75 -0
- data/lib/aws-sdk-core/plugins/transfer_encoding.rb +16 -9
- data/lib/aws-sdk-core/plugins/user_agent.rb +26 -8
- data/lib/aws-sdk-core/plugins.rb +39 -0
- data/lib/aws-sdk-core/process_credentials.rb +47 -28
- data/lib/aws-sdk-core/query/ec2_handler.rb +27 -0
- data/lib/aws-sdk-core/query/handler.rb +4 -4
- data/lib/aws-sdk-core/query.rb +2 -1
- data/lib/aws-sdk-core/resources.rb +8 -0
- data/lib/aws-sdk-core/rest/{request/content_type.rb → content_type_handler.rb} +1 -1
- data/lib/aws-sdk-core/rest/handler.rb +3 -4
- data/lib/aws-sdk-core/rest/request/endpoint.rb +3 -1
- data/lib/aws-sdk-core/rest/request/headers.rb +2 -2
- data/lib/aws-sdk-core/rest.rb +1 -1
- data/lib/aws-sdk-core/rpc_v2/builder.rb +62 -0
- data/lib/aws-sdk-core/rpc_v2/cbor_engine.rb +18 -0
- data/lib/aws-sdk-core/rpc_v2/content_type_handler.rb +47 -0
- data/lib/aws-sdk-core/rpc_v2/error_handler.rb +85 -0
- data/lib/aws-sdk-core/rpc_v2/handler.rb +79 -0
- data/lib/aws-sdk-core/rpc_v2/parser.rb +90 -0
- data/lib/aws-sdk-core/rpc_v2.rb +69 -0
- data/lib/aws-sdk-core/shared_config.rb +7 -2
- data/lib/aws-sdk-core/shared_credentials.rb +0 -7
- data/lib/aws-sdk-core/sso_credentials.rb +2 -1
- data/lib/aws-sdk-core/stubbing/protocols/ec2.rb +12 -11
- data/lib/aws-sdk-core/stubbing/protocols/json.rb +11 -10
- data/lib/aws-sdk-core/stubbing/protocols/query.rb +7 -6
- data/lib/aws-sdk-core/stubbing/protocols/rest.rb +2 -1
- data/lib/aws-sdk-core/stubbing/protocols/rest_json.rb +9 -8
- data/lib/aws-sdk-core/stubbing/protocols/rest_xml.rb +6 -5
- data/lib/aws-sdk-core/stubbing/protocols/rpc_v2.rb +39 -0
- data/lib/aws-sdk-core/stubbing.rb +22 -0
- data/lib/aws-sdk-core/telemetry/base.rb +177 -0
- data/lib/aws-sdk-core/telemetry/no_op.rb +70 -0
- data/lib/aws-sdk-core/telemetry/otel.rb +235 -0
- data/lib/aws-sdk-core/telemetry/span_kind.rb +22 -0
- data/lib/aws-sdk-core/telemetry/span_status.rb +59 -0
- data/lib/aws-sdk-core/telemetry.rb +78 -0
- data/lib/aws-sdk-core/waiters/poller.rb +9 -4
- data/lib/aws-sdk-core/xml/error_handler.rb +11 -37
- data/lib/aws-sdk-core/xml/parser.rb +2 -6
- data/lib/aws-sdk-core.rb +82 -108
- data/lib/aws-sdk-sso/client.rb +99 -37
- data/lib/aws-sdk-sso/client_api.rb +7 -0
- data/lib/aws-sdk-sso/endpoint_parameters.rb +9 -6
- data/lib/aws-sdk-sso/endpoint_provider.rb +14 -18
- data/lib/aws-sdk-sso/endpoints.rb +2 -54
- data/lib/aws-sdk-sso/plugins/endpoints.rb +19 -20
- data/lib/aws-sdk-sso/types.rb +1 -0
- data/lib/aws-sdk-sso.rb +15 -11
- data/lib/aws-sdk-ssooidc/client.rb +123 -55
- data/lib/aws-sdk-ssooidc/client_api.rb +5 -0
- data/lib/aws-sdk-ssooidc/endpoint_parameters.rb +9 -6
- data/lib/aws-sdk-ssooidc/endpoint_provider.rb +14 -18
- data/lib/aws-sdk-ssooidc/endpoints.rb +2 -54
- data/lib/aws-sdk-ssooidc/plugins/endpoints.rb +19 -20
- data/lib/aws-sdk-ssooidc/types.rb +21 -15
- data/lib/aws-sdk-ssooidc.rb +15 -11
- data/lib/aws-sdk-sts/client.rb +307 -89
- data/lib/aws-sdk-sts/client_api.rb +28 -2
- data/lib/aws-sdk-sts/customizations.rb +5 -1
- data/lib/aws-sdk-sts/endpoint_parameters.rb +10 -9
- data/lib/aws-sdk-sts/endpoint_provider.rb +33 -38
- data/lib/aws-sdk-sts/endpoints.rb +2 -118
- data/lib/aws-sdk-sts/errors.rb +16 -0
- data/lib/aws-sdk-sts/plugins/endpoints.rb +19 -28
- data/lib/aws-sdk-sts/types.rb +171 -28
- data/lib/aws-sdk-sts.rb +15 -11
- data/lib/seahorse/client/base.rb +17 -7
- data/lib/seahorse/client/h2/handler.rb +13 -3
- data/lib/seahorse/client/handler.rb +1 -1
- data/lib/seahorse/client/net_http/connection_pool.rb +10 -2
- data/lib/seahorse/client/net_http/handler.rb +21 -9
- data/lib/seahorse/client/plugins/endpoint.rb +0 -1
- data/lib/seahorse/client/plugins/net_http.rb +9 -0
- data/lib/seahorse/client/request_context.rb +8 -1
- data/lib/seahorse/client/response.rb +2 -0
- data/sig/aws-sdk-core/telemetry/base.rbs +46 -0
- data/sig/aws-sdk-core/telemetry/otel.rbs +22 -0
- data/sig/aws-sdk-core/telemetry/span_kind.rbs +15 -0
- data/sig/aws-sdk-core/telemetry/span_status.rbs +24 -0
- metadata +62 -18
- /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
@@ -7,6 +7,7 @@
|
|
7
7
|
#
|
8
8
|
# WARNING ABOUT GENERATED CODE
|
9
9
|
|
10
|
+
|
10
11
|
module Aws::STS
|
11
12
|
# @api private
|
12
13
|
module ClientApi
|
@@ -19,6 +20,8 @@ module Aws::STS
|
|
19
20
|
AssumeRoleWithSAMLResponse = Shapes::StructureShape.new(name: 'AssumeRoleWithSAMLResponse')
|
20
21
|
AssumeRoleWithWebIdentityRequest = Shapes::StructureShape.new(name: 'AssumeRoleWithWebIdentityRequest')
|
21
22
|
AssumeRoleWithWebIdentityResponse = Shapes::StructureShape.new(name: 'AssumeRoleWithWebIdentityResponse')
|
23
|
+
AssumeRootRequest = Shapes::StructureShape.new(name: 'AssumeRootRequest')
|
24
|
+
AssumeRootResponse = Shapes::StructureShape.new(name: 'AssumeRootResponse')
|
22
25
|
AssumedRoleUser = Shapes::StructureShape.new(name: 'AssumedRoleUser')
|
23
26
|
Audience = Shapes::StringShape.new(name: 'Audience')
|
24
27
|
Credentials = Shapes::StructureShape.new(name: 'Credentials')
|
@@ -46,10 +49,12 @@ module Aws::STS
|
|
46
49
|
ProvidedContext = Shapes::StructureShape.new(name: 'ProvidedContext')
|
47
50
|
ProvidedContextsListType = Shapes::ListShape.new(name: 'ProvidedContextsListType')
|
48
51
|
RegionDisabledException = Shapes::StructureShape.new(name: 'RegionDisabledException', error: {"code"=>"RegionDisabledException", "httpStatusCode"=>403, "senderFault"=>true})
|
52
|
+
RootDurationSecondsType = Shapes::IntegerShape.new(name: 'RootDurationSecondsType')
|
49
53
|
SAMLAssertionType = Shapes::StringShape.new(name: 'SAMLAssertionType')
|
50
54
|
Subject = Shapes::StringShape.new(name: 'Subject')
|
51
55
|
SubjectType = Shapes::StringShape.new(name: 'SubjectType')
|
52
56
|
Tag = Shapes::StructureShape.new(name: 'Tag')
|
57
|
+
TargetPrincipalType = Shapes::StringShape.new(name: 'TargetPrincipalType')
|
53
58
|
accessKeyIdType = Shapes::StringShape.new(name: 'accessKeyIdType')
|
54
59
|
accessKeySecretType = Shapes::StringShape.new(name: 'accessKeySecretType')
|
55
60
|
accountType = Shapes::StringShape.new(name: 'accountType')
|
@@ -147,6 +152,15 @@ module Aws::STS
|
|
147
152
|
AssumeRoleWithWebIdentityResponse.add_member(:source_identity, Shapes::ShapeRef.new(shape: sourceIdentityType, location_name: "SourceIdentity"))
|
148
153
|
AssumeRoleWithWebIdentityResponse.struct_class = Types::AssumeRoleWithWebIdentityResponse
|
149
154
|
|
155
|
+
AssumeRootRequest.add_member(:target_principal, Shapes::ShapeRef.new(shape: TargetPrincipalType, required: true, location_name: "TargetPrincipal"))
|
156
|
+
AssumeRootRequest.add_member(:task_policy_arn, Shapes::ShapeRef.new(shape: PolicyDescriptorType, required: true, location_name: "TaskPolicyArn"))
|
157
|
+
AssumeRootRequest.add_member(:duration_seconds, Shapes::ShapeRef.new(shape: RootDurationSecondsType, location_name: "DurationSeconds"))
|
158
|
+
AssumeRootRequest.struct_class = Types::AssumeRootRequest
|
159
|
+
|
160
|
+
AssumeRootResponse.add_member(:credentials, Shapes::ShapeRef.new(shape: Credentials, location_name: "Credentials"))
|
161
|
+
AssumeRootResponse.add_member(:source_identity, Shapes::ShapeRef.new(shape: sourceIdentityType, location_name: "SourceIdentity"))
|
162
|
+
AssumeRootResponse.struct_class = Types::AssumeRootResponse
|
163
|
+
|
150
164
|
AssumedRoleUser.add_member(:assumed_role_id, Shapes::ShapeRef.new(shape: assumedRoleIdType, required: true, location_name: "AssumedRoleId"))
|
151
165
|
AssumedRoleUser.add_member(:arn, Shapes::ShapeRef.new(shape: arnType, required: true, location_name: "Arn"))
|
152
166
|
AssumedRoleUser.struct_class = Types::AssumedRoleUser
|
@@ -251,9 +265,11 @@ module Aws::STS
|
|
251
265
|
|
252
266
|
api.metadata = {
|
253
267
|
"apiVersion" => "2011-06-15",
|
268
|
+
"auth" => ["aws.auth#sigv4"],
|
254
269
|
"endpointPrefix" => "sts",
|
255
270
|
"globalEndpoint" => "sts.amazonaws.com",
|
256
271
|
"protocol" => "query",
|
272
|
+
"protocols" => ["query"],
|
257
273
|
"serviceAbbreviation" => "AWS STS",
|
258
274
|
"serviceFullName" => "AWS Security Token Service",
|
259
275
|
"serviceId" => "STS",
|
@@ -278,7 +294,7 @@ module Aws::STS
|
|
278
294
|
o.name = "AssumeRoleWithSAML"
|
279
295
|
o.http_method = "POST"
|
280
296
|
o.http_request_uri = "/"
|
281
|
-
o['
|
297
|
+
o['auth'] = ["smithy.api#noAuth"]
|
282
298
|
o.input = Shapes::ShapeRef.new(shape: AssumeRoleWithSAMLRequest)
|
283
299
|
o.output = Shapes::ShapeRef.new(shape: AssumeRoleWithSAMLResponse)
|
284
300
|
o.errors << Shapes::ShapeRef.new(shape: MalformedPolicyDocumentException)
|
@@ -293,7 +309,7 @@ module Aws::STS
|
|
293
309
|
o.name = "AssumeRoleWithWebIdentity"
|
294
310
|
o.http_method = "POST"
|
295
311
|
o.http_request_uri = "/"
|
296
|
-
o['
|
312
|
+
o['auth'] = ["smithy.api#noAuth"]
|
297
313
|
o.input = Shapes::ShapeRef.new(shape: AssumeRoleWithWebIdentityRequest)
|
298
314
|
o.output = Shapes::ShapeRef.new(shape: AssumeRoleWithWebIdentityResponse)
|
299
315
|
o.errors << Shapes::ShapeRef.new(shape: MalformedPolicyDocumentException)
|
@@ -305,6 +321,16 @@ module Aws::STS
|
|
305
321
|
o.errors << Shapes::ShapeRef.new(shape: RegionDisabledException)
|
306
322
|
end)
|
307
323
|
|
324
|
+
api.add_operation(:assume_root, Seahorse::Model::Operation.new.tap do |o|
|
325
|
+
o.name = "AssumeRoot"
|
326
|
+
o.http_method = "POST"
|
327
|
+
o.http_request_uri = "/"
|
328
|
+
o.input = Shapes::ShapeRef.new(shape: AssumeRootRequest)
|
329
|
+
o.output = Shapes::ShapeRef.new(shape: AssumeRootResponse)
|
330
|
+
o.errors << Shapes::ShapeRef.new(shape: RegionDisabledException)
|
331
|
+
o.errors << Shapes::ShapeRef.new(shape: ExpiredTokenException)
|
332
|
+
end)
|
333
|
+
|
308
334
|
api.add_operation(:decode_authorization_message, Seahorse::Model::Operation.new.tap do |o|
|
309
335
|
o.name = "DecodeAuthorizationMessage"
|
310
336
|
o.http_method = "POST"
|
@@ -59,20 +59,21 @@ module Aws::STS
|
|
59
59
|
self[:region] = options[:region]
|
60
60
|
self[:use_dual_stack] = options[:use_dual_stack]
|
61
61
|
self[:use_dual_stack] = false if self[:use_dual_stack].nil?
|
62
|
-
if self[:use_dual_stack].nil?
|
63
|
-
raise ArgumentError, "Missing required EndpointParameter: :use_dual_stack"
|
64
|
-
end
|
65
62
|
self[:use_fips] = options[:use_fips]
|
66
63
|
self[:use_fips] = false if self[:use_fips].nil?
|
67
|
-
if self[:use_fips].nil?
|
68
|
-
raise ArgumentError, "Missing required EndpointParameter: :use_fips"
|
69
|
-
end
|
70
64
|
self[:endpoint] = options[:endpoint]
|
71
65
|
self[:use_global_endpoint] = options[:use_global_endpoint]
|
72
66
|
self[:use_global_endpoint] = false if self[:use_global_endpoint].nil?
|
73
|
-
|
74
|
-
|
75
|
-
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.create(config, options={})
|
70
|
+
new({
|
71
|
+
region: config.region,
|
72
|
+
use_dual_stack: config.use_dualstack_endpoint,
|
73
|
+
use_fips: config.use_fips_endpoint,
|
74
|
+
endpoint: (config.endpoint.to_s unless config.regional_endpoint),
|
75
|
+
use_global_endpoint: config.sts_regional_endpoints == 'legacy',
|
76
|
+
}.merge(options))
|
76
77
|
end
|
77
78
|
end
|
78
79
|
end
|
@@ -10,98 +10,93 @@
|
|
10
10
|
module Aws::STS
|
11
11
|
class EndpointProvider
|
12
12
|
def resolve_endpoint(parameters)
|
13
|
-
region = parameters.region
|
14
|
-
|
15
|
-
use_fips = parameters.use_fips
|
16
|
-
endpoint = parameters.endpoint
|
17
|
-
use_global_endpoint = parameters.use_global_endpoint
|
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")
|
13
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_global_endpoint, true) && Aws::Endpoints::Matchers.not(Aws::Endpoints::Matchers.set?(parameters.endpoint)) && Aws::Endpoints::Matchers.set?(parameters.region) && (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region)) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false)
|
14
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "ap-northeast-1")
|
20
15
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
21
16
|
end
|
22
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "ap-south-1")
|
17
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "ap-south-1")
|
23
18
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
24
19
|
end
|
25
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "ap-southeast-1")
|
20
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "ap-southeast-1")
|
26
21
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
27
22
|
end
|
28
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "ap-southeast-2")
|
23
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "ap-southeast-2")
|
29
24
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
30
25
|
end
|
31
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "aws-global")
|
26
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "aws-global")
|
32
27
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
33
28
|
end
|
34
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "ca-central-1")
|
29
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "ca-central-1")
|
35
30
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
36
31
|
end
|
37
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "eu-central-1")
|
32
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "eu-central-1")
|
38
33
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
39
34
|
end
|
40
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "eu-north-1")
|
35
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "eu-north-1")
|
41
36
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
42
37
|
end
|
43
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "eu-west-1")
|
38
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "eu-west-1")
|
44
39
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
45
40
|
end
|
46
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "eu-west-2")
|
41
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "eu-west-2")
|
47
42
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
48
43
|
end
|
49
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "eu-west-3")
|
44
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "eu-west-3")
|
50
45
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
51
46
|
end
|
52
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "sa-east-1")
|
47
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "sa-east-1")
|
53
48
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
54
49
|
end
|
55
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "us-east-1")
|
50
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "us-east-1")
|
56
51
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
57
52
|
end
|
58
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "us-east-2")
|
53
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "us-east-2")
|
59
54
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
60
55
|
end
|
61
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "us-west-1")
|
56
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "us-west-1")
|
62
57
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
63
58
|
end
|
64
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "us-west-2")
|
59
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "us-west-2")
|
65
60
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
66
61
|
end
|
67
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"#{region}"}]})
|
62
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"#{parameters.region}"}]})
|
68
63
|
end
|
69
|
-
if Aws::Endpoints::Matchers.set?(endpoint)
|
70
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
|
64
|
+
if Aws::Endpoints::Matchers.set?(parameters.endpoint)
|
65
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true)
|
71
66
|
raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
|
72
67
|
end
|
73
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
68
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
|
74
69
|
raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
|
75
70
|
end
|
76
|
-
return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
|
71
|
+
return Aws::Endpoints::Endpoint.new(url: parameters.endpoint, headers: {}, properties: {})
|
77
72
|
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)
|
73
|
+
if Aws::Endpoints::Matchers.set?(parameters.region)
|
74
|
+
if (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region))
|
75
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
|
81
76
|
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: {})
|
77
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts-fips.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
83
78
|
end
|
84
79
|
raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
|
85
80
|
end
|
86
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
|
81
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true)
|
87
82
|
if Aws::Endpoints::Matchers.boolean_equals?(Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"), true)
|
88
83
|
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: {})
|
84
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.#{parameters.region}.amazonaws.com", headers: {}, properties: {})
|
90
85
|
end
|
91
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
86
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts-fips.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
92
87
|
end
|
93
88
|
raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
|
94
89
|
end
|
95
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
90
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
|
96
91
|
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: {})
|
92
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
98
93
|
end
|
99
94
|
raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
|
100
95
|
end
|
101
|
-
if Aws::Endpoints::Matchers.string_equals?(region, "aws-global")
|
96
|
+
if Aws::Endpoints::Matchers.string_equals?(parameters.region, "aws-global")
|
102
97
|
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"sts", "signingRegion"=>"us-east-1"}]})
|
103
98
|
end
|
104
|
-
return Aws::Endpoints::Endpoint.new(url: "https://sts.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
99
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
105
100
|
end
|
106
101
|
end
|
107
102
|
raise ArgumentError, "Invalid Configuration: Missing Region"
|
@@ -12,125 +12,9 @@ module Aws::STS
|
|
12
12
|
# @api private
|
13
13
|
module Endpoints
|
14
14
|
|
15
|
-
class AssumeRole
|
16
|
-
def self.build(context)
|
17
|
-
unless context.config.regional_endpoint
|
18
|
-
endpoint = context.config.endpoint.to_s
|
19
|
-
end
|
20
|
-
Aws::STS::EndpointParameters.new(
|
21
|
-
region: context.config.region,
|
22
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
23
|
-
use_fips: context.config.use_fips_endpoint,
|
24
|
-
endpoint: endpoint,
|
25
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
26
|
-
)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
class AssumeRoleWithSAML
|
31
|
-
def self.build(context)
|
32
|
-
unless context.config.regional_endpoint
|
33
|
-
endpoint = context.config.endpoint.to_s
|
34
|
-
end
|
35
|
-
Aws::STS::EndpointParameters.new(
|
36
|
-
region: context.config.region,
|
37
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
38
|
-
use_fips: context.config.use_fips_endpoint,
|
39
|
-
endpoint: endpoint,
|
40
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
41
|
-
)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
class AssumeRoleWithWebIdentity
|
46
|
-
def self.build(context)
|
47
|
-
unless context.config.regional_endpoint
|
48
|
-
endpoint = context.config.endpoint.to_s
|
49
|
-
end
|
50
|
-
Aws::STS::EndpointParameters.new(
|
51
|
-
region: context.config.region,
|
52
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
53
|
-
use_fips: context.config.use_fips_endpoint,
|
54
|
-
endpoint: endpoint,
|
55
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
56
|
-
)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
class DecodeAuthorizationMessage
|
61
|
-
def self.build(context)
|
62
|
-
unless context.config.regional_endpoint
|
63
|
-
endpoint = context.config.endpoint.to_s
|
64
|
-
end
|
65
|
-
Aws::STS::EndpointParameters.new(
|
66
|
-
region: context.config.region,
|
67
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
68
|
-
use_fips: context.config.use_fips_endpoint,
|
69
|
-
endpoint: endpoint,
|
70
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
71
|
-
)
|
72
|
-
end
|
73
|
-
end
|
74
15
|
|
75
|
-
|
76
|
-
|
77
|
-
unless context.config.regional_endpoint
|
78
|
-
endpoint = context.config.endpoint.to_s
|
79
|
-
end
|
80
|
-
Aws::STS::EndpointParameters.new(
|
81
|
-
region: context.config.region,
|
82
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
83
|
-
use_fips: context.config.use_fips_endpoint,
|
84
|
-
endpoint: endpoint,
|
85
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
86
|
-
)
|
87
|
-
end
|
16
|
+
def self.parameters_for_operation(context)
|
17
|
+
Aws::STS::EndpointParameters.create(context.config)
|
88
18
|
end
|
89
|
-
|
90
|
-
class GetCallerIdentity
|
91
|
-
def self.build(context)
|
92
|
-
unless context.config.regional_endpoint
|
93
|
-
endpoint = context.config.endpoint.to_s
|
94
|
-
end
|
95
|
-
Aws::STS::EndpointParameters.new(
|
96
|
-
region: context.config.region,
|
97
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
98
|
-
use_fips: context.config.use_fips_endpoint,
|
99
|
-
endpoint: endpoint,
|
100
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
101
|
-
)
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
class GetFederationToken
|
106
|
-
def self.build(context)
|
107
|
-
unless context.config.regional_endpoint
|
108
|
-
endpoint = context.config.endpoint.to_s
|
109
|
-
end
|
110
|
-
Aws::STS::EndpointParameters.new(
|
111
|
-
region: context.config.region,
|
112
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
113
|
-
use_fips: context.config.use_fips_endpoint,
|
114
|
-
endpoint: endpoint,
|
115
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
116
|
-
)
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
class GetSessionToken
|
121
|
-
def self.build(context)
|
122
|
-
unless context.config.regional_endpoint
|
123
|
-
endpoint = context.config.endpoint.to_s
|
124
|
-
end
|
125
|
-
Aws::STS::EndpointParameters.new(
|
126
|
-
region: context.config.region,
|
127
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
128
|
-
use_fips: context.config.use_fips_endpoint,
|
129
|
-
endpoint: endpoint,
|
130
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
131
|
-
)
|
132
|
-
end
|
133
|
-
end
|
134
|
-
|
135
19
|
end
|
136
20
|
end
|
data/lib/aws-sdk-sts/errors.rb
CHANGED
@@ -29,15 +29,21 @@ module Aws::STS
|
|
29
29
|
# ## Error Classes
|
30
30
|
# * {ExpiredTokenException}
|
31
31
|
# * {IDPCommunicationErrorException}
|
32
|
+
# * This error class is not used. `IDPCommunicationError` is used during parsing instead.
|
32
33
|
# * {IDPRejectedClaimException}
|
34
|
+
# * This error class is not used. `IDPRejectedClaim` is used during parsing instead.
|
33
35
|
# * {InvalidAuthorizationMessageException}
|
34
36
|
# * {InvalidIdentityTokenException}
|
37
|
+
# * This error class is not used. `InvalidIdentityToken` is used during parsing instead.
|
35
38
|
# * {MalformedPolicyDocumentException}
|
39
|
+
# * This error class is not used. `MalformedPolicyDocument` is used during parsing instead.
|
36
40
|
# * {PackedPolicyTooLargeException}
|
41
|
+
# * This error class is not used. `PackedPolicyTooLarge` is used during parsing instead.
|
37
42
|
# * {RegionDisabledException}
|
38
43
|
#
|
39
44
|
# Additionally, error classes are dynamically generated for service errors based on the error code
|
40
45
|
# if they are not defined above.
|
46
|
+
# Some existing error classes may use a different class name than the one documented.
|
41
47
|
module Errors
|
42
48
|
|
43
49
|
extend Aws::Errors::DynamicErrors
|
@@ -57,6 +63,8 @@ module Aws::STS
|
|
57
63
|
end
|
58
64
|
end
|
59
65
|
|
66
|
+
# @deprecated This error class is not used during parsing.
|
67
|
+
# Please use `IDPCommunicationError` instead.
|
60
68
|
class IDPCommunicationErrorException < ServiceError
|
61
69
|
|
62
70
|
# @param [Seahorse::Client::RequestContext] context
|
@@ -72,6 +80,8 @@ module Aws::STS
|
|
72
80
|
end
|
73
81
|
end
|
74
82
|
|
83
|
+
# @deprecated This error class is not used during parsing.
|
84
|
+
# Please use `IDPRejectedClaim` instead.
|
75
85
|
class IDPRejectedClaimException < ServiceError
|
76
86
|
|
77
87
|
# @param [Seahorse::Client::RequestContext] context
|
@@ -102,6 +112,8 @@ module Aws::STS
|
|
102
112
|
end
|
103
113
|
end
|
104
114
|
|
115
|
+
# @deprecated This error class is not used during parsing.
|
116
|
+
# Please use `InvalidIdentityToken` instead.
|
105
117
|
class InvalidIdentityTokenException < ServiceError
|
106
118
|
|
107
119
|
# @param [Seahorse::Client::RequestContext] context
|
@@ -117,6 +129,8 @@ module Aws::STS
|
|
117
129
|
end
|
118
130
|
end
|
119
131
|
|
132
|
+
# @deprecated This error class is not used during parsing.
|
133
|
+
# Please use `MalformedPolicyDocument` instead.
|
120
134
|
class MalformedPolicyDocumentException < ServiceError
|
121
135
|
|
122
136
|
# @param [Seahorse::Client::RequestContext] context
|
@@ -132,6 +146,8 @@ module Aws::STS
|
|
132
146
|
end
|
133
147
|
end
|
134
148
|
|
149
|
+
# @deprecated This error class is not used during parsing.
|
150
|
+
# Please use `PackedPolicyTooLarge` instead.
|
135
151
|
class PackedPolicyTooLargeException < ServiceError
|
136
152
|
|
137
153
|
# @param [Seahorse::Client::RequestContext] context
|
@@ -15,11 +15,11 @@ module Aws::STS
|
|
15
15
|
:endpoint_provider,
|
16
16
|
doc_type: 'Aws::STS::EndpointProvider',
|
17
17
|
rbs_type: 'untyped',
|
18
|
-
docstring:
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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::STS::EndpointParameters`.
|
22
|
+
DOCS
|
23
23
|
Aws::STS::EndpointProvider.new
|
24
24
|
end
|
25
25
|
|
@@ -27,7 +27,7 @@ module Aws::STS
|
|
27
27
|
class Handler < Seahorse::Client::Handler
|
28
28
|
def call(context)
|
29
29
|
unless context[:discovered_endpoint]
|
30
|
-
params = parameters_for_operation(context)
|
30
|
+
params = Aws::STS::Endpoints.parameters_for_operation(context)
|
31
31
|
endpoint = context.config.endpoint_provider.resolve_endpoint(params)
|
32
32
|
|
33
33
|
context.http_request.endpoint = endpoint.url
|
@@ -40,11 +40,23 @@ module Aws::STS
|
|
40
40
|
context[:auth_scheme] =
|
41
41
|
Aws::Endpoints.resolve_auth_scheme(context, endpoint)
|
42
42
|
|
43
|
-
@handler.call(context)
|
43
|
+
with_metrics(context) { @handler.call(context) }
|
44
44
|
end
|
45
45
|
|
46
46
|
private
|
47
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
|
+
|
48
60
|
def apply_endpoint_headers(context, headers)
|
49
61
|
headers.each do |key, values|
|
50
62
|
value = values
|
@@ -55,27 +67,6 @@ module Aws::STS
|
|
55
67
|
context.http_request.headers[key] = value
|
56
68
|
end
|
57
69
|
end
|
58
|
-
|
59
|
-
def parameters_for_operation(context)
|
60
|
-
case context.operation_name
|
61
|
-
when :assume_role
|
62
|
-
Aws::STS::Endpoints::AssumeRole.build(context)
|
63
|
-
when :assume_role_with_saml
|
64
|
-
Aws::STS::Endpoints::AssumeRoleWithSAML.build(context)
|
65
|
-
when :assume_role_with_web_identity
|
66
|
-
Aws::STS::Endpoints::AssumeRoleWithWebIdentity.build(context)
|
67
|
-
when :decode_authorization_message
|
68
|
-
Aws::STS::Endpoints::DecodeAuthorizationMessage.build(context)
|
69
|
-
when :get_access_key_info
|
70
|
-
Aws::STS::Endpoints::GetAccessKeyInfo.build(context)
|
71
|
-
when :get_caller_identity
|
72
|
-
Aws::STS::Endpoints::GetCallerIdentity.build(context)
|
73
|
-
when :get_federation_token
|
74
|
-
Aws::STS::Endpoints::GetFederationToken.build(context)
|
75
|
-
when :get_session_token
|
76
|
-
Aws::STS::Endpoints::GetSessionToken.build(context)
|
77
|
-
end
|
78
|
-
end
|
79
70
|
end
|
80
71
|
|
81
72
|
def add_handlers(handlers, _config)
|