aws-sdk-core 3.209.0 → 3.211.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-core/assume_role_credentials.rb +8 -9
- data/lib/aws-sdk-core/assume_role_web_identity_credentials.rb +8 -9
- data/lib/aws-sdk-core/cbor.rb +3 -56
- data/lib/aws-sdk-core/client_stubs.rb +7 -7
- data/lib/aws-sdk-core/endpoints/matchers.rb +1 -8
- data/lib/aws-sdk-core/json/error_handler.rb +2 -1
- data/lib/aws-sdk-core/json/handler.rb +1 -0
- data/lib/aws-sdk-core/plugins/regional_endpoint.rb +44 -25
- data/lib/aws-sdk-core/plugins.rb +29 -1
- data/lib/aws-sdk-core/rest/request/headers.rb +2 -2
- data/lib/aws-sdk-core/rpc_v2/builder.rb +1 -1
- data/lib/aws-sdk-core/{cbor → rpc_v2}/cbor_engine.rb +4 -5
- data/lib/aws-sdk-core/rpc_v2/content_type_handler.rb +3 -1
- data/lib/aws-sdk-core/rpc_v2/error_handler.rb +3 -2
- data/lib/aws-sdk-core/rpc_v2/handler.rb +2 -1
- data/lib/aws-sdk-core/rpc_v2/parser.rb +1 -1
- data/lib/aws-sdk-core/rpc_v2.rb +65 -2
- 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 +13 -15
- data/lib/aws-sdk-core/stubbing.rb +2 -2
- data/lib/aws-sdk-core.rb +1 -0
- data/lib/aws-sdk-sso/client.rb +1 -1
- data/lib/aws-sdk-sso/endpoint_parameters.rb +9 -6
- data/lib/aws-sdk-sso/endpoints.rb +2 -42
- data/lib/aws-sdk-sso/plugins/endpoints.rb +1 -14
- data/lib/aws-sdk-sso.rb +1 -1
- data/lib/aws-sdk-ssooidc/client.rb +1 -1
- data/lib/aws-sdk-ssooidc/endpoint_parameters.rb +9 -6
- data/lib/aws-sdk-ssooidc/endpoints.rb +2 -42
- data/lib/aws-sdk-ssooidc/plugins/endpoints.rb +1 -14
- data/lib/aws-sdk-ssooidc.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +1 -1
- data/lib/aws-sdk-sts/endpoint_parameters.rb +10 -9
- data/lib/aws-sdk-sts/endpoints.rb +2 -94
- data/lib/aws-sdk-sts/plugins/endpoints.rb +1 -22
- data/lib/aws-sdk-sts.rb +1 -1
- metadata +5 -5
@@ -3,27 +3,28 @@
|
|
3
3
|
module Aws
|
4
4
|
module Stubbing
|
5
5
|
module Protocols
|
6
|
+
# @api private
|
6
7
|
class Json
|
7
8
|
|
8
9
|
def stub_data(api, operation, data)
|
9
10
|
resp = Seahorse::Client::Http::Response.new
|
10
11
|
resp.status_code = 200
|
11
|
-
resp.headers[
|
12
|
-
resp.headers[
|
12
|
+
resp.headers['Content-Type'] = content_type(api)
|
13
|
+
resp.headers['x-amzn-RequestId'] = 'stubbed-request-id'
|
13
14
|
resp.body = build_body(operation, data)
|
14
15
|
resp
|
15
16
|
end
|
16
17
|
|
17
18
|
def stub_error(error_code)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
{
|
22
|
-
|
23
|
-
|
24
|
-
}
|
19
|
+
resp = Seahorse::Client::Http::Response.new
|
20
|
+
resp.status_code = 400
|
21
|
+
resp.body = <<~JSON.strip
|
22
|
+
{
|
23
|
+
"code": #{error_code.inspect},
|
24
|
+
"message": "stubbed-response-error-message"
|
25
|
+
}
|
25
26
|
JSON
|
26
|
-
|
27
|
+
resp
|
27
28
|
end
|
28
29
|
|
29
30
|
private
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module Aws
|
4
4
|
module Stubbing
|
5
5
|
module Protocols
|
6
|
+
# @api private
|
6
7
|
class Query
|
7
8
|
|
8
9
|
def stub_data(api, operation, data)
|
@@ -13,10 +14,10 @@ module Aws
|
|
13
14
|
end
|
14
15
|
|
15
16
|
def stub_error(error_code)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
resp = Seahorse::Client::Http::Response.new
|
18
|
+
resp.status_code = 400
|
19
|
+
resp.body = XmlError.new(error_code).to_xml
|
20
|
+
resp
|
20
21
|
end
|
21
22
|
|
22
23
|
private
|
@@ -24,9 +25,9 @@ module Aws
|
|
24
25
|
def build_body(api, operation, data)
|
25
26
|
xml = []
|
26
27
|
builder = Aws::Xml::DocBuilder.new(target: xml, indent: ' ')
|
27
|
-
builder.node(operation.name
|
28
|
+
builder.node("#{operation.name}Response", xmlns: xmlns(api)) do
|
28
29
|
if (rules = operation.output)
|
29
|
-
rules.location_name = operation.name
|
30
|
+
rules.location_name = "#{operation.name}Result"
|
30
31
|
Xml::Builder.new(rules, target: xml, pad:' ').to_xml(data)
|
31
32
|
end
|
32
33
|
builder.node('ResponseMetadata') do
|
@@ -5,6 +5,7 @@ require 'aws-eventstream'
|
|
5
5
|
module Aws
|
6
6
|
module Stubbing
|
7
7
|
module Protocols
|
8
|
+
# @api private
|
8
9
|
class Rest
|
9
10
|
|
10
11
|
include Seahorse::Model::Shapes
|
@@ -22,7 +23,7 @@ module Aws
|
|
22
23
|
def new_http_response
|
23
24
|
resp = Seahorse::Client::Http::Response.new
|
24
25
|
resp.status_code = 200
|
25
|
-
resp.headers[
|
26
|
+
resp.headers['x-amzn-RequestId'] = 'stubbed-request-id'
|
26
27
|
resp
|
27
28
|
end
|
28
29
|
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module Aws
|
4
4
|
module Stubbing
|
5
5
|
module Protocols
|
6
|
+
# @api private
|
6
7
|
class RestJson < Rest
|
7
8
|
|
8
9
|
def body_for(_a, _b, rules, data)
|
@@ -14,15 +15,15 @@ module Aws
|
|
14
15
|
end
|
15
16
|
|
16
17
|
def stub_error(error_code)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
{
|
21
|
-
|
22
|
-
|
23
|
-
}
|
18
|
+
resp = Seahorse::Client::Http::Response.new
|
19
|
+
resp.status_code = 400
|
20
|
+
resp.body = <<~JSON.strip
|
21
|
+
{
|
22
|
+
"code": #{error_code.inspect},
|
23
|
+
"message": "stubbed-response-error-message"
|
24
|
+
}
|
24
25
|
JSON
|
25
|
-
|
26
|
+
resp
|
26
27
|
end
|
27
28
|
|
28
29
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module Aws
|
4
4
|
module Stubbing
|
5
5
|
module Protocols
|
6
|
+
# @api private
|
6
7
|
class RestXml < Rest
|
7
8
|
|
8
9
|
def body_for(api, operation, rules, data)
|
@@ -10,7 +11,7 @@ module Aws
|
|
10
11
|
encode_eventstream_response(rules, data, Xml::Builder)
|
11
12
|
else
|
12
13
|
xml = []
|
13
|
-
rules.location_name = operation.name
|
14
|
+
rules.location_name = "#{operation.name}Result"
|
14
15
|
rules['xmlNamespace'] = { 'uri' => api.metadata['xmlNamespace'] }
|
15
16
|
Xml::Builder.new(rules, target:xml).to_xml(data)
|
16
17
|
xml.join
|
@@ -18,10 +19,10 @@ module Aws
|
|
18
19
|
end
|
19
20
|
|
20
21
|
def stub_error(error_code)
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
resp = Seahorse::Client::Http::Response.new
|
23
|
+
resp.status_code = 400
|
24
|
+
resp.body = XmlError.new(error_code).to_xml
|
25
|
+
resp
|
25
26
|
end
|
26
27
|
|
27
28
|
def xmlns(api)
|
@@ -3,35 +3,33 @@
|
|
3
3
|
module Aws
|
4
4
|
module Stubbing
|
5
5
|
module Protocols
|
6
|
+
# @api private
|
6
7
|
class RpcV2
|
7
8
|
|
8
|
-
def stub_data(
|
9
|
+
def stub_data(_api, operation, data)
|
9
10
|
resp = Seahorse::Client::Http::Response.new
|
10
11
|
resp.status_code = 200
|
11
|
-
resp.headers['
|
12
|
+
resp.headers['Smithy-Protocol'] = 'rpc-v2-cbor'
|
13
|
+
resp.headers['Content-Type'] = 'application/cbor'
|
12
14
|
resp.headers['x-amzn-RequestId'] = 'stubbed-request-id'
|
13
15
|
resp.body = build_body(operation, data)
|
14
16
|
resp
|
15
17
|
end
|
16
18
|
|
17
19
|
def stub_error(error_code)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
{
|
22
|
-
|
23
|
-
|
24
|
-
}
|
25
|
-
|
26
|
-
|
20
|
+
resp = Seahorse::Client::Http::Response.new
|
21
|
+
resp.status_code = 400
|
22
|
+
resp.body = Aws::RpcV2.encode(
|
23
|
+
{
|
24
|
+
'code' => error_code,
|
25
|
+
'message' => 'stubbed-response-error-message'
|
26
|
+
}
|
27
|
+
)
|
28
|
+
resp
|
27
29
|
end
|
28
30
|
|
29
31
|
private
|
30
32
|
|
31
|
-
def content_type(api)
|
32
|
-
'application/cbor'
|
33
|
-
end
|
34
|
-
|
35
33
|
def build_body(operation, data)
|
36
34
|
Aws::RpcV2::Builder.new(operation.output).serialize(data)
|
37
35
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Aws
|
4
|
-
#
|
4
|
+
# @api private
|
5
5
|
module Stubbing
|
6
6
|
autoload :EmptyStub, 'aws-sdk-core/stubbing/empty_stub'
|
7
7
|
autoload :DataApplicator, 'aws-sdk-core/stubbing/data_applicator'
|
@@ -19,4 +19,4 @@ module Aws
|
|
19
19
|
autoload :ApiGateway, 'aws-sdk-core/stubbing/protocols/api_gateway'
|
20
20
|
end
|
21
21
|
end
|
22
|
-
end
|
22
|
+
end
|
data/lib/aws-sdk-core.rb
CHANGED
data/lib/aws-sdk-sso/client.rb
CHANGED
@@ -52,15 +52,18 @@ module Aws::SSO
|
|
52
52
|
self[:region] = options[:region]
|
53
53
|
self[:use_dual_stack] = options[:use_dual_stack]
|
54
54
|
self[:use_dual_stack] = false if self[:use_dual_stack].nil?
|
55
|
-
if self[:use_dual_stack].nil?
|
56
|
-
raise ArgumentError, "Missing required EndpointParameter: :use_dual_stack"
|
57
|
-
end
|
58
55
|
self[:use_fips] = options[:use_fips]
|
59
56
|
self[:use_fips] = false if self[:use_fips].nil?
|
60
|
-
if self[:use_fips].nil?
|
61
|
-
raise ArgumentError, "Missing required EndpointParameter: :use_fips"
|
62
|
-
end
|
63
57
|
self[:endpoint] = options[:endpoint]
|
64
58
|
end
|
59
|
+
|
60
|
+
def self.create(config, options={})
|
61
|
+
new({
|
62
|
+
region: config.region,
|
63
|
+
use_dual_stack: config.use_dualstack_endpoint,
|
64
|
+
use_fips: config.use_fips_endpoint,
|
65
|
+
endpoint: (config.endpoint.to_s unless config.regional_endpoint),
|
66
|
+
}.merge(options))
|
67
|
+
end
|
65
68
|
end
|
66
69
|
end
|
@@ -12,49 +12,9 @@ module Aws::SSO
|
|
12
12
|
# @api private
|
13
13
|
module Endpoints
|
14
14
|
|
15
|
-
class GetRoleCredentials
|
16
|
-
def self.build(context)
|
17
|
-
Aws::SSO::EndpointParameters.new(
|
18
|
-
region: context.config.region,
|
19
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
20
|
-
use_fips: context.config.use_fips_endpoint,
|
21
|
-
endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
22
|
-
)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
class ListAccountRoles
|
27
|
-
def self.build(context)
|
28
|
-
Aws::SSO::EndpointParameters.new(
|
29
|
-
region: context.config.region,
|
30
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
31
|
-
use_fips: context.config.use_fips_endpoint,
|
32
|
-
endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
33
|
-
)
|
34
|
-
end
|
35
|
-
end
|
36
15
|
|
37
|
-
|
38
|
-
|
39
|
-
Aws::SSO::EndpointParameters.new(
|
40
|
-
region: context.config.region,
|
41
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
42
|
-
use_fips: context.config.use_fips_endpoint,
|
43
|
-
endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
44
|
-
)
|
45
|
-
end
|
16
|
+
def self.parameters_for_operation(context)
|
17
|
+
Aws::SSO::EndpointParameters.create(context.config)
|
46
18
|
end
|
47
|
-
|
48
|
-
class Logout
|
49
|
-
def self.build(context)
|
50
|
-
Aws::SSO::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: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
55
|
-
)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
19
|
end
|
60
20
|
end
|
@@ -27,7 +27,7 @@ The endpoint provider used to resolve endpoints. Any object that responds to
|
|
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::SSO::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
|
@@ -67,19 +67,6 @@ The endpoint provider used to resolve endpoints. Any object that responds to
|
|
67
67
|
context.http_request.headers[key] = value
|
68
68
|
end
|
69
69
|
end
|
70
|
-
|
71
|
-
def parameters_for_operation(context)
|
72
|
-
case context.operation_name
|
73
|
-
when :get_role_credentials
|
74
|
-
Aws::SSO::Endpoints::GetRoleCredentials.build(context)
|
75
|
-
when :list_account_roles
|
76
|
-
Aws::SSO::Endpoints::ListAccountRoles.build(context)
|
77
|
-
when :list_accounts
|
78
|
-
Aws::SSO::Endpoints::ListAccounts.build(context)
|
79
|
-
when :logout
|
80
|
-
Aws::SSO::Endpoints::Logout.build(context)
|
81
|
-
end
|
82
|
-
end
|
83
70
|
end
|
84
71
|
|
85
72
|
def add_handlers(handlers, _config)
|
data/lib/aws-sdk-sso.rb
CHANGED
@@ -52,15 +52,18 @@ module Aws::SSOOIDC
|
|
52
52
|
self[:region] = options[:region]
|
53
53
|
self[:use_dual_stack] = options[:use_dual_stack]
|
54
54
|
self[:use_dual_stack] = false if self[:use_dual_stack].nil?
|
55
|
-
if self[:use_dual_stack].nil?
|
56
|
-
raise ArgumentError, "Missing required EndpointParameter: :use_dual_stack"
|
57
|
-
end
|
58
55
|
self[:use_fips] = options[:use_fips]
|
59
56
|
self[:use_fips] = false if self[:use_fips].nil?
|
60
|
-
if self[:use_fips].nil?
|
61
|
-
raise ArgumentError, "Missing required EndpointParameter: :use_fips"
|
62
|
-
end
|
63
57
|
self[:endpoint] = options[:endpoint]
|
64
58
|
end
|
59
|
+
|
60
|
+
def self.create(config, options={})
|
61
|
+
new({
|
62
|
+
region: config.region,
|
63
|
+
use_dual_stack: config.use_dualstack_endpoint,
|
64
|
+
use_fips: config.use_fips_endpoint,
|
65
|
+
endpoint: (config.endpoint.to_s unless config.regional_endpoint),
|
66
|
+
}.merge(options))
|
67
|
+
end
|
65
68
|
end
|
66
69
|
end
|
@@ -12,49 +12,9 @@ module Aws::SSOOIDC
|
|
12
12
|
# @api private
|
13
13
|
module Endpoints
|
14
14
|
|
15
|
-
class CreateToken
|
16
|
-
def self.build(context)
|
17
|
-
Aws::SSOOIDC::EndpointParameters.new(
|
18
|
-
region: context.config.region,
|
19
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
20
|
-
use_fips: context.config.use_fips_endpoint,
|
21
|
-
endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
22
|
-
)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
class CreateTokenWithIAM
|
27
|
-
def self.build(context)
|
28
|
-
Aws::SSOOIDC::EndpointParameters.new(
|
29
|
-
region: context.config.region,
|
30
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
31
|
-
use_fips: context.config.use_fips_endpoint,
|
32
|
-
endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
33
|
-
)
|
34
|
-
end
|
35
|
-
end
|
36
15
|
|
37
|
-
|
38
|
-
|
39
|
-
Aws::SSOOIDC::EndpointParameters.new(
|
40
|
-
region: context.config.region,
|
41
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
42
|
-
use_fips: context.config.use_fips_endpoint,
|
43
|
-
endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
44
|
-
)
|
45
|
-
end
|
16
|
+
def self.parameters_for_operation(context)
|
17
|
+
Aws::SSOOIDC::EndpointParameters.create(context.config)
|
46
18
|
end
|
47
|
-
|
48
|
-
class StartDeviceAuthorization
|
49
|
-
def self.build(context)
|
50
|
-
Aws::SSOOIDC::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: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
55
|
-
)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
19
|
end
|
60
20
|
end
|
@@ -27,7 +27,7 @@ The endpoint provider used to resolve endpoints. Any object that responds to
|
|
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::SSOOIDC::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
|
@@ -67,19 +67,6 @@ The endpoint provider used to resolve endpoints. Any object that responds to
|
|
67
67
|
context.http_request.headers[key] = value
|
68
68
|
end
|
69
69
|
end
|
70
|
-
|
71
|
-
def parameters_for_operation(context)
|
72
|
-
case context.operation_name
|
73
|
-
when :create_token
|
74
|
-
Aws::SSOOIDC::Endpoints::CreateToken.build(context)
|
75
|
-
when :create_token_with_iam
|
76
|
-
Aws::SSOOIDC::Endpoints::CreateTokenWithIAM.build(context)
|
77
|
-
when :register_client
|
78
|
-
Aws::SSOOIDC::Endpoints::RegisterClient.build(context)
|
79
|
-
when :start_device_authorization
|
80
|
-
Aws::SSOOIDC::Endpoints::StartDeviceAuthorization.build(context)
|
81
|
-
end
|
82
|
-
end
|
83
70
|
end
|
84
71
|
|
85
72
|
def add_handlers(handlers, _config)
|
data/lib/aws-sdk-ssooidc.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
@@ -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
|
@@ -12,101 +12,9 @@ module Aws::STS
|
|
12
12
|
# @api private
|
13
13
|
module Endpoints
|
14
14
|
|
15
|
-
class AssumeRole
|
16
|
-
def self.build(context)
|
17
|
-
Aws::STS::EndpointParameters.new(
|
18
|
-
region: context.config.region,
|
19
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
20
|
-
use_fips: context.config.use_fips_endpoint,
|
21
|
-
endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
22
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
23
|
-
)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
class AssumeRoleWithSAML
|
28
|
-
def self.build(context)
|
29
|
-
Aws::STS::EndpointParameters.new(
|
30
|
-
region: context.config.region,
|
31
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
32
|
-
use_fips: context.config.use_fips_endpoint,
|
33
|
-
endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
34
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
35
|
-
)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
class AssumeRoleWithWebIdentity
|
40
|
-
def self.build(context)
|
41
|
-
Aws::STS::EndpointParameters.new(
|
42
|
-
region: context.config.region,
|
43
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
44
|
-
use_fips: context.config.use_fips_endpoint,
|
45
|
-
endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
46
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
47
|
-
)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
class DecodeAuthorizationMessage
|
52
|
-
def self.build(context)
|
53
|
-
Aws::STS::EndpointParameters.new(
|
54
|
-
region: context.config.region,
|
55
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
56
|
-
use_fips: context.config.use_fips_endpoint,
|
57
|
-
endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
58
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
59
|
-
)
|
60
|
-
end
|
61
|
-
end
|
62
15
|
|
63
|
-
|
64
|
-
|
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: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
70
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
71
|
-
)
|
72
|
-
end
|
16
|
+
def self.parameters_for_operation(context)
|
17
|
+
Aws::STS::EndpointParameters.create(context.config)
|
73
18
|
end
|
74
|
-
|
75
|
-
class GetCallerIdentity
|
76
|
-
def self.build(context)
|
77
|
-
Aws::STS::EndpointParameters.new(
|
78
|
-
region: context.config.region,
|
79
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
80
|
-
use_fips: context.config.use_fips_endpoint,
|
81
|
-
endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
82
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
83
|
-
)
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
class GetFederationToken
|
88
|
-
def self.build(context)
|
89
|
-
Aws::STS::EndpointParameters.new(
|
90
|
-
region: context.config.region,
|
91
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
92
|
-
use_fips: context.config.use_fips_endpoint,
|
93
|
-
endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
94
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
95
|
-
)
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
class GetSessionToken
|
100
|
-
def self.build(context)
|
101
|
-
Aws::STS::EndpointParameters.new(
|
102
|
-
region: context.config.region,
|
103
|
-
use_dual_stack: context.config.use_dualstack_endpoint,
|
104
|
-
use_fips: context.config.use_fips_endpoint,
|
105
|
-
endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
|
106
|
-
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
107
|
-
)
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
19
|
end
|
112
20
|
end
|
@@ -27,7 +27,7 @@ The endpoint provider used to resolve endpoints. Any object that responds to
|
|
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
|
@@ -67,27 +67,6 @@ The endpoint provider used to resolve endpoints. Any object that responds to
|
|
67
67
|
context.http_request.headers[key] = value
|
68
68
|
end
|
69
69
|
end
|
70
|
-
|
71
|
-
def parameters_for_operation(context)
|
72
|
-
case context.operation_name
|
73
|
-
when :assume_role
|
74
|
-
Aws::STS::Endpoints::AssumeRole.build(context)
|
75
|
-
when :assume_role_with_saml
|
76
|
-
Aws::STS::Endpoints::AssumeRoleWithSAML.build(context)
|
77
|
-
when :assume_role_with_web_identity
|
78
|
-
Aws::STS::Endpoints::AssumeRoleWithWebIdentity.build(context)
|
79
|
-
when :decode_authorization_message
|
80
|
-
Aws::STS::Endpoints::DecodeAuthorizationMessage.build(context)
|
81
|
-
when :get_access_key_info
|
82
|
-
Aws::STS::Endpoints::GetAccessKeyInfo.build(context)
|
83
|
-
when :get_caller_identity
|
84
|
-
Aws::STS::Endpoints::GetCallerIdentity.build(context)
|
85
|
-
when :get_federation_token
|
86
|
-
Aws::STS::Endpoints::GetFederationToken.build(context)
|
87
|
-
when :get_session_token
|
88
|
-
Aws::STS::Endpoints::GetSessionToken.build(context)
|
89
|
-
end
|
90
|
-
end
|
91
70
|
end
|
92
71
|
|
93
72
|
def add_handlers(handlers, _config)
|