aws-sdk-core 3.131.1 → 3.170.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 +275 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-core/arn.rb +13 -0
- data/lib/aws-sdk-core/binary/encode_handler.rb +12 -1
- data/lib/aws-sdk-core/credential_provider_chain.rb +6 -4
- data/lib/aws-sdk-core/endpoints/condition.rb +41 -0
- data/lib/aws-sdk-core/endpoints/endpoint.rb +17 -0
- data/lib/aws-sdk-core/endpoints/endpoint_rule.rb +75 -0
- data/lib/aws-sdk-core/endpoints/error_rule.rb +42 -0
- data/lib/aws-sdk-core/endpoints/function.rb +80 -0
- data/lib/aws-sdk-core/endpoints/matchers.rb +127 -0
- data/lib/aws-sdk-core/endpoints/reference.rb +31 -0
- data/lib/aws-sdk-core/endpoints/rule.rb +25 -0
- data/lib/aws-sdk-core/endpoints/rule_set.rb +52 -0
- data/lib/aws-sdk-core/endpoints/rules_provider.rb +37 -0
- data/lib/aws-sdk-core/endpoints/templater.rb +58 -0
- data/lib/aws-sdk-core/endpoints/tree_rule.rb +45 -0
- data/lib/aws-sdk-core/endpoints/url.rb +60 -0
- data/lib/aws-sdk-core/endpoints.rb +74 -0
- data/lib/aws-sdk-core/errors.rb +13 -0
- data/lib/aws-sdk-core/json/error_handler.rb +10 -1
- data/lib/aws-sdk-core/pageable_response.rb +7 -0
- data/lib/aws-sdk-core/plugins/bearer_authorization.rb +67 -0
- data/lib/aws-sdk-core/plugins/credentials_configuration.rb +24 -0
- data/lib/aws-sdk-core/plugins/endpoint_discovery.rb +6 -2
- data/lib/aws-sdk-core/plugins/jsonvalue_converter.rb +34 -6
- data/lib/aws-sdk-core/plugins/recursion_detection.rb +14 -3
- data/lib/aws-sdk-core/plugins/regional_endpoint.rb +5 -0
- data/lib/aws-sdk-core/plugins/retries/error_inspector.rb +2 -1
- data/lib/aws-sdk-core/plugins/sign.rb +200 -0
- data/lib/aws-sdk-core/plugins/signature_v2.rb +1 -0
- data/lib/aws-sdk-core/plugins/signature_v4.rb +13 -7
- data/lib/aws-sdk-core/refreshing_token.rb +71 -0
- data/lib/aws-sdk-core/rest/handler.rb +1 -1
- data/lib/aws-sdk-core/rest/request/headers.rb +2 -6
- data/lib/aws-sdk-core/shared_config.rb +76 -5
- data/lib/aws-sdk-core/sso_credentials.rb +79 -44
- data/lib/aws-sdk-core/sso_token_provider.rb +135 -0
- data/lib/aws-sdk-core/static_token_provider.rb +14 -0
- data/lib/aws-sdk-core/structure.rb +6 -4
- data/lib/aws-sdk-core/token.rb +31 -0
- data/lib/aws-sdk-core/token_provider.rb +15 -0
- data/lib/aws-sdk-core/token_provider_chain.rb +51 -0
- data/lib/aws-sdk-core/xml/error_handler.rb +7 -0
- data/lib/aws-sdk-core/xml/parser/engines/oga.rb +2 -0
- data/lib/aws-sdk-core.rb +14 -0
- data/lib/aws-sdk-sso/client.rb +51 -11
- data/lib/aws-sdk-sso/endpoint_parameters.rb +66 -0
- data/lib/aws-sdk-sso/endpoint_provider.rb +51 -0
- data/lib/aws-sdk-sso/endpoints.rb +71 -0
- data/lib/aws-sdk-sso/plugins/endpoints.rb +76 -0
- data/lib/aws-sdk-sso/types.rb +8 -43
- data/lib/aws-sdk-sso.rb +5 -1
- data/lib/aws-sdk-ssooidc/client.rb +606 -0
- data/lib/aws-sdk-ssooidc/client_api.rb +216 -0
- data/lib/aws-sdk-ssooidc/customizations.rb +1 -0
- data/lib/aws-sdk-ssooidc/endpoint_parameters.rb +66 -0
- data/lib/aws-sdk-ssooidc/endpoint_provider.rb +51 -0
- data/lib/aws-sdk-ssooidc/endpoints.rb +57 -0
- data/lib/aws-sdk-ssooidc/errors.rb +290 -0
- data/lib/aws-sdk-ssooidc/plugins/endpoints.rb +74 -0
- data/lib/aws-sdk-ssooidc/resource.rb +26 -0
- data/lib/aws-sdk-ssooidc/types.rb +502 -0
- data/lib/aws-sdk-ssooidc.rb +59 -0
- data/lib/aws-sdk-sts/client.rb +153 -134
- data/lib/aws-sdk-sts/endpoint_parameters.rb +78 -0
- data/lib/aws-sdk-sts/endpoint_provider.rb +109 -0
- data/lib/aws-sdk-sts/endpoints.rb +135 -0
- data/lib/aws-sdk-sts/plugins/endpoints.rb +84 -0
- data/lib/aws-sdk-sts/presigner.rb +13 -15
- data/lib/aws-sdk-sts/types.rb +79 -186
- data/lib/aws-sdk-sts.rb +5 -1
- data/lib/seahorse/client/async_base.rb +0 -1
- data/lib/seahorse/client/configuration.rb +2 -2
- data/lib/seahorse/client/h2/connection.rb +2 -5
- data/lib/seahorse/client/plugins/request_callback.rb +9 -9
- data/lib/seahorse/util.rb +4 -0
- metadata +47 -6
@@ -0,0 +1,109 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# WARNING ABOUT GENERATED CODE
|
4
|
+
#
|
5
|
+
# This file is generated. See the contributing guide for more information:
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
7
|
+
#
|
8
|
+
# WARNING ABOUT GENERATED CODE
|
9
|
+
|
10
|
+
module Aws::STS
|
11
|
+
class EndpointProvider
|
12
|
+
def resolve_endpoint(parameters)
|
13
|
+
region = parameters.region
|
14
|
+
use_dual_stack = parameters.use_dual_stack
|
15
|
+
use_fips = parameters.use_fips
|
16
|
+
endpoint = parameters.endpoint
|
17
|
+
use_global_endpoint = parameters.use_global_endpoint
|
18
|
+
if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
|
19
|
+
if Aws::Endpoints::Matchers.boolean_equals?(use_global_endpoint, true) && Aws::Endpoints::Matchers.boolean_equals?(use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, false) && Aws::Endpoints::Matchers.not(Aws::Endpoints::Matchers.set?(endpoint))
|
20
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "ap-northeast-1")
|
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"}]})
|
69
|
+
end
|
70
|
+
if Aws::Endpoints::Matchers.set?(endpoint) && (url = Aws::Endpoints::Matchers.parse_url(endpoint))
|
71
|
+
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
|
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: {})
|
78
|
+
end
|
79
|
+
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
80
|
+
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"))
|
81
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
82
|
+
end
|
83
|
+
raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
|
84
|
+
end
|
85
|
+
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
|
86
|
+
if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"))
|
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"
|
93
|
+
end
|
94
|
+
if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
95
|
+
if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
|
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"
|
99
|
+
end
|
100
|
+
if Aws::Endpoints::Matchers.string_equals?(region, "aws-global")
|
101
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"us-east-1", "signingName"=>"sts"}]})
|
102
|
+
end
|
103
|
+
return Aws::Endpoints::Endpoint.new(url: "https://sts.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
104
|
+
end
|
105
|
+
raise ArgumentError, 'No endpoint could be resolved'
|
106
|
+
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,135 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# WARNING ABOUT GENERATED CODE
|
4
|
+
#
|
5
|
+
# This file is generated. See the contributing guide for more information:
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
7
|
+
#
|
8
|
+
# WARNING ABOUT GENERATED CODE
|
9
|
+
|
10
|
+
|
11
|
+
module Aws::STS
|
12
|
+
module Endpoints
|
13
|
+
|
14
|
+
class AssumeRole
|
15
|
+
def self.build(context)
|
16
|
+
unless context.config.regional_endpoint
|
17
|
+
endpoint = context.config.endpoint.to_s
|
18
|
+
end
|
19
|
+
Aws::STS::EndpointParameters.new(
|
20
|
+
region: context.config.region,
|
21
|
+
use_dual_stack: context.config.use_dualstack_endpoint,
|
22
|
+
use_fips: context.config.use_fips_endpoint,
|
23
|
+
endpoint: endpoint,
|
24
|
+
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
25
|
+
)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
class AssumeRoleWithSAML
|
30
|
+
def self.build(context)
|
31
|
+
unless context.config.regional_endpoint
|
32
|
+
endpoint = context.config.endpoint.to_s
|
33
|
+
end
|
34
|
+
Aws::STS::EndpointParameters.new(
|
35
|
+
region: context.config.region,
|
36
|
+
use_dual_stack: context.config.use_dualstack_endpoint,
|
37
|
+
use_fips: context.config.use_fips_endpoint,
|
38
|
+
endpoint: endpoint,
|
39
|
+
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
40
|
+
)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class AssumeRoleWithWebIdentity
|
45
|
+
def self.build(context)
|
46
|
+
unless context.config.regional_endpoint
|
47
|
+
endpoint = context.config.endpoint.to_s
|
48
|
+
end
|
49
|
+
Aws::STS::EndpointParameters.new(
|
50
|
+
region: context.config.region,
|
51
|
+
use_dual_stack: context.config.use_dualstack_endpoint,
|
52
|
+
use_fips: context.config.use_fips_endpoint,
|
53
|
+
endpoint: endpoint,
|
54
|
+
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
55
|
+
)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
class DecodeAuthorizationMessage
|
60
|
+
def self.build(context)
|
61
|
+
unless context.config.regional_endpoint
|
62
|
+
endpoint = context.config.endpoint.to_s
|
63
|
+
end
|
64
|
+
Aws::STS::EndpointParameters.new(
|
65
|
+
region: context.config.region,
|
66
|
+
use_dual_stack: context.config.use_dualstack_endpoint,
|
67
|
+
use_fips: context.config.use_fips_endpoint,
|
68
|
+
endpoint: endpoint,
|
69
|
+
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
70
|
+
)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
class GetAccessKeyInfo
|
75
|
+
def self.build(context)
|
76
|
+
unless context.config.regional_endpoint
|
77
|
+
endpoint = context.config.endpoint.to_s
|
78
|
+
end
|
79
|
+
Aws::STS::EndpointParameters.new(
|
80
|
+
region: context.config.region,
|
81
|
+
use_dual_stack: context.config.use_dualstack_endpoint,
|
82
|
+
use_fips: context.config.use_fips_endpoint,
|
83
|
+
endpoint: endpoint,
|
84
|
+
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
85
|
+
)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
class GetCallerIdentity
|
90
|
+
def self.build(context)
|
91
|
+
unless context.config.regional_endpoint
|
92
|
+
endpoint = context.config.endpoint.to_s
|
93
|
+
end
|
94
|
+
Aws::STS::EndpointParameters.new(
|
95
|
+
region: context.config.region,
|
96
|
+
use_dual_stack: context.config.use_dualstack_endpoint,
|
97
|
+
use_fips: context.config.use_fips_endpoint,
|
98
|
+
endpoint: endpoint,
|
99
|
+
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
100
|
+
)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
class GetFederationToken
|
105
|
+
def self.build(context)
|
106
|
+
unless context.config.regional_endpoint
|
107
|
+
endpoint = context.config.endpoint.to_s
|
108
|
+
end
|
109
|
+
Aws::STS::EndpointParameters.new(
|
110
|
+
region: context.config.region,
|
111
|
+
use_dual_stack: context.config.use_dualstack_endpoint,
|
112
|
+
use_fips: context.config.use_fips_endpoint,
|
113
|
+
endpoint: endpoint,
|
114
|
+
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
115
|
+
)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
class GetSessionToken
|
120
|
+
def self.build(context)
|
121
|
+
unless context.config.regional_endpoint
|
122
|
+
endpoint = context.config.endpoint.to_s
|
123
|
+
end
|
124
|
+
Aws::STS::EndpointParameters.new(
|
125
|
+
region: context.config.region,
|
126
|
+
use_dual_stack: context.config.use_dualstack_endpoint,
|
127
|
+
use_fips: context.config.use_fips_endpoint,
|
128
|
+
endpoint: endpoint,
|
129
|
+
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
|
130
|
+
)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
end
|
135
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# WARNING ABOUT GENERATED CODE
|
4
|
+
#
|
5
|
+
# This file is generated. See the contributing guide for more information:
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
7
|
+
#
|
8
|
+
# WARNING ABOUT GENERATED CODE
|
9
|
+
|
10
|
+
|
11
|
+
module Aws::STS
|
12
|
+
module Plugins
|
13
|
+
class Endpoints < Seahorse::Client::Plugin
|
14
|
+
option(
|
15
|
+
:endpoint_provider,
|
16
|
+
doc_type: 'Aws::STS::EndpointProvider',
|
17
|
+
docstring: 'The endpoint provider used to resolve endpoints. Any '\
|
18
|
+
'object that responds to `#resolve_endpoint(parameters)` '\
|
19
|
+
'where `parameters` is a Struct similar to '\
|
20
|
+
'`Aws::STS::EndpointParameters`'
|
21
|
+
) do |cfg|
|
22
|
+
Aws::STS::EndpointProvider.new
|
23
|
+
end
|
24
|
+
|
25
|
+
# @api private
|
26
|
+
class Handler < Seahorse::Client::Handler
|
27
|
+
def call(context)
|
28
|
+
# If endpoint was discovered, do not resolve or apply the endpoint.
|
29
|
+
unless context[:discovered_endpoint]
|
30
|
+
params = parameters_for_operation(context)
|
31
|
+
endpoint = context.config.endpoint_provider.resolve_endpoint(params)
|
32
|
+
|
33
|
+
context.http_request.endpoint = endpoint.url
|
34
|
+
apply_endpoint_headers(context, endpoint.headers)
|
35
|
+
end
|
36
|
+
|
37
|
+
context[:endpoint_params] = params
|
38
|
+
context[:auth_scheme] =
|
39
|
+
Aws::Endpoints.resolve_auth_scheme(context, endpoint)
|
40
|
+
|
41
|
+
@handler.call(context)
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def apply_endpoint_headers(context, headers)
|
47
|
+
headers.each do |key, values|
|
48
|
+
value = values
|
49
|
+
.compact
|
50
|
+
.map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
|
51
|
+
.join(',')
|
52
|
+
|
53
|
+
context.http_request.headers[key] = value
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def parameters_for_operation(context)
|
58
|
+
case context.operation_name
|
59
|
+
when :assume_role
|
60
|
+
Aws::STS::Endpoints::AssumeRole.build(context)
|
61
|
+
when :assume_role_with_saml
|
62
|
+
Aws::STS::Endpoints::AssumeRoleWithSAML.build(context)
|
63
|
+
when :assume_role_with_web_identity
|
64
|
+
Aws::STS::Endpoints::AssumeRoleWithWebIdentity.build(context)
|
65
|
+
when :decode_authorization_message
|
66
|
+
Aws::STS::Endpoints::DecodeAuthorizationMessage.build(context)
|
67
|
+
when :get_access_key_info
|
68
|
+
Aws::STS::Endpoints::GetAccessKeyInfo.build(context)
|
69
|
+
when :get_caller_identity
|
70
|
+
Aws::STS::Endpoints::GetCallerIdentity.build(context)
|
71
|
+
when :get_federation_token
|
72
|
+
Aws::STS::Endpoints::GetFederationToken.build(context)
|
73
|
+
when :get_session_token
|
74
|
+
Aws::STS::Endpoints::GetSessionToken.build(context)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def add_handlers(handlers, _config)
|
80
|
+
handlers.add(Handler, step: :build, priority: 75)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -38,7 +38,8 @@ module Aws
|
|
38
38
|
# {https://ruby-doc.org/stdlib-2.3.1/libdoc/base64/rdoc/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
|
-
req = @client.build_request(:
|
41
|
+
req = @client.build_request(:get_caller_identity, {})
|
42
|
+
context = req.context
|
42
43
|
|
43
44
|
param_list = Aws::Query::ParamList.new
|
44
45
|
param_list.set('Action', 'GetCallerIdentity')
|
@@ -46,26 +47,23 @@ module Aws
|
|
46
47
|
Aws::Query::EC2ParamBuilder.new(param_list)
|
47
48
|
.apply(req.context.operation.input, {})
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
endpoint_params = 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
|
+
use_global_endpoint: context.config.sts_regional_endpoints == 'legacy'
|
53
55
|
)
|
56
|
+
endpoint = context.config.endpoint_provider
|
57
|
+
.resolve_endpoint(endpoint_params)
|
58
|
+
auth_scheme = Aws::Endpoints.resolve_auth_scheme(context, endpoint)
|
54
59
|
|
55
|
-
|
56
|
-
|
57
|
-
'sts',
|
58
|
-
req.context.config.sts_regional_endpoints,
|
59
|
-
{
|
60
|
-
dualstack: req.context.config.use_dualstack_endpoint,
|
61
|
-
fips: req.context.config.use_fips_endpoint
|
62
|
-
}
|
60
|
+
signer = Aws::Plugins::Sign.signer_for(
|
61
|
+
auth_scheme, context.config
|
63
62
|
)
|
64
|
-
url += "/?#{param_list}"
|
65
63
|
|
66
64
|
signer.presign_url(
|
67
65
|
http_method: 'GET',
|
68
|
-
url: url,
|
66
|
+
url: "#{endpoint.url}/?#{param_list}",
|
69
67
|
body: '',
|
70
68
|
headers: options[:headers]
|
71
69
|
).to_s
|