aws-sdk-core 3.201.3 → 3.209.1

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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +113 -0
  3. data/VERSION +1 -1
  4. data/lib/aws-defaults.rb +4 -1
  5. data/lib/aws-sdk-core/assume_role_credentials.rb +12 -5
  6. data/lib/aws-sdk-core/assume_role_web_identity_credentials.rb +13 -7
  7. data/lib/aws-sdk-core/client_side_monitoring.rb +9 -0
  8. data/lib/aws-sdk-core/credential_provider_chain.rb +9 -2
  9. data/lib/aws-sdk-core/credentials.rb +13 -6
  10. data/lib/aws-sdk-core/endpoints/endpoint.rb +3 -1
  11. data/lib/aws-sdk-core/endpoints.rb +6 -3
  12. data/lib/aws-sdk-core/log.rb +10 -0
  13. data/lib/aws-sdk-core/plugins/credentials_configuration.rb +7 -3
  14. data/lib/aws-sdk-core/plugins/regional_endpoint.rb +1 -0
  15. data/lib/aws-sdk-core/plugins/sign.rb +2 -3
  16. data/lib/aws-sdk-core/plugins/stub_responses.rb +29 -2
  17. data/lib/aws-sdk-core/plugins/telemetry.rb +75 -0
  18. data/lib/aws-sdk-core/plugins/user_agent.rb +17 -8
  19. data/lib/aws-sdk-core/plugins.rb +39 -0
  20. data/lib/aws-sdk-core/process_credentials.rb +2 -1
  21. data/lib/aws-sdk-core/resources.rb +8 -0
  22. data/lib/aws-sdk-core/rpc_v2/handler.rb +5 -1
  23. data/lib/aws-sdk-core/shared_config.rb +3 -1
  24. data/lib/aws-sdk-core/shared_credentials.rb +0 -7
  25. data/lib/aws-sdk-core/sso_credentials.rb +2 -1
  26. data/lib/aws-sdk-core/stubbing.rb +22 -0
  27. data/lib/aws-sdk-core/telemetry/base.rb +177 -0
  28. data/lib/aws-sdk-core/telemetry/no_op.rb +70 -0
  29. data/lib/aws-sdk-core/telemetry/otel.rb +235 -0
  30. data/lib/aws-sdk-core/telemetry/span_kind.rb +22 -0
  31. data/lib/aws-sdk-core/telemetry/span_status.rb +59 -0
  32. data/lib/aws-sdk-core/telemetry.rb +78 -0
  33. data/lib/aws-sdk-core/waiters/poller.rb +9 -4
  34. data/lib/aws-sdk-core.rb +82 -112
  35. data/lib/aws-sdk-sso/client.rb +35 -8
  36. data/lib/aws-sdk-sso/client_api.rb +1 -0
  37. data/lib/aws-sdk-sso/endpoints.rb +4 -16
  38. data/lib/aws-sdk-sso/plugins/endpoints.rb +18 -6
  39. data/lib/aws-sdk-sso/types.rb +1 -0
  40. data/lib/aws-sdk-sso.rb +15 -11
  41. data/lib/aws-sdk-ssooidc/client.rb +35 -8
  42. data/lib/aws-sdk-ssooidc/client_api.rb +1 -0
  43. data/lib/aws-sdk-ssooidc/endpoints.rb +4 -16
  44. data/lib/aws-sdk-ssooidc/plugins/endpoints.rb +18 -6
  45. data/lib/aws-sdk-ssooidc/types.rb +1 -0
  46. data/lib/aws-sdk-ssooidc.rb +15 -11
  47. data/lib/aws-sdk-sts/client.rb +35 -8
  48. data/lib/aws-sdk-sts/client_api.rb +1 -0
  49. data/lib/aws-sdk-sts/customizations.rb +5 -1
  50. data/lib/aws-sdk-sts/endpoints.rb +8 -32
  51. data/lib/aws-sdk-sts/plugins/endpoints.rb +18 -6
  52. data/lib/aws-sdk-sts/types.rb +1 -0
  53. data/lib/aws-sdk-sts.rb +15 -11
  54. data/lib/seahorse/client/h2/handler.rb +13 -3
  55. data/lib/seahorse/client/net_http/connection_pool.rb +8 -2
  56. data/lib/seahorse/client/net_http/handler.rb +21 -9
  57. data/lib/seahorse/client/plugins/net_http.rb +9 -0
  58. data/lib/seahorse/client/request_context.rb +8 -1
  59. data/sig/aws-sdk-core/telemetry/base.rbs +46 -0
  60. data/sig/aws-sdk-core/telemetry/otel.rbs +22 -0
  61. data/sig/aws-sdk-core/telemetry/span_kind.rbs +15 -0
  62. data/sig/aws-sdk-core/telemetry/span_status.rbs +24 -0
  63. metadata +20 -4
@@ -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
@@ -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 trival (bad) example of a waiter that polls indefinetly.
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
- Aws::Errors::ServiceError === response.error &&
100
- response.error.code == acceptor['expected'].delete('.')
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 === values && values.count > 0 ? yield(values) : false
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
- CORE_GEM_VERSION = File.read(File.expand_path('../../VERSION', __FILE__)).strip
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'
@@ -32,11 +32,10 @@ require 'aws-sdk-core/plugins/checksum_algorithm.rb'
32
32
  require 'aws-sdk-core/plugins/request_compression.rb'
33
33
  require 'aws-sdk-core/plugins/defaults_mode.rb'
34
34
  require 'aws-sdk-core/plugins/recursion_detection.rb'
35
+ require 'aws-sdk-core/plugins/telemetry.rb'
35
36
  require 'aws-sdk-core/plugins/sign.rb'
36
37
  require 'aws-sdk-core/plugins/protocols/rest_json.rb'
37
38
 
38
- Aws::Plugins::GlobalConfiguration.add_identifier(:sso)
39
-
40
39
  module Aws::SSO
41
40
  # An API client for SSO. To construct a client, you need to configure a `:region` and `:credentials`.
42
41
  #
@@ -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`, and `:session_token` options.
132
- # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
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::InstanceProfileCredentails` or `Aws::ECSCredentials` to
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`.
@@ -330,6 +334,16 @@ module Aws::SSO
330
334
  # ** Please note ** When response stubbing is enabled, no HTTP
331
335
  # requests are made, and retries are disabled.
332
336
  #
337
+ # @option options [Aws::Telemetry::TelemetryProviderBase] :telemetry_provider (Aws::Telemetry::NoOpTelemetryProvider)
338
+ # Allows you to provide a telemetry provider, which is used to
339
+ # emit telemetry data. By default, uses `NoOpTelemetryProvider` which
340
+ # will not record or emit any telemetry data. The SDK supports the
341
+ # following telemetry providers:
342
+ #
343
+ # * OpenTelemetry (OTel) - To use the OTel provider, install and require the
344
+ # `opentelemetry-sdk` gem and then, pass in an instance of a
345
+ # `Aws::Telemetry::OTelProvider` for telemetry provider.
346
+ #
333
347
  # @option options [Aws::TokenProvider] :token_provider
334
348
  # A Bearer Token Provider. This can be an instance of any one of the
335
349
  # following classes:
@@ -357,7 +371,9 @@ module Aws::SSO
357
371
  # sending the request.
358
372
  #
359
373
  # @option options [Aws::SSO::EndpointProvider] :endpoint_provider
360
- # 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`
374
+ # The endpoint provider used to resolve endpoints. Any object that responds to
375
+ # `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
376
+ # `Aws::SSO::EndpointParameters`.
361
377
  #
362
378
  # @option options [Float] :http_continue_timeout (1)
363
379
  # The number of seconds to wait for a 100-continue response before sending the
@@ -413,6 +429,12 @@ module Aws::SSO
413
429
  # @option options [String] :ssl_ca_store
414
430
  # Sets the X509::Store to verify peer certificate.
415
431
  #
432
+ # @option options [OpenSSL::X509::Certificate] :ssl_cert
433
+ # Sets a client certificate when creating http connections.
434
+ #
435
+ # @option options [OpenSSL::PKey] :ssl_key
436
+ # Sets a client key when creating http connections.
437
+ #
416
438
  # @option options [Float] :ssl_timeout
417
439
  # Sets the SSL timeout in seconds
418
440
  #
@@ -635,14 +657,19 @@ module Aws::SSO
635
657
  # @api private
636
658
  def build_request(operation_name, params = {})
637
659
  handlers = @handlers.for(operation_name)
660
+ tracer = config.telemetry_provider.tracer_provider.tracer(
661
+ Aws::Telemetry.module_to_tracer_name('Aws::SSO')
662
+ )
638
663
  context = Seahorse::Client::RequestContext.new(
639
664
  operation_name: operation_name,
640
665
  operation: config.api.operation(operation_name),
641
666
  client: self,
642
667
  params: params,
643
- config: config)
668
+ config: config,
669
+ tracer: tracer
670
+ )
644
671
  context[:gem_name] = 'aws-sdk-core'
645
- context[:gem_version] = '3.201.3'
672
+ context[:gem_version] = '3.209.1'
646
673
  Seahorse::Client::Request.new(handlers, context)
647
674
  end
648
675
 
@@ -7,6 +7,7 @@
7
7
  #
8
8
  # WARNING ABOUT GENERATED CODE
9
9
 
10
+
10
11
  module Aws::SSO
11
12
  # @api private
12
13
  module ClientApi
@@ -14,56 +14,44 @@ module Aws::SSO
14
14
 
15
15
  class GetRoleCredentials
16
16
  def self.build(context)
17
- unless context.config.regional_endpoint
18
- endpoint = context.config.endpoint.to_s
19
- end
20
17
  Aws::SSO::EndpointParameters.new(
21
18
  region: context.config.region,
22
19
  use_dual_stack: context.config.use_dualstack_endpoint,
23
20
  use_fips: context.config.use_fips_endpoint,
24
- endpoint: endpoint,
21
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
25
22
  )
26
23
  end
27
24
  end
28
25
 
29
26
  class ListAccountRoles
30
27
  def self.build(context)
31
- unless context.config.regional_endpoint
32
- endpoint = context.config.endpoint.to_s
33
- end
34
28
  Aws::SSO::EndpointParameters.new(
35
29
  region: context.config.region,
36
30
  use_dual_stack: context.config.use_dualstack_endpoint,
37
31
  use_fips: context.config.use_fips_endpoint,
38
- endpoint: endpoint,
32
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
39
33
  )
40
34
  end
41
35
  end
42
36
 
43
37
  class ListAccounts
44
38
  def self.build(context)
45
- unless context.config.regional_endpoint
46
- endpoint = context.config.endpoint.to_s
47
- end
48
39
  Aws::SSO::EndpointParameters.new(
49
40
  region: context.config.region,
50
41
  use_dual_stack: context.config.use_dualstack_endpoint,
51
42
  use_fips: context.config.use_fips_endpoint,
52
- endpoint: endpoint,
43
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
53
44
  )
54
45
  end
55
46
  end
56
47
 
57
48
  class Logout
58
49
  def self.build(context)
59
- unless context.config.regional_endpoint
60
- endpoint = context.config.endpoint.to_s
61
- end
62
50
  Aws::SSO::EndpointParameters.new(
63
51
  region: context.config.region,
64
52
  use_dual_stack: context.config.use_dualstack_endpoint,
65
53
  use_fips: context.config.use_fips_endpoint,
66
- endpoint: endpoint,
54
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
67
55
  )
68
56
  end
69
57
  end
@@ -15,11 +15,11 @@ module Aws::SSO
15
15
  :endpoint_provider,
16
16
  doc_type: 'Aws::SSO::EndpointProvider',
17
17
  rbs_type: 'untyped',
18
- docstring: 'The endpoint provider used to resolve endpoints. Any '\
19
- 'object that responds to `#resolve_endpoint(parameters)` '\
20
- 'where `parameters` is a Struct similar to '\
21
- '`Aws::SSO::EndpointParameters`'
22
- ) do |cfg|
18
+ docstring: <<~DOCS) do |_cfg|
19
+ The endpoint provider used to resolve endpoints. Any object that responds to
20
+ `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
21
+ `Aws::SSO::EndpointParameters`.
22
+ DOCS
23
23
  Aws::SSO::EndpointProvider.new
24
24
  end
25
25
 
@@ -40,11 +40,23 @@ module Aws::SSO
40
40
  context[:auth_scheme] =
41
41
  Aws::Endpoints.resolve_auth_scheme(context, endpoint)
42
42
 
43
- @handler.call(context)
43
+ with_metrics(context) { @handler.call(context) }
44
44
  end
45
45
 
46
46
  private
47
47
 
48
+ def with_metrics(context, &block)
49
+ metrics = []
50
+ metrics << 'ENDPOINT_OVERRIDE' unless context.config.regional_endpoint
51
+ if context[:auth_scheme] && context[:auth_scheme]['name'] == 'sigv4a'
52
+ metrics << 'SIGV4A_SIGNING'
53
+ end
54
+ if context.config.credentials&.credentials&.account_id
55
+ metrics << 'RESOLVED_ACCOUNT_ID'
56
+ end
57
+ Aws::Plugins::UserAgent.metric(*metrics, &block)
58
+ end
59
+
48
60
  def apply_endpoint_headers(context, headers)
49
61
  headers.each do |key, values|
50
62
  value = values
@@ -315,3 +315,4 @@ module Aws::SSO
315
315
 
316
316
  end
317
317
  end
318
+
data/lib/aws-sdk-sso.rb CHANGED
@@ -13,16 +13,7 @@ unless Module.const_defined?(:Aws)
13
13
  require 'aws-sigv4'
14
14
  end
15
15
 
16
- require_relative 'aws-sdk-sso/types'
17
- require_relative 'aws-sdk-sso/client_api'
18
- require_relative 'aws-sdk-sso/plugins/endpoints.rb'
19
- require_relative 'aws-sdk-sso/client'
20
- require_relative 'aws-sdk-sso/errors'
21
- require_relative 'aws-sdk-sso/resource'
22
- require_relative 'aws-sdk-sso/endpoint_parameters'
23
- require_relative 'aws-sdk-sso/endpoint_provider'
24
- require_relative 'aws-sdk-sso/endpoints'
25
- require_relative 'aws-sdk-sso/customizations'
16
+ Aws::Plugins::GlobalConfiguration.add_identifier(:sso)
26
17
 
27
18
  # This module provides support for AWS Single Sign-On. This module is available in the
28
19
  # `aws-sdk-core` gem.
@@ -53,7 +44,20 @@ require_relative 'aws-sdk-sso/customizations'
53
44
  #
54
45
  # @!group service
55
46
  module Aws::SSO
47
+ autoload :Types, 'aws-sdk-sso/types'
48
+ autoload :ClientApi, 'aws-sdk-sso/client_api'
49
+ module Plugins
50
+ autoload :Endpoints, 'aws-sdk-sso/plugins/endpoints.rb'
51
+ end
52
+ autoload :Client, 'aws-sdk-sso/client'
53
+ autoload :Errors, 'aws-sdk-sso/errors'
54
+ autoload :Resource, 'aws-sdk-sso/resource'
55
+ autoload :EndpointParameters, 'aws-sdk-sso/endpoint_parameters'
56
+ autoload :EndpointProvider, 'aws-sdk-sso/endpoint_provider'
57
+ autoload :Endpoints, 'aws-sdk-sso/endpoints'
56
58
 
57
- GEM_VERSION = '3.201.3'
59
+ GEM_VERSION = '3.209.1'
58
60
 
59
61
  end
62
+
63
+ require_relative 'aws-sdk-sso/customizations'