aws-sdk-core 3.160.0 → 3.166.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 +48 -2
- 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/endpoints/condition.rb +36 -0
- data/lib/aws-sdk-core/endpoints/endpoint.rb +17 -0
- data/lib/aws-sdk-core/endpoints/endpoint_rule.rb +71 -0
- data/lib/aws-sdk-core/endpoints/error_rule.rb +37 -0
- data/lib/aws-sdk-core/endpoints/function.rb +75 -0
- data/lib/aws-sdk-core/endpoints/matchers.rb +127 -0
- data/lib/aws-sdk-core/endpoints/reference.rb +26 -0
- data/lib/aws-sdk-core/endpoints/rule.rb +20 -0
- data/lib/aws-sdk-core/endpoints/rule_set.rb +47 -0
- data/lib/aws-sdk-core/endpoints/rules_provider.rb +32 -0
- data/lib/aws-sdk-core/endpoints/templater.rb +52 -0
- data/lib/aws-sdk-core/endpoints/tree_rule.rb +40 -0
- data/lib/aws-sdk-core/endpoints/url.rb +59 -0
- data/lib/aws-sdk-core/endpoints.rb +74 -0
- data/lib/aws-sdk-core/json/error_handler.rb +10 -1
- 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/regional_endpoint.rb +5 -0
- data/lib/aws-sdk-core/plugins/sign.rb +190 -0
- data/lib/aws-sdk-core/plugins/signature_v2.rb +1 -0
- data/lib/aws-sdk-core/plugins/signature_v4.rb +1 -0
- data/lib/aws-sdk-core/rest/request/headers.rb +2 -6
- data/lib/aws-sdk-core.rb +4 -0
- data/lib/aws-sdk-sso/client.rb +20 -3
- data/lib/aws-sdk-sso/endpoint_parameters.rb +66 -0
- data/lib/aws-sdk-sso/endpoint_provider.rb +112 -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.rb +5 -1
- data/lib/aws-sdk-ssooidc/client.rb +20 -3
- data/lib/aws-sdk-ssooidc/endpoint_parameters.rb +66 -0
- data/lib/aws-sdk-ssooidc/endpoint_provider.rb +111 -0
- data/lib/aws-sdk-ssooidc/endpoints.rb +57 -0
- data/lib/aws-sdk-ssooidc/plugins/endpoints.rb +74 -0
- data/lib/aws-sdk-ssooidc.rb +5 -1
- data/lib/aws-sdk-sts/client.rb +20 -3
- data/lib/aws-sdk-sts/endpoint_parameters.rb +78 -0
- data/lib/aws-sdk-sts/endpoint_provider.rb +229 -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.rb +5 -1
- data/lib/seahorse/client/async_base.rb +0 -1
- data/lib/seahorse/client/configuration.rb +2 -2
- data/lib/seahorse/util.rb +4 -0
- metadata +33 -6
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
module Endpoints
|
5
|
+
# @api private
|
6
|
+
class TreeRule
|
7
|
+
def initialize(type: 'tree', conditions:, rules:, documentation: nil)
|
8
|
+
@type = type
|
9
|
+
@conditions = Condition.from_json(conditions)
|
10
|
+
@rules = RuleSet.rules_from_json(rules)
|
11
|
+
@documentation = documentation
|
12
|
+
end
|
13
|
+
|
14
|
+
attr_reader :type
|
15
|
+
attr_reader :conditions
|
16
|
+
attr_reader :error
|
17
|
+
attr_reader :documentation
|
18
|
+
|
19
|
+
def match(parameters, assigned = {})
|
20
|
+
assigns = assigned.dup
|
21
|
+
matched = conditions.all? do |condition|
|
22
|
+
output = condition.match?(parameters, assigns)
|
23
|
+
assigns = assigns.merge(condition.assigned) if condition.assign
|
24
|
+
output
|
25
|
+
end
|
26
|
+
resolve_rules(parameters, assigns) if matched
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def resolve_rules(parameters, assigns)
|
32
|
+
@rules.each do |rule|
|
33
|
+
output = rule.match(parameters, assigns)
|
34
|
+
return output if output
|
35
|
+
end
|
36
|
+
nil
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ipaddr'
|
4
|
+
|
5
|
+
module Aws
|
6
|
+
module Endpoints
|
7
|
+
# @api private
|
8
|
+
class URL
|
9
|
+
def initialize(url)
|
10
|
+
uri = URI(url)
|
11
|
+
@scheme = uri.scheme
|
12
|
+
# only support http and https schemes
|
13
|
+
raise ArgumentError unless %w[https http].include?(@scheme)
|
14
|
+
|
15
|
+
# do not support query
|
16
|
+
raise ArgumentError if uri.query
|
17
|
+
|
18
|
+
@authority = _authority(url, uri)
|
19
|
+
@path = uri.path
|
20
|
+
@normalized_path = uri.path + (uri.path[-1] == '/' ? '' : '/')
|
21
|
+
@is_ip = _is_ip(uri.host)
|
22
|
+
end
|
23
|
+
|
24
|
+
attr_reader :scheme
|
25
|
+
attr_reader :authority
|
26
|
+
attr_reader :path
|
27
|
+
attr_reader :normalized_path
|
28
|
+
attr_reader :is_ip
|
29
|
+
|
30
|
+
def as_json(_options = {})
|
31
|
+
{
|
32
|
+
'scheme' => scheme,
|
33
|
+
'authority' => authority,
|
34
|
+
'path' => path,
|
35
|
+
'normalizedPath' => normalized_path,
|
36
|
+
'isIp' => is_ip
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def _authority(url, uri)
|
43
|
+
# don't include port if it's default and not parsed originally
|
44
|
+
if uri.default_port == uri.port && !url.include?(":#{uri.port}")
|
45
|
+
uri.host
|
46
|
+
else
|
47
|
+
"#{uri.host}:#{uri.port}"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def _is_ip(authority)
|
52
|
+
IPAddr.new(authority)
|
53
|
+
true
|
54
|
+
rescue IPAddr::InvalidAddressError
|
55
|
+
false
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'endpoints/rule'
|
4
|
+
require_relative 'endpoints/condition'
|
5
|
+
require_relative 'endpoints/endpoint_rule'
|
6
|
+
require_relative 'endpoints/endpoint'
|
7
|
+
require_relative 'endpoints/error_rule'
|
8
|
+
require_relative 'endpoints/function'
|
9
|
+
require_relative 'endpoints/matchers'
|
10
|
+
require_relative 'endpoints/reference'
|
11
|
+
require_relative 'endpoints/rules_provider'
|
12
|
+
require_relative 'endpoints/rule_set'
|
13
|
+
require_relative 'endpoints/templater'
|
14
|
+
require_relative 'endpoints/tree_rule'
|
15
|
+
require_relative 'endpoints/url'
|
16
|
+
|
17
|
+
module Aws
|
18
|
+
# @api private
|
19
|
+
module Endpoints
|
20
|
+
class << self
|
21
|
+
def resolve_auth_scheme(context, endpoint)
|
22
|
+
if endpoint && (auth_schemes = endpoint.properties['authSchemes'])
|
23
|
+
auth_scheme = auth_schemes.find do |scheme|
|
24
|
+
Aws::Plugins::Sign::SUPPORTED_AUTH_TYPES.include?(scheme['name'])
|
25
|
+
end
|
26
|
+
raise 'No supported auth scheme for this endpoint.' unless auth_scheme
|
27
|
+
|
28
|
+
merge_signing_defaults(auth_scheme, context.config)
|
29
|
+
else
|
30
|
+
default_auth_scheme(context)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def default_auth_scheme(context)
|
37
|
+
case default_api_authtype(context)
|
38
|
+
when 'v4', 'v4-unsigned-body'
|
39
|
+
auth_scheme = { 'name' => 'sigv4' }
|
40
|
+
merge_signing_defaults(auth_scheme, context.config)
|
41
|
+
when 's3', 's3v4'
|
42
|
+
auth_scheme = { 'name' => 'sigv4', 'disableDoubleEncoding' => true }
|
43
|
+
merge_signing_defaults(auth_scheme, context.config)
|
44
|
+
when 'bearer'
|
45
|
+
{ 'name' => 'bearer' }
|
46
|
+
when 'none', nil
|
47
|
+
{ 'name' => 'none' }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def merge_signing_defaults(auth_scheme, config)
|
52
|
+
if %w[sigv4 sigv4a].include?(auth_scheme['name'])
|
53
|
+
auth_scheme['signingName'] ||= sigv4_name(config)
|
54
|
+
if auth_scheme['name'] == 'sigv4a'
|
55
|
+
auth_scheme['signingRegionSet'] ||= ['*']
|
56
|
+
else
|
57
|
+
auth_scheme['signingRegion'] ||= config.region
|
58
|
+
end
|
59
|
+
end
|
60
|
+
auth_scheme
|
61
|
+
end
|
62
|
+
|
63
|
+
def default_api_authtype(context)
|
64
|
+
context.config.api.operation(context.operation_name)['authtype'] ||
|
65
|
+
context.config.api.metadata['signatureVersion']
|
66
|
+
end
|
67
|
+
|
68
|
+
def sigv4_name(config)
|
69
|
+
config.api.metadata['signingName'] ||
|
70
|
+
config.api.metadata['endpointPrefix']
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -26,7 +26,11 @@ module Aws
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def error_code(json, context)
|
29
|
-
code =
|
29
|
+
code = if aws_query_error?(context)
|
30
|
+
context.http_response.headers['x-amzn-query-error'].split(';')[0]
|
31
|
+
else
|
32
|
+
json['__type']
|
33
|
+
end
|
30
34
|
code ||= json['code']
|
31
35
|
code ||= context.http_response.headers['x-amzn-errortype']
|
32
36
|
if code
|
@@ -36,6 +40,11 @@ module Aws
|
|
36
40
|
end
|
37
41
|
end
|
38
42
|
|
43
|
+
def aws_query_error?(context)
|
44
|
+
context.config.api.metadata['awsQueryCompatible'] &&
|
45
|
+
context.http_response.headers['x-amzn-query-error']
|
46
|
+
end
|
47
|
+
|
39
48
|
def error_message(code, json)
|
40
49
|
if code == 'RequestEntityTooLarge'
|
41
50
|
'Request body must be less than 1 MB'
|
@@ -76,6 +76,30 @@ locations will be searched for credentials:
|
|
76
76
|
|
77
77
|
option(:instance_profile_credentials_timeout, 1)
|
78
78
|
|
79
|
+
option(:token_provider,
|
80
|
+
required: false,
|
81
|
+
doc_type: 'Aws::TokenProvider',
|
82
|
+
docstring: <<-DOCS
|
83
|
+
A Bearer Token Provider. This can be an instance of any one of the
|
84
|
+
following classes:
|
85
|
+
|
86
|
+
* `Aws::StaticTokenProvider` - Used for configuring static, non-refreshing
|
87
|
+
tokens.
|
88
|
+
|
89
|
+
* `Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an
|
90
|
+
access token generated from `aws login`.
|
91
|
+
|
92
|
+
When `:token_provider` is not configured directly, the `Aws::TokenProviderChain`
|
93
|
+
will be used to search for tokens configured for your profile in shared configuration files.
|
94
|
+
DOCS
|
95
|
+
) do |config|
|
96
|
+
if config.stub_responses
|
97
|
+
StaticTokenProvider.new('token')
|
98
|
+
else
|
99
|
+
TokenProviderChain.new(config).resolve
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
79
103
|
end
|
80
104
|
end
|
81
105
|
end
|
@@ -72,7 +72,11 @@ the background every 60 secs (default). Defaults to `false`.
|
|
72
72
|
context,
|
73
73
|
Aws::Util.str_2_bool(discovery_cfg["required"])
|
74
74
|
)
|
75
|
-
|
75
|
+
if endpoint
|
76
|
+
context.http_request.endpoint = _valid_uri(endpoint.address)
|
77
|
+
# Skips dynamic endpoint usage, use this endpoint instead
|
78
|
+
context[:discovered_endpoint] = true
|
79
|
+
end
|
76
80
|
if endpoint || context.config.endpoint_discovery
|
77
81
|
_apply_endpoint_discovery_user_agent(context)
|
78
82
|
end
|
@@ -100,7 +104,7 @@ the background every 60 secs (default). Defaults to `false`.
|
|
100
104
|
end
|
101
105
|
|
102
106
|
def _discover_endpoint(ctx, required)
|
103
|
-
cache = ctx.config.endpoint_cache
|
107
|
+
cache = ctx.config.endpoint_cache
|
104
108
|
key = cache.extract_key(ctx)
|
105
109
|
|
106
110
|
if required
|
@@ -43,8 +43,13 @@ is set to `true`.
|
|
43
43
|
resolve_use_fips_endpoint(cfg)
|
44
44
|
end
|
45
45
|
|
46
|
+
# This option signals whether :endpoint was provided or not.
|
47
|
+
# Legacy endpoints must continue to be generated at client time.
|
46
48
|
option(:regional_endpoint, false)
|
47
49
|
|
50
|
+
# NOTE: All of the defaults block code is effectively deprecated.
|
51
|
+
# Because old services can depend on this new core version, we must
|
52
|
+
# retain it.
|
48
53
|
option(:endpoint, doc_type: String, docstring: <<-DOCS) do |cfg|
|
49
54
|
The client endpoint is normally constructed from the `:region`
|
50
55
|
option. You should only configure an `:endpoint` when connecting
|
@@ -0,0 +1,190 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'aws-sigv4'
|
4
|
+
|
5
|
+
module Aws
|
6
|
+
module Plugins
|
7
|
+
# @api private
|
8
|
+
class Sign < Seahorse::Client::Plugin
|
9
|
+
# These once had defaults. But now they are used as overrides to
|
10
|
+
# new endpoint and auth resolution.
|
11
|
+
option(:sigv4_signer)
|
12
|
+
option(:sigv4_name)
|
13
|
+
option(:sigv4_region)
|
14
|
+
option(:unsigned_operations, default: [])
|
15
|
+
|
16
|
+
supported_auth_types = %w[sigv4 bearer none]
|
17
|
+
supported_auth_types += ['sigv4a'] if Aws::Sigv4::Signer.use_crt?
|
18
|
+
SUPPORTED_AUTH_TYPES = supported_auth_types.freeze
|
19
|
+
|
20
|
+
def add_handlers(handlers, cfg)
|
21
|
+
operations = cfg.api.operation_names - cfg.unsigned_operations
|
22
|
+
handlers.add(Handler, step: :sign, operations: operations)
|
23
|
+
end
|
24
|
+
|
25
|
+
# @api private
|
26
|
+
# Return a signer with the `sign(context)` method
|
27
|
+
def self.signer_for(auth_scheme, config, region_override = nil)
|
28
|
+
case auth_scheme['name']
|
29
|
+
when 'sigv4', 'sigv4a'
|
30
|
+
SignatureV4.new(auth_scheme, config, region_override)
|
31
|
+
when 'bearer'
|
32
|
+
Bearer.new
|
33
|
+
else
|
34
|
+
NullSigner.new
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
class Handler < Seahorse::Client::Handler
|
39
|
+
def call(context)
|
40
|
+
signer = Sign.signer_for(
|
41
|
+
context[:auth_scheme],
|
42
|
+
context.config,
|
43
|
+
context[:sigv4_region]
|
44
|
+
)
|
45
|
+
|
46
|
+
signer.sign(context)
|
47
|
+
@handler.call(context)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# @api private
|
52
|
+
class Bearer
|
53
|
+
def initialize
|
54
|
+
end
|
55
|
+
|
56
|
+
def sign(context)
|
57
|
+
if context.http_request.endpoint.scheme != 'https'
|
58
|
+
raise ArgumentError,
|
59
|
+
'Unable to use bearer authorization on non https endpoint.'
|
60
|
+
end
|
61
|
+
|
62
|
+
token_provider = context.config.token_provider
|
63
|
+
|
64
|
+
raise Errors::MissingBearerTokenError unless token_provider&.set?
|
65
|
+
|
66
|
+
context.http_request.headers['Authorization'] =
|
67
|
+
"Bearer #{token_provider.token.token}"
|
68
|
+
end
|
69
|
+
|
70
|
+
def presign_url(*args)
|
71
|
+
raise ArgumentError, 'Bearer auth does not support presigned urls'
|
72
|
+
end
|
73
|
+
|
74
|
+
def sign_event(*args)
|
75
|
+
raise ArgumentError, 'Bearer auth does not support event signing'
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# @api private
|
80
|
+
class SignatureV4
|
81
|
+
def initialize(auth_scheme, config, region_override = nil)
|
82
|
+
scheme_name = auth_scheme['name']
|
83
|
+
|
84
|
+
unless %w[sigv4 sigv4a].include?(scheme_name)
|
85
|
+
raise ArgumentError,
|
86
|
+
"Expected sigv4 or sigv4a auth scheme, got #{scheme_name}"
|
87
|
+
end
|
88
|
+
|
89
|
+
region = if scheme_name == 'sigv4a'
|
90
|
+
auth_scheme['signingRegionSet'].first
|
91
|
+
else
|
92
|
+
auth_scheme['signingRegion']
|
93
|
+
end
|
94
|
+
begin
|
95
|
+
@signer = Aws::Sigv4::Signer.new(
|
96
|
+
service: config.sigv4_name || auth_scheme['signingName'],
|
97
|
+
region: region_override || config.sigv4_region || region,
|
98
|
+
credentials_provider: config.credentials,
|
99
|
+
signing_algorithm: scheme_name.to_sym,
|
100
|
+
uri_escape_path: !!!auth_scheme['disableDoubleEncoding'],
|
101
|
+
unsigned_headers: %w[content-length user-agent x-amzn-trace-id]
|
102
|
+
)
|
103
|
+
rescue Aws::Sigv4::Errors::MissingCredentialsError
|
104
|
+
raise Aws::Errors::MissingCredentialsError
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
def sign(context)
|
109
|
+
req = context.http_request
|
110
|
+
|
111
|
+
apply_authtype(context, req)
|
112
|
+
reset_signature(req)
|
113
|
+
apply_clock_skew(context, req)
|
114
|
+
|
115
|
+
# compute the signature
|
116
|
+
begin
|
117
|
+
signature = @signer.sign_request(
|
118
|
+
http_method: req.http_method,
|
119
|
+
url: req.endpoint,
|
120
|
+
headers: req.headers,
|
121
|
+
body: req.body
|
122
|
+
)
|
123
|
+
rescue Aws::Sigv4::Errors::MissingCredentialsError
|
124
|
+
# Necessary for when credentials is explicitly set to nil
|
125
|
+
raise Aws::Errors::MissingCredentialsError
|
126
|
+
end
|
127
|
+
# apply signature headers
|
128
|
+
req.headers.update(signature.headers)
|
129
|
+
|
130
|
+
# add request metadata with signature components for debugging
|
131
|
+
context[:canonical_request] = signature.canonical_request
|
132
|
+
context[:string_to_sign] = signature.string_to_sign
|
133
|
+
end
|
134
|
+
|
135
|
+
def presign_url(*args)
|
136
|
+
@signer.presign_url(*args)
|
137
|
+
end
|
138
|
+
|
139
|
+
def sign_event(*args)
|
140
|
+
@signer.sign_event(*args)
|
141
|
+
end
|
142
|
+
|
143
|
+
private
|
144
|
+
|
145
|
+
def apply_authtype(context, req)
|
146
|
+
if context.operation['authtype'].eql?('v4-unsigned-body') &&
|
147
|
+
req.endpoint.scheme.eql?('https')
|
148
|
+
req.headers['X-Amz-Content-Sha256'] ||= 'UNSIGNED-PAYLOAD'
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
def reset_signature(req)
|
153
|
+
# in case this request is being re-signed
|
154
|
+
req.headers.delete('Authorization')
|
155
|
+
req.headers.delete('X-Amz-Security-Token')
|
156
|
+
req.headers.delete('X-Amz-Date')
|
157
|
+
req.headers.delete('x-Amz-Region-Set')
|
158
|
+
end
|
159
|
+
|
160
|
+
def apply_clock_skew(context, req)
|
161
|
+
if context.config.respond_to?(:clock_skew) &&
|
162
|
+
context.config.clock_skew &&
|
163
|
+
context.config.correct_clock_skew
|
164
|
+
|
165
|
+
endpoint = context.http_request.endpoint
|
166
|
+
skew = context.config.clock_skew.clock_correction(endpoint)
|
167
|
+
if skew.abs.positive?
|
168
|
+
req.headers['X-Amz-Date'] =
|
169
|
+
(Time.now.utc + skew).strftime('%Y%m%dT%H%M%SZ')
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
end
|
175
|
+
|
176
|
+
# @api private
|
177
|
+
class NullSigner
|
178
|
+
|
179
|
+
def sign(context)
|
180
|
+
end
|
181
|
+
|
182
|
+
def presign_url(*args)
|
183
|
+
end
|
184
|
+
|
185
|
+
def sign_event(*args)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
@@ -53,12 +53,8 @@ module Aws
|
|
53
53
|
return if !value || value.empty?
|
54
54
|
headers[ref.location_name] = value
|
55
55
|
.compact
|
56
|
-
.map { |s| escape_header_list_string(s.to_s) }
|
57
|
-
.join(
|
58
|
-
end
|
59
|
-
|
60
|
-
def escape_header_list_string(s)
|
61
|
-
(s.include?('"') || s.include?(",")) ? "\"#{s.gsub('"', '\"')}\"" : s
|
56
|
+
.map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
|
57
|
+
.join(',')
|
62
58
|
end
|
63
59
|
|
64
60
|
def apply_header_map(headers, ref, values)
|
data/lib/aws-sdk-core.rb
CHANGED
@@ -97,6 +97,10 @@ require_relative 'aws-sdk-core/arn'
|
|
97
97
|
require_relative 'aws-sdk-core/arn_parser'
|
98
98
|
require_relative 'aws-sdk-core/ec2_metadata'
|
99
99
|
|
100
|
+
# dynamic endpoints
|
101
|
+
require_relative 'aws-sdk-core/endpoints'
|
102
|
+
require_relative 'aws-sdk-core/plugins/signature_v4'
|
103
|
+
|
100
104
|
# defaults
|
101
105
|
require_relative 'aws-defaults'
|
102
106
|
|
data/lib/aws-sdk-sso/client.rb
CHANGED
@@ -30,7 +30,7 @@ require 'aws-sdk-core/plugins/http_checksum.rb'
|
|
30
30
|
require 'aws-sdk-core/plugins/checksum_algorithm.rb'
|
31
31
|
require 'aws-sdk-core/plugins/defaults_mode.rb'
|
32
32
|
require 'aws-sdk-core/plugins/recursion_detection.rb'
|
33
|
-
require 'aws-sdk-core/plugins/
|
33
|
+
require 'aws-sdk-core/plugins/sign.rb'
|
34
34
|
require 'aws-sdk-core/plugins/protocols/rest_json.rb'
|
35
35
|
|
36
36
|
Aws::Plugins::GlobalConfiguration.add_identifier(:sso)
|
@@ -79,8 +79,9 @@ module Aws::SSO
|
|
79
79
|
add_plugin(Aws::Plugins::ChecksumAlgorithm)
|
80
80
|
add_plugin(Aws::Plugins::DefaultsMode)
|
81
81
|
add_plugin(Aws::Plugins::RecursionDetection)
|
82
|
-
add_plugin(Aws::Plugins::
|
82
|
+
add_plugin(Aws::Plugins::Sign)
|
83
83
|
add_plugin(Aws::Plugins::Protocols::RestJson)
|
84
|
+
add_plugin(Aws::SSO::Plugins::Endpoints)
|
84
85
|
|
85
86
|
# @overload initialize(options)
|
86
87
|
# @param [Hash] options
|
@@ -287,6 +288,19 @@ module Aws::SSO
|
|
287
288
|
# ** Please note ** When response stubbing is enabled, no HTTP
|
288
289
|
# requests are made, and retries are disabled.
|
289
290
|
#
|
291
|
+
# @option options [Aws::TokenProvider] :token_provider
|
292
|
+
# A Bearer Token Provider. This can be an instance of any one of the
|
293
|
+
# following classes:
|
294
|
+
#
|
295
|
+
# * `Aws::StaticTokenProvider` - Used for configuring static, non-refreshing
|
296
|
+
# tokens.
|
297
|
+
#
|
298
|
+
# * `Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an
|
299
|
+
# access token generated from `aws login`.
|
300
|
+
#
|
301
|
+
# When `:token_provider` is not configured directly, the `Aws::TokenProviderChain`
|
302
|
+
# will be used to search for tokens configured for your profile in shared configuration files.
|
303
|
+
#
|
290
304
|
# @option options [Boolean] :use_dualstack_endpoint
|
291
305
|
# When set to `true`, dualstack enabled endpoints (with `.aws` TLD)
|
292
306
|
# will be used if available.
|
@@ -300,6 +314,9 @@ module Aws::SSO
|
|
300
314
|
# When `true`, request parameters are validated before
|
301
315
|
# sending the request.
|
302
316
|
#
|
317
|
+
# @option options [Aws::SSO::EndpointProvider] :endpoint_provider
|
318
|
+
# The endpoint provider used to resolve endpoints. Any object that responds to `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::SSO::EndpointParameters`
|
319
|
+
#
|
303
320
|
# @option options [URI::HTTP,String] :http_proxy A proxy to send
|
304
321
|
# requests through. Formatted like 'http://proxy.com:123'.
|
305
322
|
#
|
@@ -568,7 +585,7 @@ module Aws::SSO
|
|
568
585
|
params: params,
|
569
586
|
config: config)
|
570
587
|
context[:gem_name] = 'aws-sdk-core'
|
571
|
-
context[:gem_version] = '3.
|
588
|
+
context[:gem_version] = '3.166.0'
|
572
589
|
Seahorse::Client::Request.new(handlers, context)
|
573
590
|
end
|
574
591
|
|
@@ -0,0 +1,66 @@
|
|
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::SSO
|
11
|
+
# Endpoint parameters used to influence endpoints per request.
|
12
|
+
#
|
13
|
+
# @!attribute region
|
14
|
+
# The AWS region used to dispatch the request.
|
15
|
+
#
|
16
|
+
# @return [String]
|
17
|
+
#
|
18
|
+
# @!attribute use_dual_stack
|
19
|
+
# When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
|
20
|
+
#
|
21
|
+
# @return [Boolean]
|
22
|
+
#
|
23
|
+
# @!attribute use_fips
|
24
|
+
# When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
|
25
|
+
#
|
26
|
+
# @return [Boolean]
|
27
|
+
#
|
28
|
+
# @!attribute endpoint
|
29
|
+
# Override the endpoint used to send this request
|
30
|
+
#
|
31
|
+
# @return [String]
|
32
|
+
#
|
33
|
+
EndpointParameters = Struct.new(
|
34
|
+
:region,
|
35
|
+
:use_dual_stack,
|
36
|
+
:use_fips,
|
37
|
+
:endpoint,
|
38
|
+
) do
|
39
|
+
include Aws::Structure
|
40
|
+
|
41
|
+
# @api private
|
42
|
+
class << self
|
43
|
+
PARAM_MAP = {
|
44
|
+
'Region' => :region,
|
45
|
+
'UseDualStack' => :use_dual_stack,
|
46
|
+
'UseFIPS' => :use_fips,
|
47
|
+
'Endpoint' => :endpoint,
|
48
|
+
}.freeze
|
49
|
+
end
|
50
|
+
|
51
|
+
def initialize(options = {})
|
52
|
+
self[:region] = options[:region]
|
53
|
+
self[:use_dual_stack] = options[:use_dual_stack]
|
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
|
+
self[:use_fips] = options[:use_fips]
|
59
|
+
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
|
+
self[:endpoint] = options[:endpoint]
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|