aws-sdk-core 3.201.2 → 3.226.2
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 +324 -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 +13 -5
- data/lib/aws-sdk-core/assume_role_web_identity_credentials.rb +14 -7
- data/lib/aws-sdk-core/cbor/decoder.rb +0 -2
- data/lib/aws-sdk-core/cbor/encoder.rb +2 -2
- data/lib/aws-sdk-core/cbor.rb +3 -56
- data/lib/aws-sdk-core/client_side_monitoring.rb +9 -0
- data/lib/aws-sdk-core/client_stubs.rb +29 -55
- data/lib/aws-sdk-core/credential_provider.rb +4 -0
- data/lib/aws-sdk-core/credential_provider_chain.rb +35 -8
- data/lib/aws-sdk-core/credentials.rb +19 -6
- data/lib/aws-sdk-core/ecs_credentials.rb +1 -0
- data/lib/aws-sdk-core/endpoints/endpoint.rb +3 -1
- data/lib/aws-sdk-core/endpoints/matchers.rb +3 -9
- data/lib/aws-sdk-core/endpoints.rb +13 -3
- data/lib/aws-sdk-core/error_handler.rb +5 -0
- data/lib/aws-sdk-core/errors.rb +2 -2
- data/lib/aws-sdk-core/event_emitter.rb +1 -1
- data/lib/aws-sdk-core/instance_profile_credentials.rb +1 -0
- data/lib/aws-sdk-core/json/error_handler.rb +14 -3
- data/lib/aws-sdk-core/json/handler.rb +1 -0
- 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/plugins/checksum_algorithm.rb +332 -170
- data/lib/aws-sdk-core/plugins/client_metrics_plugin.rb +0 -1
- data/lib/aws-sdk-core/plugins/credentials_configuration.rb +7 -3
- data/lib/aws-sdk-core/plugins/endpoint_pattern.rb +40 -32
- data/lib/aws-sdk-core/plugins/http_checksum.rb +2 -8
- data/lib/aws-sdk-core/plugins/regional_endpoint.rb +44 -24
- data/lib/aws-sdk-core/plugins/sign.rb +18 -5
- data/lib/aws-sdk-core/plugins/stub_responses.rb +52 -9
- data/lib/aws-sdk-core/plugins/telemetry.rb +75 -0
- data/lib/aws-sdk-core/plugins/user_agent.rb +48 -9
- data/lib/aws-sdk-core/plugins.rb +39 -0
- data/lib/aws-sdk-core/process_credentials.rb +3 -2
- data/lib/aws-sdk-core/resources.rb +8 -0
- data/lib/aws-sdk-core/rest/request/headers.rb +3 -3
- 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 +27 -16
- data/lib/aws-sdk-core/rpc_v2/handler.rb +7 -2
- data/lib/aws-sdk-core/rpc_v2/parser.rb +9 -1
- data/lib/aws-sdk-core/rpc_v2.rb +65 -2
- data/lib/aws-sdk-core/shared_config.rb +77 -22
- data/lib/aws-sdk-core/shared_credentials.rb +1 -7
- data/lib/aws-sdk-core/sso_credentials.rb +4 -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 +13 -15
- 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/util.rb +2 -1
- data/lib/aws-sdk-core/waiters/poller.rb +9 -4
- data/lib/aws-sdk-core/xml/error_handler.rb +3 -1
- data/lib/aws-sdk-core.rb +82 -112
- data/lib/aws-sdk-sso/client.rb +86 -37
- data/lib/aws-sdk-sso/client_api.rb +1 -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 -57
- data/lib/aws-sdk-ssooidc/client_api.rb +7 -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 +49 -16
- data/lib/aws-sdk-ssooidc.rb +15 -11
- data/lib/aws-sdk-sts/client.rb +294 -89
- data/lib/aws-sdk-sts/client_api.rb +34 -8
- 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 +50 -55
- data/lib/aws-sdk-sts/endpoints.rb +2 -118
- data/lib/aws-sdk-sts/errors.rb +15 -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/async_base.rb +4 -5
- data/lib/seahorse/client/base.rb +0 -14
- data/lib/seahorse/client/h2/connection.rb +18 -28
- data/lib/seahorse/client/h2/handler.rb +13 -3
- data/lib/seahorse/client/http/response.rb +1 -1
- data/lib/seahorse/client/net_http/connection_pool.rb +12 -3
- data/lib/seahorse/client/net_http/handler.rb +21 -9
- data/lib/seahorse/client/networking_error.rb +1 -1
- data/lib/seahorse/client/plugins/h2.rb +4 -4
- 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/lib/seahorse/util.rb +2 -1
- data/sig/aws-sdk-core/async_client_stubs.rbs +21 -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
- data/sig/seahorse/client/async_base.rbs +18 -0
- metadata +61 -19
@@ -0,0 +1,78 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'telemetry/base'
|
4
|
+
require_relative 'telemetry/no_op'
|
5
|
+
require_relative 'telemetry/otel'
|
6
|
+
require_relative 'telemetry/span_kind'
|
7
|
+
require_relative 'telemetry/span_status'
|
8
|
+
|
9
|
+
module Aws
|
10
|
+
# Observability is the extent to which a system's current state can be
|
11
|
+
# inferred from the data it emits. The data emitted is commonly referred
|
12
|
+
# as Telemetry. The AWS SDK for Ruby currently supports traces as
|
13
|
+
# a telemetry signal.
|
14
|
+
#
|
15
|
+
# A telemetry provider is used to emit telemetry data. By default, the
|
16
|
+
# {NoOpTelemetryProvider} will not record or emit any telemetry data.
|
17
|
+
# The SDK currently supports OpenTelemetry (OTel) as a provider. See
|
18
|
+
# {OTelProvider} for more information.
|
19
|
+
#
|
20
|
+
# If a provider isn't supported, you can implement your own provider by
|
21
|
+
# inheriting the following base classes and implementing the interfaces
|
22
|
+
# defined:
|
23
|
+
# * {TelemetryProviderBase}
|
24
|
+
# * {ContextManagerBase}
|
25
|
+
# * {TracerProviderBase}
|
26
|
+
# * {TracerBase}
|
27
|
+
# * {SpanBase}
|
28
|
+
module Telemetry
|
29
|
+
class << self
|
30
|
+
# @api private
|
31
|
+
def module_to_tracer_name(module_name)
|
32
|
+
"#{module_name.gsub('::', '.')}.client".downcase
|
33
|
+
end
|
34
|
+
|
35
|
+
# @api private
|
36
|
+
def http_request_attrs(context)
|
37
|
+
{
|
38
|
+
'http.method' => context.http_request.http_method,
|
39
|
+
'net.protocol.name' => 'http'
|
40
|
+
}.tap do |h|
|
41
|
+
h['net.protocol.version'] =
|
42
|
+
if context.client.is_a? Seahorse::Client::AsyncBase
|
43
|
+
'2'
|
44
|
+
else
|
45
|
+
Net::HTTP::HTTPVersion
|
46
|
+
end
|
47
|
+
|
48
|
+
unless context.config.stub_responses
|
49
|
+
h['net.peer.name'] = context.http_request.endpoint.host
|
50
|
+
h['net.peer.port'] = context.http_request.endpoint.port.to_s
|
51
|
+
end
|
52
|
+
|
53
|
+
if context.http_request.headers.key?('Content-Length')
|
54
|
+
h['http.request_content_length'] =
|
55
|
+
context.http_request.headers['Content-Length']
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# @api private
|
61
|
+
def http_response_attrs(context)
|
62
|
+
{
|
63
|
+
'http.status_code' => context.http_response.status_code.to_s
|
64
|
+
}.tap do |h|
|
65
|
+
if context.http_response.headers.key?('Content-Length')
|
66
|
+
h['http.response_content_length'] =
|
67
|
+
context.http_response.headers['Content-Length']
|
68
|
+
end
|
69
|
+
|
70
|
+
if context.http_response.headers.key?('x-amz-request-id')
|
71
|
+
h['aws.request_id'] =
|
72
|
+
context.http_response.headers['x-amz-request-id']
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
data/lib/aws-sdk-core/util.rb
CHANGED
@@ -29,7 +29,7 @@ module Aws
|
|
29
29
|
# * `:retry` - The waiter may be retried.
|
30
30
|
# * `:error` - The waiter encountered an un-expected error.
|
31
31
|
#
|
32
|
-
# @example A
|
32
|
+
# @example A trivial (bad) example of a waiter that polls indefinetly.
|
33
33
|
#
|
34
34
|
# loop do
|
35
35
|
#
|
@@ -96,8 +96,13 @@ module Aws
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def matches_error?(acceptor, response)
|
99
|
-
|
100
|
-
|
99
|
+
case acceptor['expected']
|
100
|
+
when 'false' then response.error.nil?
|
101
|
+
when 'true' then !response.error.nil?
|
102
|
+
else
|
103
|
+
response.error.is_a?(Aws::Errors::ServiceError) &&
|
104
|
+
response.error.code == acceptor['expected'].delete('.')
|
105
|
+
end
|
101
106
|
end
|
102
107
|
|
103
108
|
def path(acceptor)
|
@@ -107,7 +112,7 @@ module Aws
|
|
107
112
|
def non_empty_array(acceptor, response, &block)
|
108
113
|
if response.data
|
109
114
|
values = JMESPath.search(path(acceptor), response.data)
|
110
|
-
Array
|
115
|
+
values.is_a?(Array) && values.count > 0 ? yield(values) : false
|
111
116
|
else
|
112
117
|
false
|
113
118
|
end
|
data/lib/aws-sdk-core.rb
CHANGED
@@ -3,125 +3,80 @@
|
|
3
3
|
require 'aws-partitions'
|
4
4
|
require 'seahorse'
|
5
5
|
require 'jmespath'
|
6
|
+
require 'aws-sigv4'
|
6
7
|
|
7
8
|
require_relative 'aws-sdk-core/deprecations'
|
8
|
-
|
9
|
-
# credential providers
|
10
|
-
|
11
|
-
require_relative 'aws-sdk-core/credential_provider'
|
12
|
-
require_relative 'aws-sdk-core/refreshing_credentials'
|
13
|
-
require_relative 'aws-sdk-core/assume_role_credentials'
|
14
|
-
require_relative 'aws-sdk-core/assume_role_web_identity_credentials'
|
15
|
-
require_relative 'aws-sdk-core/credentials'
|
16
|
-
require_relative 'aws-sdk-core/credential_provider_chain'
|
17
|
-
require_relative 'aws-sdk-core/ecs_credentials'
|
18
|
-
require_relative 'aws-sdk-core/instance_profile_credentials'
|
19
|
-
require_relative 'aws-sdk-core/shared_credentials'
|
20
|
-
require_relative 'aws-sdk-core/process_credentials'
|
21
|
-
require_relative 'aws-sdk-core/sso_credentials'
|
22
|
-
|
23
|
-
# tokens and token providers
|
24
|
-
require_relative 'aws-sdk-core/token'
|
25
|
-
require_relative 'aws-sdk-core/token_provider'
|
26
|
-
require_relative 'aws-sdk-core/static_token_provider'
|
27
|
-
require_relative 'aws-sdk-core/refreshing_token'
|
28
|
-
require_relative 'aws-sdk-core/sso_token_provider'
|
29
|
-
require_relative 'aws-sdk-core/token_provider_chain'
|
30
|
-
require_relative 'aws-sdk-core/plugins/bearer_authorization'
|
31
|
-
|
32
|
-
# client modules
|
33
|
-
|
34
|
-
require_relative 'aws-sdk-core/client_stubs'
|
35
|
-
require_relative 'aws-sdk-core/async_client_stubs'
|
36
|
-
require_relative 'aws-sdk-core/eager_loader'
|
37
|
-
require_relative 'aws-sdk-core/errors'
|
38
|
-
require_relative 'aws-sdk-core/pageable_response'
|
39
|
-
require_relative 'aws-sdk-core/pager'
|
40
|
-
require_relative 'aws-sdk-core/param_converter'
|
41
|
-
require_relative 'aws-sdk-core/param_validator'
|
42
|
-
require_relative 'aws-sdk-core/shared_config'
|
43
|
-
require_relative 'aws-sdk-core/structure'
|
44
|
-
require_relative 'aws-sdk-core/type_builder'
|
45
|
-
require_relative 'aws-sdk-core/util'
|
46
|
-
|
47
|
-
# resource classes
|
48
|
-
|
49
|
-
require_relative 'aws-sdk-core/resources/collection'
|
50
|
-
|
51
|
-
# logging
|
52
|
-
|
53
|
-
require_relative 'aws-sdk-core/log/formatter'
|
54
|
-
require_relative 'aws-sdk-core/log/param_filter'
|
55
|
-
require_relative 'aws-sdk-core/log/param_formatter'
|
56
|
-
|
57
|
-
# stubbing
|
58
|
-
|
59
|
-
require_relative 'aws-sdk-core/stubbing/empty_stub'
|
60
|
-
require_relative 'aws-sdk-core/stubbing/data_applicator'
|
61
|
-
require_relative 'aws-sdk-core/stubbing/stub_data'
|
62
|
-
require_relative 'aws-sdk-core/stubbing/xml_error'
|
63
|
-
|
64
|
-
# stubbing protocols
|
65
|
-
|
66
|
-
require_relative 'aws-sdk-core/stubbing/protocols/json'
|
67
|
-
require_relative 'aws-sdk-core/stubbing/protocols/rest'
|
68
|
-
require_relative 'aws-sdk-core/stubbing/protocols/rest_json'
|
69
|
-
require_relative 'aws-sdk-core/stubbing/protocols/rest_xml'
|
70
|
-
require_relative 'aws-sdk-core/stubbing/protocols/query'
|
71
|
-
require_relative 'aws-sdk-core/stubbing/protocols/ec2'
|
72
|
-
require_relative 'aws-sdk-core/stubbing/protocols/rpc_v2'
|
73
|
-
require_relative 'aws-sdk-core/stubbing/protocols/api_gateway'
|
74
|
-
|
75
|
-
# protocols
|
76
|
-
|
77
|
-
require_relative 'aws-sdk-core/error_handler'
|
78
|
-
require_relative 'aws-sdk-core/rest'
|
79
|
-
require_relative 'aws-sdk-core/xml'
|
80
|
-
require_relative 'aws-sdk-core/json'
|
81
|
-
require_relative 'aws-sdk-core/query'
|
82
|
-
require_relative 'aws-sdk-core/rpc_v2'
|
83
|
-
|
84
|
-
# event stream
|
85
|
-
|
86
|
-
require_relative 'aws-sdk-core/binary'
|
87
|
-
require_relative 'aws-sdk-core/event_emitter'
|
88
|
-
|
89
|
-
# endpoint discovery
|
90
|
-
|
91
|
-
require_relative 'aws-sdk-core/endpoint_cache'
|
92
|
-
|
93
|
-
# client metrics
|
94
|
-
|
95
|
-
require_relative 'aws-sdk-core/client_side_monitoring/request_metrics'
|
96
|
-
require_relative 'aws-sdk-core/client_side_monitoring/publisher'
|
97
|
-
|
98
|
-
# utilities
|
99
|
-
|
100
|
-
require_relative 'aws-sdk-core/arn'
|
101
|
-
require_relative 'aws-sdk-core/arn_parser'
|
102
|
-
require_relative 'aws-sdk-core/ec2_metadata'
|
103
|
-
require_relative 'aws-sdk-core/lru_cache'
|
104
|
-
|
105
|
-
# dynamic endpoints
|
106
|
-
require_relative 'aws-sdk-core/endpoints'
|
107
|
-
require_relative 'aws-sdk-core/plugins/signature_v4'
|
108
|
-
|
109
9
|
# defaults
|
110
10
|
require_relative 'aws-defaults'
|
111
11
|
|
112
|
-
# plugins
|
113
|
-
# loaded through building STS or SSO ..
|
114
|
-
|
115
|
-
# aws-sdk-sts is included to support Aws::AssumeRoleCredentials
|
116
|
-
require_relative 'aws-sdk-sts'
|
117
|
-
|
118
|
-
# aws-sdk-sso is included to support Aws::SSOCredentials
|
119
|
-
require_relative 'aws-sdk-sso'
|
120
|
-
require_relative 'aws-sdk-ssooidc'
|
121
|
-
|
122
12
|
module Aws
|
123
13
|
|
124
|
-
|
14
|
+
autoload :IniParser, 'aws-sdk-core/ini_parser'
|
15
|
+
|
16
|
+
# Credentials and credentials providers
|
17
|
+
autoload :Credentials, 'aws-sdk-core/credentials'
|
18
|
+
autoload :CredentialProvider, 'aws-sdk-core/credential_provider'
|
19
|
+
autoload :RefreshingCredentials, 'aws-sdk-core/refreshing_credentials'
|
20
|
+
autoload :AssumeRoleCredentials, 'aws-sdk-core/assume_role_credentials'
|
21
|
+
autoload :AssumeRoleWebIdentityCredentials, 'aws-sdk-core/assume_role_web_identity_credentials'
|
22
|
+
autoload :CredentialProviderChain, 'aws-sdk-core/credential_provider_chain'
|
23
|
+
autoload :ECSCredentials, 'aws-sdk-core/ecs_credentials'
|
24
|
+
autoload :InstanceProfileCredentials, 'aws-sdk-core/instance_profile_credentials'
|
25
|
+
autoload :SharedCredentials, 'aws-sdk-core/shared_credentials'
|
26
|
+
autoload :ProcessCredentials, 'aws-sdk-core/process_credentials'
|
27
|
+
autoload :SSOCredentials, 'aws-sdk-core/sso_credentials'
|
28
|
+
|
29
|
+
|
30
|
+
# tokens and token providers
|
31
|
+
autoload :Token, 'aws-sdk-core/token'
|
32
|
+
autoload :TokenProvider, 'aws-sdk-core/token_provider'
|
33
|
+
autoload :StaticTokenProvider, 'aws-sdk-core/static_token_provider'
|
34
|
+
autoload :RefreshingToken, 'aws-sdk-core/refreshing_token'
|
35
|
+
autoload :SSOTokenProvider, 'aws-sdk-core/sso_token_provider'
|
36
|
+
autoload :TokenProviderChain, 'aws-sdk-core/token_provider_chain'
|
37
|
+
|
38
|
+
# client modules
|
39
|
+
autoload :ClientStubs, 'aws-sdk-core/client_stubs'
|
40
|
+
autoload :AsyncClientStubs, 'aws-sdk-core/async_client_stubs'
|
41
|
+
autoload :EagerLoader, 'aws-sdk-core/eager_loader'
|
42
|
+
autoload :Errors, 'aws-sdk-core/errors'
|
43
|
+
autoload :PageableResponse, 'aws-sdk-core/pageable_response'
|
44
|
+
autoload :Pager, 'aws-sdk-core/pager'
|
45
|
+
autoload :ParamConverter, 'aws-sdk-core/param_converter'
|
46
|
+
autoload :ParamValidator, 'aws-sdk-core/param_validator'
|
47
|
+
autoload :SharedConfig, 'aws-sdk-core/shared_config'
|
48
|
+
autoload :Structure, 'aws-sdk-core/structure'
|
49
|
+
autoload :EmptyStructure, 'aws-sdk-core/structure'
|
50
|
+
autoload :TypeBuilder, 'aws-sdk-core/type_builder'
|
51
|
+
autoload :Util, 'aws-sdk-core/util'
|
52
|
+
|
53
|
+
# protocols
|
54
|
+
autoload :ErrorHandler, 'aws-sdk-core/error_handler'
|
55
|
+
autoload :Rest, 'aws-sdk-core/rest'
|
56
|
+
autoload :Xml, 'aws-sdk-core/xml'
|
57
|
+
autoload :Json, 'aws-sdk-core/json'
|
58
|
+
autoload :Query, 'aws-sdk-core/query'
|
59
|
+
autoload :RpcV2, 'aws-sdk-core/rpc_v2'
|
60
|
+
|
61
|
+
# event stream
|
62
|
+
autoload :Binary, 'aws-sdk-core/binary'
|
63
|
+
autoload :EventEmitter, 'aws-sdk-core/event_emitter'
|
64
|
+
|
65
|
+
# endpoint discovery
|
66
|
+
autoload :EndpointCache, 'aws-sdk-core/endpoint_cache'
|
67
|
+
|
68
|
+
autoload :Telemetry, 'aws-sdk-core/telemetry'
|
69
|
+
|
70
|
+
# utilities
|
71
|
+
autoload :ARN, 'aws-sdk-core/arn'
|
72
|
+
autoload :ARNParser, 'aws-sdk-core/arn_parser'
|
73
|
+
autoload :EC2Metadata, 'aws-sdk-core/ec2_metadata'
|
74
|
+
autoload :LRUCache, 'aws-sdk-core/lru_cache'
|
75
|
+
|
76
|
+
# dynamic endpoints
|
77
|
+
autoload :Endpoints, 'aws-sdk-core/endpoints'
|
78
|
+
|
79
|
+
CORE_GEM_VERSION = File.read(File.expand_path('../VERSION', __dir__)).strip
|
125
80
|
|
126
81
|
@config = {}
|
127
82
|
|
@@ -205,3 +160,18 @@ module Aws
|
|
205
160
|
|
206
161
|
end
|
207
162
|
end
|
163
|
+
|
164
|
+
# Setup additional autoloads/modules
|
165
|
+
require_relative 'aws-sdk-core/client_side_monitoring'
|
166
|
+
require_relative 'aws-sdk-core/log'
|
167
|
+
require_relative 'aws-sdk-core/plugins'
|
168
|
+
require_relative 'aws-sdk-core/resources'
|
169
|
+
require_relative 'aws-sdk-core/stubbing'
|
170
|
+
require_relative 'aws-sdk-core/waiters'
|
171
|
+
|
172
|
+
# aws-sdk-sts is included to support Aws::AssumeRoleCredentials
|
173
|
+
require_relative 'aws-sdk-sts'
|
174
|
+
|
175
|
+
# aws-sdk-sso is included to support Aws::SSOCredentials
|
176
|
+
require_relative 'aws-sdk-sso'
|
177
|
+
require_relative 'aws-sdk-ssooidc'
|
data/lib/aws-sdk-sso/client.rb
CHANGED
@@ -7,35 +7,34 @@
|
|
7
7
|
#
|
8
8
|
# WARNING ABOUT GENERATED CODE
|
9
9
|
|
10
|
-
require 'seahorse/client/plugins/content_length
|
11
|
-
require 'aws-sdk-core/plugins/credentials_configuration
|
12
|
-
require 'aws-sdk-core/plugins/logging
|
13
|
-
require 'aws-sdk-core/plugins/param_converter
|
14
|
-
require 'aws-sdk-core/plugins/param_validator
|
15
|
-
require 'aws-sdk-core/plugins/user_agent
|
16
|
-
require 'aws-sdk-core/plugins/helpful_socket_errors
|
17
|
-
require 'aws-sdk-core/plugins/retry_errors
|
18
|
-
require 'aws-sdk-core/plugins/global_configuration
|
19
|
-
require 'aws-sdk-core/plugins/regional_endpoint
|
20
|
-
require 'aws-sdk-core/plugins/endpoint_discovery
|
21
|
-
require 'aws-sdk-core/plugins/endpoint_pattern
|
22
|
-
require 'aws-sdk-core/plugins/response_paging
|
23
|
-
require 'aws-sdk-core/plugins/stub_responses
|
24
|
-
require 'aws-sdk-core/plugins/idempotency_token
|
25
|
-
require 'aws-sdk-core/plugins/invocation_id
|
26
|
-
require 'aws-sdk-core/plugins/jsonvalue_converter
|
27
|
-
require 'aws-sdk-core/plugins/client_metrics_plugin
|
28
|
-
require 'aws-sdk-core/plugins/client_metrics_send_plugin
|
29
|
-
require 'aws-sdk-core/plugins/transfer_encoding
|
30
|
-
require 'aws-sdk-core/plugins/http_checksum
|
31
|
-
require 'aws-sdk-core/plugins/checksum_algorithm
|
32
|
-
require 'aws-sdk-core/plugins/request_compression
|
33
|
-
require 'aws-sdk-core/plugins/defaults_mode
|
34
|
-
require 'aws-sdk-core/plugins/recursion_detection
|
35
|
-
require 'aws-sdk-core/plugins/
|
36
|
-
require 'aws-sdk-core/plugins/
|
37
|
-
|
38
|
-
Aws::Plugins::GlobalConfiguration.add_identifier(:sso)
|
10
|
+
require 'seahorse/client/plugins/content_length'
|
11
|
+
require 'aws-sdk-core/plugins/credentials_configuration'
|
12
|
+
require 'aws-sdk-core/plugins/logging'
|
13
|
+
require 'aws-sdk-core/plugins/param_converter'
|
14
|
+
require 'aws-sdk-core/plugins/param_validator'
|
15
|
+
require 'aws-sdk-core/plugins/user_agent'
|
16
|
+
require 'aws-sdk-core/plugins/helpful_socket_errors'
|
17
|
+
require 'aws-sdk-core/plugins/retry_errors'
|
18
|
+
require 'aws-sdk-core/plugins/global_configuration'
|
19
|
+
require 'aws-sdk-core/plugins/regional_endpoint'
|
20
|
+
require 'aws-sdk-core/plugins/endpoint_discovery'
|
21
|
+
require 'aws-sdk-core/plugins/endpoint_pattern'
|
22
|
+
require 'aws-sdk-core/plugins/response_paging'
|
23
|
+
require 'aws-sdk-core/plugins/stub_responses'
|
24
|
+
require 'aws-sdk-core/plugins/idempotency_token'
|
25
|
+
require 'aws-sdk-core/plugins/invocation_id'
|
26
|
+
require 'aws-sdk-core/plugins/jsonvalue_converter'
|
27
|
+
require 'aws-sdk-core/plugins/client_metrics_plugin'
|
28
|
+
require 'aws-sdk-core/plugins/client_metrics_send_plugin'
|
29
|
+
require 'aws-sdk-core/plugins/transfer_encoding'
|
30
|
+
require 'aws-sdk-core/plugins/http_checksum'
|
31
|
+
require 'aws-sdk-core/plugins/checksum_algorithm'
|
32
|
+
require 'aws-sdk-core/plugins/request_compression'
|
33
|
+
require 'aws-sdk-core/plugins/defaults_mode'
|
34
|
+
require 'aws-sdk-core/plugins/recursion_detection'
|
35
|
+
require 'aws-sdk-core/plugins/telemetry'
|
36
|
+
require 'aws-sdk-core/plugins/sign'
|
37
|
+
require 'aws-sdk-core/plugins/protocols/rest_json'
|
39
38
|
|
40
39
|
module Aws::SSO
|
41
40
|
# An API client for SSO. To construct a client, you need to configure a `:region` and `:credentials`.
|
@@ -83,6 +82,7 @@ module Aws::SSO
|
|
83
82
|
add_plugin(Aws::Plugins::RequestCompression)
|
84
83
|
add_plugin(Aws::Plugins::DefaultsMode)
|
85
84
|
add_plugin(Aws::Plugins::RecursionDetection)
|
85
|
+
add_plugin(Aws::Plugins::Telemetry)
|
86
86
|
add_plugin(Aws::Plugins::Sign)
|
87
87
|
add_plugin(Aws::Plugins::Protocols::RestJson)
|
88
88
|
add_plugin(Aws::SSO::Plugins::Endpoints)
|
@@ -128,13 +128,15 @@ module Aws::SSO
|
|
128
128
|
# locations will be searched for credentials:
|
129
129
|
#
|
130
130
|
# * `Aws.config[:credentials]`
|
131
|
-
# * The `:access_key_id`, `:secret_access_key`,
|
132
|
-
#
|
131
|
+
# * The `:access_key_id`, `:secret_access_key`, `:session_token`, and
|
132
|
+
# `:account_id` options.
|
133
|
+
# * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'],
|
134
|
+
# ENV['AWS_SESSION_TOKEN'], and ENV['AWS_ACCOUNT_ID']
|
133
135
|
# * `~/.aws/credentials`
|
134
136
|
# * `~/.aws/config`
|
135
137
|
# * EC2/ECS IMDS instance profile - When used by default, the timeouts
|
136
138
|
# are very aggressive. Construct and pass an instance of
|
137
|
-
# `Aws::
|
139
|
+
# `Aws::InstanceProfileCredentials` or `Aws::ECSCredentials` to
|
138
140
|
# enable retries and extended timeouts. Instance profile credential
|
139
141
|
# fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED']
|
140
142
|
# to true.
|
@@ -153,6 +155,8 @@ module Aws::SSO
|
|
153
155
|
#
|
154
156
|
# @option options [String] :access_key_id
|
155
157
|
#
|
158
|
+
# @option options [String] :account_id
|
159
|
+
#
|
156
160
|
# @option options [Boolean] :active_endpoint_cache (false)
|
157
161
|
# When set to `true`, a thread polling for endpoints will be running in
|
158
162
|
# the background every 60 secs (default). Defaults to `false`.
|
@@ -196,8 +200,7 @@ module Aws::SSO
|
|
196
200
|
# accepted modes and the configuration defaults that are included.
|
197
201
|
#
|
198
202
|
# @option options [Boolean] :disable_host_prefix_injection (false)
|
199
|
-
#
|
200
|
-
# to default service endpoint when available.
|
203
|
+
# When `true`, the SDK will not prepend the modeled host prefix to the endpoint.
|
201
204
|
#
|
202
205
|
# @option options [Boolean] :disable_request_compression (false)
|
203
206
|
# When set to 'true' the request body will not be compressed
|
@@ -253,11 +256,34 @@ module Aws::SSO
|
|
253
256
|
# Used when loading credentials from the shared credentials file
|
254
257
|
# at HOME/.aws/credentials. When not specified, 'default' is used.
|
255
258
|
#
|
259
|
+
# @option options [String] :request_checksum_calculation ("when_supported")
|
260
|
+
# Determines when a checksum will be calculated for request payloads. Values are:
|
261
|
+
#
|
262
|
+
# * `when_supported` - (default) When set, a checksum will be
|
263
|
+
# calculated for all request payloads of operations modeled with the
|
264
|
+
# `httpChecksum` trait where `requestChecksumRequired` is `true` and/or a
|
265
|
+
# `requestAlgorithmMember` is modeled.
|
266
|
+
# * `when_required` - When set, a checksum will only be calculated for
|
267
|
+
# request payloads of operations modeled with the `httpChecksum` trait where
|
268
|
+
# `requestChecksumRequired` is `true` or where a `requestAlgorithmMember`
|
269
|
+
# is modeled and supplied.
|
270
|
+
#
|
256
271
|
# @option options [Integer] :request_min_compression_size_bytes (10240)
|
257
272
|
# The minimum size in bytes that triggers compression for request
|
258
273
|
# bodies. The value must be non-negative integer value between 0
|
259
274
|
# and 10485780 bytes inclusive.
|
260
275
|
#
|
276
|
+
# @option options [String] :response_checksum_validation ("when_supported")
|
277
|
+
# Determines when checksum validation will be performed on response payloads. Values are:
|
278
|
+
#
|
279
|
+
# * `when_supported` - (default) When set, checksum validation is performed on all
|
280
|
+
# response payloads of operations modeled with the `httpChecksum` trait where
|
281
|
+
# `responseAlgorithms` is modeled, except when no modeled checksum algorithms
|
282
|
+
# are supported.
|
283
|
+
# * `when_required` - When set, checksum validation is not performed on
|
284
|
+
# response payloads of operations unless the checksum algorithm is supported and
|
285
|
+
# the `requestValidationModeMember` member is set to `ENABLED`.
|
286
|
+
#
|
261
287
|
# @option options [Proc] :retry_backoff
|
262
288
|
# A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
|
263
289
|
# This option is only used in the `legacy` retry mode.
|
@@ -330,6 +356,16 @@ module Aws::SSO
|
|
330
356
|
# ** Please note ** When response stubbing is enabled, no HTTP
|
331
357
|
# requests are made, and retries are disabled.
|
332
358
|
#
|
359
|
+
# @option options [Aws::Telemetry::TelemetryProviderBase] :telemetry_provider (Aws::Telemetry::NoOpTelemetryProvider)
|
360
|
+
# Allows you to provide a telemetry provider, which is used to
|
361
|
+
# emit telemetry data. By default, uses `NoOpTelemetryProvider` which
|
362
|
+
# will not record or emit any telemetry data. The SDK supports the
|
363
|
+
# following telemetry providers:
|
364
|
+
#
|
365
|
+
# * OpenTelemetry (OTel) - To use the OTel provider, install and require the
|
366
|
+
# `opentelemetry-sdk` gem and then, pass in an instance of a
|
367
|
+
# `Aws::Telemetry::OTelProvider` for telemetry provider.
|
368
|
+
#
|
333
369
|
# @option options [Aws::TokenProvider] :token_provider
|
334
370
|
# A Bearer Token Provider. This can be an instance of any one of the
|
335
371
|
# following classes:
|
@@ -357,7 +393,9 @@ module Aws::SSO
|
|
357
393
|
# sending the request.
|
358
394
|
#
|
359
395
|
# @option options [Aws::SSO::EndpointProvider] :endpoint_provider
|
360
|
-
# The endpoint provider used to resolve endpoints. Any object that responds to
|
396
|
+
# The endpoint provider used to resolve endpoints. Any object that responds to
|
397
|
+
# `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
|
398
|
+
# `Aws::SSO::EndpointParameters`.
|
361
399
|
#
|
362
400
|
# @option options [Float] :http_continue_timeout (1)
|
363
401
|
# The number of seconds to wait for a 100-continue response before sending the
|
@@ -413,6 +451,12 @@ module Aws::SSO
|
|
413
451
|
# @option options [String] :ssl_ca_store
|
414
452
|
# Sets the X509::Store to verify peer certificate.
|
415
453
|
#
|
454
|
+
# @option options [OpenSSL::X509::Certificate] :ssl_cert
|
455
|
+
# Sets a client certificate when creating http connections.
|
456
|
+
#
|
457
|
+
# @option options [OpenSSL::PKey] :ssl_key
|
458
|
+
# Sets a client key when creating http connections.
|
459
|
+
#
|
416
460
|
# @option options [Float] :ssl_timeout
|
417
461
|
# Sets the SSL timeout in seconds
|
418
462
|
#
|
@@ -635,14 +679,19 @@ module Aws::SSO
|
|
635
679
|
# @api private
|
636
680
|
def build_request(operation_name, params = {})
|
637
681
|
handlers = @handlers.for(operation_name)
|
682
|
+
tracer = config.telemetry_provider.tracer_provider.tracer(
|
683
|
+
Aws::Telemetry.module_to_tracer_name('Aws::SSO')
|
684
|
+
)
|
638
685
|
context = Seahorse::Client::RequestContext.new(
|
639
686
|
operation_name: operation_name,
|
640
687
|
operation: config.api.operation(operation_name),
|
641
688
|
client: self,
|
642
689
|
params: params,
|
643
|
-
config: config
|
690
|
+
config: config,
|
691
|
+
tracer: tracer
|
692
|
+
)
|
644
693
|
context[:gem_name] = 'aws-sdk-core'
|
645
|
-
context[:gem_version] = '3.
|
694
|
+
context[:gem_version] = '3.226.2'
|
646
695
|
Seahorse::Client::Request.new(handlers, context)
|
647
696
|
end
|
648
697
|
|
@@ -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
|
@@ -10,43 +10,39 @@
|
|
10
10
|
module Aws::SSO
|
11
11
|
class EndpointProvider
|
12
12
|
def resolve_endpoint(parameters)
|
13
|
-
|
14
|
-
|
15
|
-
use_fips = parameters.use_fips
|
16
|
-
endpoint = parameters.endpoint
|
17
|
-
if Aws::Endpoints::Matchers.set?(endpoint)
|
18
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
|
13
|
+
if Aws::Endpoints::Matchers.set?(parameters.endpoint)
|
14
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true)
|
19
15
|
raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
|
20
16
|
end
|
21
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
17
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
|
22
18
|
raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
|
23
19
|
end
|
24
|
-
return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
|
20
|
+
return Aws::Endpoints::Endpoint.new(url: parameters.endpoint, headers: {}, properties: {})
|
25
21
|
end
|
26
|
-
if Aws::Endpoints::Matchers.set?(region)
|
27
|
-
if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
|
28
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
22
|
+
if Aws::Endpoints::Matchers.set?(parameters.region)
|
23
|
+
if (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region))
|
24
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
|
29
25
|
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"))
|
30
|
-
return Aws::Endpoints::Endpoint.new(url: "https://portal.sso-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
26
|
+
return Aws::Endpoints::Endpoint.new(url: "https://portal.sso-fips.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
31
27
|
end
|
32
28
|
raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
|
33
29
|
end
|
34
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
|
30
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true)
|
35
31
|
if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"))
|
36
32
|
if Aws::Endpoints::Matchers.string_equals?("aws-us-gov", Aws::Endpoints::Matchers.attr(partition_result, "name"))
|
37
|
-
return Aws::Endpoints::Endpoint.new(url: "https://portal.sso.#{region}.amazonaws.com", headers: {}, properties: {})
|
33
|
+
return Aws::Endpoints::Endpoint.new(url: "https://portal.sso.#{parameters.region}.amazonaws.com", headers: {}, properties: {})
|
38
34
|
end
|
39
|
-
return Aws::Endpoints::Endpoint.new(url: "https://portal.sso-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
35
|
+
return Aws::Endpoints::Endpoint.new(url: "https://portal.sso-fips.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
40
36
|
end
|
41
37
|
raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
|
42
38
|
end
|
43
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
39
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
|
44
40
|
if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
|
45
|
-
return Aws::Endpoints::Endpoint.new(url: "https://portal.sso.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
41
|
+
return Aws::Endpoints::Endpoint.new(url: "https://portal.sso.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
46
42
|
end
|
47
43
|
raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
|
48
44
|
end
|
49
|
-
return Aws::Endpoints::Endpoint.new(url: "https://portal.sso.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
45
|
+
return Aws::Endpoints::Endpoint.new(url: "https://portal.sso.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
50
46
|
end
|
51
47
|
end
|
52
48
|
raise ArgumentError, "Invalid Configuration: Missing Region"
|