aws-sdk-core 3.203.0 → 3.207.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7bf46cc1c58aa2eab7feaaaa91a1c3042a3fcb9737f8b752e92a2075b20c18e7
4
- data.tar.gz: 36d04c3b40f2b9e6a235ed726c6a8bc47d6b5245204ab5cac2fd16a373602dd6
3
+ metadata.gz: a63894f219adadc4bcde19d3476c76b008c42d68397b5226b749450b09636410
4
+ data.tar.gz: 5548f6777eac7439ae36dd37725e3c0b476337c4a8cd3543739e65723d100f12
5
5
  SHA512:
6
- metadata.gz: 696a9df19fd3f81a85d9fdc77300ab98d13ad7aec127d892f2a81ac7994aa324d0a92164fecd63462440c11056781642a44b379e14a1f2c029b32a8c0a5c0f76
7
- data.tar.gz: 1255facb9c4205650241f60f2469e89cc576b522f01aacb1907cf57b7c4d7bddcb28ae269b25b4608412e45b5afbd61ec1c367840aa022de7e4a208de595a3ef
6
+ metadata.gz: 0dcdd4ecb00a84ad875c4a778e327ed9d025cf0db509e2998c388d4a67f1b5f68f0940bd3ea28d4dddf8caa738855e71f0b2aae31ba7d8ce4f245515b7bb34ca
7
+ data.tar.gz: 5df63f1e46f77d3c1e577dd8008f38005fd16c1d1289d9c79e053aa7e65a2d662c73bd376bda36674986bb35e13d2c426ecc94f3d256d1e7c59940d54d3dea1b
data/CHANGELOG.md CHANGED
@@ -1,6 +1,46 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 3.207.0 (2024-09-20)
5
+ ------------------
6
+
7
+ * Feature - Updated Aws::STS::Client with the latest API changes.
8
+
9
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
10
+
11
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
12
+
13
+ * Feature - Support Account ID credentials using `ENV['AWS_ACCOUNT_ID']`, `aws_account_id` shared config, or the `account_id` Client configuration option.
14
+
15
+ * Feature - Support Account ID endpoint mode using `ENV['AWS_ACCOUNT_ID_ENDPOINT_MODE']`, `aws_account_id_endpoint_mode` shared config, or the `account_id_endpoint_mode` Client configuration option. Defaults to `preferred`, which will use the account id endpoint if available. Set to `disabled` to disable account id endpoints. Set to `required` to require account id endpoint usage; an error is raised if credentials do not have an account id.
16
+
17
+ 3.206.0 (2024-09-17)
18
+ ------------------
19
+
20
+ * Feature - Support `sigv4a` endpoint auth without CRT.
21
+
22
+ 3.205.0 (2024-09-11)
23
+ ------------------
24
+
25
+ * Feature - Updated Aws::STS::Client with the latest API changes.
26
+
27
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
28
+
29
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
30
+
31
+ * Issue - Additional metrics collection in the User-Agent plugin.
32
+
33
+ 3.204.0 (2024-09-10)
34
+ ------------------
35
+
36
+ * Feature - Updated Aws::STS::Client with the latest API changes.
37
+
38
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
39
+
40
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
41
+
42
+ * Issue - Add support for `ssl_cert` and `ssl_key` configuration options to support mTLS.
43
+
4
44
  3.203.0 (2024-09-03)
5
45
  ------------------
6
46
 
@@ -37,6 +77,7 @@ Unreleased Changes
37
77
  ------------------
38
78
 
39
79
  * Issue - Allow legacy/undocumented `sigv4_signer` configuration to override resolved signer.
80
+
40
81
  * Issue - Consider sigv4a supported without crt check.
41
82
 
42
83
  3.201.4 (2024-08-08)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.203.0
1
+ 3.207.0
@@ -62,13 +62,15 @@ module Aws
62
62
  private
63
63
 
64
64
  def refresh
65
- c = @client.assume_role(@assume_role_params).credentials
65
+ c = @client.assume_role(@assume_role_params)
66
+ creds = c.credentials
66
67
  @credentials = Credentials.new(
67
- c.access_key_id,
68
- c.secret_access_key,
69
- c.session_token
68
+ creds.access_key_id,
69
+ creds.secret_access_key,
70
+ creds.session_token,
71
+ account_id: ARNParser.parse(c.assumed_role_user.arn).account_id
70
72
  )
71
- @expiration = c.expiration
73
+ @expiration = creds.expiration
72
74
  end
73
75
 
74
76
  class << self
@@ -60,7 +60,7 @@ module Aws
60
60
  # not provided, generate encoded UUID as session name
61
61
  @assume_role_web_identity_params[:role_session_name] = _session_name
62
62
  end
63
- @client = client_opts[:client] || STS::Client.new(client_opts.merge(credentials: false))
63
+ @client = client_opts[:client] || STS::Client.new(client_opts.merge(credentials: nil))
64
64
  super
65
65
  end
66
66
 
@@ -73,14 +73,15 @@ module Aws
73
73
  # read from token file everytime it refreshes
74
74
  @assume_role_web_identity_params[:web_identity_token] = _token_from_file(@token_file)
75
75
 
76
- c = @client.assume_role_with_web_identity(
77
- @assume_role_web_identity_params).credentials
76
+ c = @client.assume_role_with_web_identity(@assume_role_web_identity_params)
77
+ creds = c.credentials
78
78
  @credentials = Credentials.new(
79
- c.access_key_id,
80
- c.secret_access_key,
81
- c.session_token
79
+ creds.access_key_id,
80
+ creds.secret_access_key,
81
+ creds.session_token,
82
+ account_id: ARNParser.parse(c.assumed_role_user.arn).account_id
82
83
  )
83
- @expiration = c.expiration
84
+ @expiration = creds.expiration
84
85
  end
85
86
 
86
87
  def _token_from_file(path)
@@ -45,7 +45,8 @@ module Aws
45
45
  Credentials.new(
46
46
  options[:config].access_key_id,
47
47
  options[:config].secret_access_key,
48
- options[:config].session_token
48
+ options[:config].session_token,
49
+ account_id: options[:config].account_id
49
50
  )
50
51
  end
51
52
  end
@@ -94,7 +95,13 @@ module Aws
94
95
  key = %w[AWS_ACCESS_KEY_ID AMAZON_ACCESS_KEY_ID AWS_ACCESS_KEY]
95
96
  secret = %w[AWS_SECRET_ACCESS_KEY AMAZON_SECRET_ACCESS_KEY AWS_SECRET_KEY]
96
97
  token = %w[AWS_SESSION_TOKEN AMAZON_SESSION_TOKEN]
97
- Credentials.new(envar(key), envar(secret), envar(token))
98
+ account_id = %w[AWS_ACCOUNT_ID]
99
+ Credentials.new(
100
+ envar(key),
101
+ envar(secret),
102
+ envar(token),
103
+ account_id: envar(account_id)
104
+ )
98
105
  end
99
106
 
100
107
  def envar(keys)
@@ -6,21 +6,28 @@ module Aws
6
6
  # @param [String] access_key_id
7
7
  # @param [String] secret_access_key
8
8
  # @param [String] session_token (nil)
9
- def initialize(access_key_id, secret_access_key, session_token = nil)
9
+ # @param [Hash] kwargs
10
+ # @option kwargs [String] :credential_scope (nil)
11
+ def initialize(access_key_id, secret_access_key, session_token = nil,
12
+ **kwargs)
10
13
  @access_key_id = access_key_id
11
14
  @secret_access_key = secret_access_key
12
15
  @session_token = session_token
16
+ @account_id = kwargs[:account_id]
13
17
  end
14
18
 
15
- # @return [String, nil]
19
+ # @return [String]
16
20
  attr_reader :access_key_id
17
21
 
18
- # @return [String, nil]
22
+ # @return [String]
19
23
  attr_reader :secret_access_key
20
24
 
21
25
  # @return [String, nil]
22
26
  attr_reader :session_token
23
27
 
28
+ # @return [String, nil]
29
+ attr_reader :account_id
30
+
24
31
  # @return [Credentials]
25
32
  def credentials
26
33
  self
@@ -30,9 +37,9 @@ module Aws
30
37
  # access key are both set.
31
38
  def set?
32
39
  !access_key_id.nil? &&
33
- !access_key_id.empty? &&
34
- !secret_access_key.nil? &&
35
- !secret_access_key.empty?
40
+ !access_key_id.empty? &&
41
+ !secret_access_key.nil? &&
42
+ !secret_access_key.empty?
36
43
  end
37
44
 
38
45
  # Removing the secret access key from the default inspect string.
@@ -3,15 +3,17 @@
3
3
  module Aws
4
4
  module Endpoints
5
5
  class Endpoint
6
- def initialize(url:, properties: {}, headers: {})
6
+ def initialize(url:, properties: {}, headers: {}, metadata: {})
7
7
  @url = url
8
8
  @properties = properties
9
9
  @headers = headers
10
+ @metadata = metadata
10
11
  end
11
12
 
12
13
  attr_reader :url
13
14
  attr_reader :properties
14
15
  attr_reader :headers
16
+ attr_reader :metadata
15
17
  end
16
18
  end
17
19
  end
@@ -19,9 +19,12 @@ require 'aws-sigv4'
19
19
  module Aws
20
20
  # @api private
21
21
  module Endpoints
22
- supported_auth_traits = %w[aws.auth#sigv4 smithy.api#httpBearerAuth smithy.api#noAuth]
23
- supported_auth_traits += ['aws.auth#sigv4a'] if Aws::Sigv4::Signer.use_crt?
24
- SUPPORTED_AUTH_TRAITS = supported_auth_traits.freeze
22
+ SUPPORTED_AUTH_TRAITS = %w[
23
+ aws.auth#sigv4
24
+ aws.auth#sigv4a
25
+ smithy.api#httpBearerAuth
26
+ smithy.api#noAuth
27
+ ].freeze
25
28
 
26
29
  class << self
27
30
  def resolve_auth_scheme(context, endpoint)
@@ -12,6 +12,8 @@ module Aws
12
12
 
13
13
  option(:session_token, doc_type: String, docstring: '')
14
14
 
15
+ option(:account_id, doc_type: String, docstring: '')
16
+
15
17
  option(:profile,
16
18
  doc_default: 'default',
17
19
  doc_type: String,
@@ -58,13 +60,15 @@ When `:credentials` are not configured directly, the following
58
60
  locations will be searched for credentials:
59
61
 
60
62
  * `Aws.config[:credentials]`
61
- * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
62
- * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
63
+ * The `:access_key_id`, `:secret_access_key`, `:session_token`, and
64
+ `:account_id` options.
65
+ * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'],
66
+ ENV['AWS_SESSION_TOKEN'], and ENV['AWS_ACCOUNT_ID']
63
67
  * `~/.aws/credentials`
64
68
  * `~/.aws/config`
65
69
  * EC2/ECS IMDS instance profile - When used by default, the timeouts
66
70
  are very aggressive. Construct and pass an instance of
67
- `Aws::InstanceProfileCredentails` or `Aws::ECSCredentials` to
71
+ `Aws::InstanceProfileCredentials` or `Aws::ECSCredentials` to
68
72
  enable retries and extended timeouts. Instance profile credential
69
73
  fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED']
70
74
  to true.
@@ -205,6 +205,7 @@ to test or custom endpoints. This should be a valid HTTP(S) URI.
205
205
  cfg.override_config(:region, new_region)
206
206
  end
207
207
  end
208
+
208
209
  # set a default endpoint in config using legacy (endpoints.json) resolver
209
210
  def resolve_legacy_endpoint(cfg)
210
211
  endpoint_prefix = cfg.api.metadata['endpointPrefix']
@@ -17,7 +17,15 @@ module Aws
17
17
  "S3_CRYPTO_V2": "I",
18
18
  "S3_EXPRESS_BUCKET": "J",
19
19
  "S3_ACCESS_GRANTS": "K",
20
- "GZIP_REQUEST_COMPRESSION": "L"
20
+ "GZIP_REQUEST_COMPRESSION": "L",
21
+ "PROTOCOL_RPC_V2_CBOR": "M",
22
+ "ENDPOINT_OVERRIDE": "N",
23
+ "ACCOUNT_ID_ENDPOINT": "O",
24
+ "ACCOUNT_ID_MODE_PREFERRED": "P",
25
+ "ACCOUNT_ID_MODE_DISABLED": "Q",
26
+ "ACCOUNT_ID_MODE_REQUIRED": "R",
27
+ "SIGV4A_SIGNING": "S",
28
+ "RESOLVED_ACCOUNT_ID": "T"
21
29
  }
22
30
  METRICS
23
31
 
@@ -45,15 +53,13 @@ variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
45
53
  block.call
46
54
  end
47
55
 
48
- def self.metric(metric, &block)
56
+ def self.metric(*metrics, &block)
49
57
  Thread.current[:aws_sdk_core_user_agent_metric] ||= []
50
- Thread.current[:aws_sdk_core_user_agent_metric] << METRICS[metric]
58
+ metrics = metrics.map { |metric| METRICS[metric] }.compact
59
+ Thread.current[:aws_sdk_core_user_agent_metric].concat(metrics)
51
60
  block.call
52
61
  ensure
53
- Thread.current[:aws_sdk_core_user_agent_metric].pop
54
- if Thread.current[:aws_sdk_core_user_agent_metric].empty?
55
- Thread.current[:aws_sdk_core_user_agent_metric] = nil
56
- end
62
+ Thread.current[:aws_sdk_core_user_agent_metric].pop(metrics.size)
57
63
  end
58
64
 
59
65
  # @api private
@@ -166,7 +172,10 @@ variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
166
172
  end
167
173
 
168
174
  def metric_metadata
169
- return unless Thread.current[:aws_sdk_core_user_agent_metric]
175
+ if Thread.current[:aws_sdk_core_user_agent_metric].nil? ||
176
+ Thread.current[:aws_sdk_core_user_agent_metric].empty?
177
+ return
178
+ end
170
179
 
171
180
  metrics = Thread.current[:aws_sdk_core_user_agent_metric].join(',')
172
181
  # Metric metadata is limited to 1024 bytes
@@ -74,7 +74,8 @@ module Aws
74
74
  creds = Credentials.new(
75
75
  creds_json['AccessKeyId'],
76
76
  creds_json['SecretAccessKey'],
77
- creds_json['SessionToken']
77
+ creds_json['SessionToken'],
78
+ account_id: creds_json['AccountId']
78
79
  )
79
80
 
80
81
  @expiration = creds_json['Expiration'] ? Time.iso8601(creds_json['Expiration']) : nil
@@ -7,7 +7,7 @@ module Aws
7
7
  # @return [Seahorse::Client::Response]
8
8
  def call(context)
9
9
  build_request(context)
10
- response = @handler.call(context)
10
+ response = with_metric { @handler.call(context) }
11
11
  response.on(200..299) { |resp| resp.data = parse_body(context) }
12
12
  response.on(200..599) { |_resp| apply_request_id(context) }
13
13
  response
@@ -15,6 +15,10 @@ module Aws
15
15
 
16
16
  private
17
17
 
18
+ def with_metric(&block)
19
+ Aws::Plugins::UserAgent.metric('PROTOCOL_RPC_V2_CBOR', &block)
20
+ end
21
+
18
22
  def build_request(context)
19
23
  context.http_request.headers['smithy-protocol'] = 'rpc-v2-cbor'
20
24
  context.http_request.http_method = 'POST'
@@ -198,6 +198,7 @@ module Aws
198
198
 
199
199
  config_reader(
200
200
  :region,
201
+ :account_id_endpoint_mode,
201
202
  :sigv4a_signing_region_set,
202
203
  :ca_bundle,
203
204
  :credential_process,
@@ -414,7 +415,8 @@ module Aws
414
415
  creds = Credentials.new(
415
416
  prof_config['aws_access_key_id'],
416
417
  prof_config['aws_secret_access_key'],
417
- prof_config['aws_session_token']
418
+ prof_config['aws_session_token'],
419
+ account_id: prof_config['aws_account_id']
418
420
  )
419
421
  creds if creds.set?
420
422
  end
@@ -7,13 +7,6 @@ module Aws
7
7
 
8
8
  include CredentialProvider
9
9
 
10
- # @api private
11
- KEY_MAP = {
12
- 'aws_access_key_id' => 'access_key_id',
13
- 'aws_secret_access_key' => 'secret_access_key',
14
- 'aws_session_token' => 'session_token',
15
- }
16
-
17
10
  # Constructs a new SharedCredentials object. This will load static
18
11
  # (access_key_id, secret_access_key and session_token) AWS access
19
12
  # credentials from an ini file, which supports profiles. The default
@@ -156,7 +156,8 @@ module Aws
156
156
  @credentials = Credentials.new(
157
157
  c.access_key_id,
158
158
  c.secret_access_key,
159
- c.session_token
159
+ c.session_token,
160
+ account_id: @sso_account_id
160
161
  )
161
162
  @expiration = Time.at(c.expiration / 1000.0)
162
163
  end
@@ -130,13 +130,15 @@ module Aws::SSO
130
130
  # locations will be searched for credentials:
131
131
  #
132
132
  # * `Aws.config[:credentials]`
133
- # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
134
- # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
133
+ # * The `:access_key_id`, `:secret_access_key`, `:session_token`, and
134
+ # `:account_id` options.
135
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'],
136
+ # ENV['AWS_SESSION_TOKEN'], and ENV['AWS_ACCOUNT_ID']
135
137
  # * `~/.aws/credentials`
136
138
  # * `~/.aws/config`
137
139
  # * EC2/ECS IMDS instance profile - When used by default, the timeouts
138
140
  # are very aggressive. Construct and pass an instance of
139
- # `Aws::InstanceProfileCredentails` or `Aws::ECSCredentials` to
141
+ # `Aws::InstanceProfileCredentials` or `Aws::ECSCredentials` to
140
142
  # enable retries and extended timeouts. Instance profile credential
141
143
  # fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED']
142
144
  # to true.
@@ -155,6 +157,8 @@ module Aws::SSO
155
157
  #
156
158
  # @option options [String] :access_key_id
157
159
  #
160
+ # @option options [String] :account_id
161
+ #
158
162
  # @option options [Boolean] :active_endpoint_cache (false)
159
163
  # When set to `true`, a thread polling for endpoints will be running in
160
164
  # the background every 60 secs (default). Defaults to `false`.
@@ -369,7 +373,9 @@ module Aws::SSO
369
373
  # sending the request.
370
374
  #
371
375
  # @option options [Aws::SSO::EndpointProvider] :endpoint_provider
372
- # 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`
376
+ # The endpoint provider used to resolve endpoints. Any object that responds to
377
+ # `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
378
+ # `Aws::SSO::EndpointParameters`.
373
379
  #
374
380
  # @option options [Float] :http_continue_timeout (1)
375
381
  # The number of seconds to wait for a 100-continue response before sending the
@@ -425,6 +431,12 @@ module Aws::SSO
425
431
  # @option options [String] :ssl_ca_store
426
432
  # Sets the X509::Store to verify peer certificate.
427
433
  #
434
+ # @option options [OpenSSL::X509::Certificate] :ssl_cert
435
+ # Sets a client certificate when creating http connections.
436
+ #
437
+ # @option options [OpenSSL::PKey] :ssl_key
438
+ # Sets a client key when creating http connections.
439
+ #
428
440
  # @option options [Float] :ssl_timeout
429
441
  # Sets the SSL timeout in seconds
430
442
  #
@@ -659,7 +671,7 @@ module Aws::SSO
659
671
  tracer: tracer
660
672
  )
661
673
  context[:gem_name] = 'aws-sdk-core'
662
- context[:gem_version] = '3.203.0'
674
+ context[:gem_version] = '3.207.0'
663
675
  Seahorse::Client::Request.new(handlers, context)
664
676
  end
665
677
 
@@ -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
data/lib/aws-sdk-sso.rb CHANGED
@@ -54,6 +54,6 @@ require_relative 'aws-sdk-sso/customizations'
54
54
  # @!group service
55
55
  module Aws::SSO
56
56
 
57
- GEM_VERSION = '3.203.0'
57
+ GEM_VERSION = '3.207.0'
58
58
 
59
59
  end
@@ -130,13 +130,15 @@ module Aws::SSOOIDC
130
130
  # locations will be searched for credentials:
131
131
  #
132
132
  # * `Aws.config[:credentials]`
133
- # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
134
- # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
133
+ # * The `:access_key_id`, `:secret_access_key`, `:session_token`, and
134
+ # `:account_id` options.
135
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'],
136
+ # ENV['AWS_SESSION_TOKEN'], and ENV['AWS_ACCOUNT_ID']
135
137
  # * `~/.aws/credentials`
136
138
  # * `~/.aws/config`
137
139
  # * EC2/ECS IMDS instance profile - When used by default, the timeouts
138
140
  # are very aggressive. Construct and pass an instance of
139
- # `Aws::InstanceProfileCredentails` or `Aws::ECSCredentials` to
141
+ # `Aws::InstanceProfileCredentials` or `Aws::ECSCredentials` to
140
142
  # enable retries and extended timeouts. Instance profile credential
141
143
  # fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED']
142
144
  # to true.
@@ -155,6 +157,8 @@ module Aws::SSOOIDC
155
157
  #
156
158
  # @option options [String] :access_key_id
157
159
  #
160
+ # @option options [String] :account_id
161
+ #
158
162
  # @option options [Boolean] :active_endpoint_cache (false)
159
163
  # When set to `true`, a thread polling for endpoints will be running in
160
164
  # the background every 60 secs (default). Defaults to `false`.
@@ -369,7 +373,9 @@ module Aws::SSOOIDC
369
373
  # sending the request.
370
374
  #
371
375
  # @option options [Aws::SSOOIDC::EndpointProvider] :endpoint_provider
372
- # The endpoint provider used to resolve endpoints. Any object that responds to `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::SSOOIDC::EndpointParameters`
376
+ # The endpoint provider used to resolve endpoints. Any object that responds to
377
+ # `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
378
+ # `Aws::SSOOIDC::EndpointParameters`.
373
379
  #
374
380
  # @option options [Float] :http_continue_timeout (1)
375
381
  # The number of seconds to wait for a 100-continue response before sending the
@@ -425,6 +431,12 @@ module Aws::SSOOIDC
425
431
  # @option options [String] :ssl_ca_store
426
432
  # Sets the X509::Store to verify peer certificate.
427
433
  #
434
+ # @option options [OpenSSL::X509::Certificate] :ssl_cert
435
+ # Sets a client certificate when creating http connections.
436
+ #
437
+ # @option options [OpenSSL::PKey] :ssl_key
438
+ # Sets a client key when creating http connections.
439
+ #
428
440
  # @option options [Float] :ssl_timeout
429
441
  # Sets the SSL timeout in seconds
430
442
  #
@@ -1012,7 +1024,7 @@ module Aws::SSOOIDC
1012
1024
  tracer: tracer
1013
1025
  )
1014
1026
  context[:gem_name] = 'aws-sdk-core'
1015
- context[:gem_version] = '3.203.0'
1027
+ context[:gem_version] = '3.207.0'
1016
1028
  Seahorse::Client::Request.new(handlers, context)
1017
1029
  end
1018
1030
 
@@ -14,56 +14,44 @@ module Aws::SSOOIDC
14
14
 
15
15
  class CreateToken
16
16
  def self.build(context)
17
- unless context.config.regional_endpoint
18
- endpoint = context.config.endpoint.to_s
19
- end
20
17
  Aws::SSOOIDC::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 CreateTokenWithIAM
30
27
  def self.build(context)
31
- unless context.config.regional_endpoint
32
- endpoint = context.config.endpoint.to_s
33
- end
34
28
  Aws::SSOOIDC::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 RegisterClient
44
38
  def self.build(context)
45
- unless context.config.regional_endpoint
46
- endpoint = context.config.endpoint.to_s
47
- end
48
39
  Aws::SSOOIDC::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 StartDeviceAuthorization
58
49
  def self.build(context)
59
- unless context.config.regional_endpoint
60
- endpoint = context.config.endpoint.to_s
61
- end
62
50
  Aws::SSOOIDC::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::SSOOIDC
15
15
  :endpoint_provider,
16
16
  doc_type: 'Aws::SSOOIDC::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::SSOOIDC::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::SSOOIDC::EndpointParameters`.
22
+ DOCS
23
23
  Aws::SSOOIDC::EndpointProvider.new
24
24
  end
25
25
 
@@ -40,11 +40,23 @@ module Aws::SSOOIDC
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
@@ -54,6 +54,6 @@ require_relative 'aws-sdk-ssooidc/customizations'
54
54
  # @!group service
55
55
  module Aws::SSOOIDC
56
56
 
57
- GEM_VERSION = '3.203.0'
57
+ GEM_VERSION = '3.207.0'
58
58
 
59
59
  end
@@ -132,13 +132,15 @@ module Aws::STS
132
132
  # locations will be searched for credentials:
133
133
  #
134
134
  # * `Aws.config[:credentials]`
135
- # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
136
- # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
135
+ # * The `:access_key_id`, `:secret_access_key`, `:session_token`, and
136
+ # `:account_id` options.
137
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'],
138
+ # ENV['AWS_SESSION_TOKEN'], and ENV['AWS_ACCOUNT_ID']
137
139
  # * `~/.aws/credentials`
138
140
  # * `~/.aws/config`
139
141
  # * EC2/ECS IMDS instance profile - When used by default, the timeouts
140
142
  # are very aggressive. Construct and pass an instance of
141
- # `Aws::InstanceProfileCredentails` or `Aws::ECSCredentials` to
143
+ # `Aws::InstanceProfileCredentials` or `Aws::ECSCredentials` to
142
144
  # enable retries and extended timeouts. Instance profile credential
143
145
  # fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED']
144
146
  # to true.
@@ -157,6 +159,8 @@ module Aws::STS
157
159
  #
158
160
  # @option options [String] :access_key_id
159
161
  #
162
+ # @option options [String] :account_id
163
+ #
160
164
  # @option options [Boolean] :active_endpoint_cache (false)
161
165
  # When set to `true`, a thread polling for endpoints will be running in
162
166
  # the background every 60 secs (default). Defaults to `false`.
@@ -376,7 +380,9 @@ module Aws::STS
376
380
  # sending the request.
377
381
  #
378
382
  # @option options [Aws::STS::EndpointProvider] :endpoint_provider
379
- # The endpoint provider used to resolve endpoints. Any object that responds to `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::STS::EndpointParameters`
383
+ # The endpoint provider used to resolve endpoints. Any object that responds to
384
+ # `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
385
+ # `Aws::STS::EndpointParameters`.
380
386
  #
381
387
  # @option options [Float] :http_continue_timeout (1)
382
388
  # The number of seconds to wait for a 100-continue response before sending the
@@ -432,6 +438,12 @@ module Aws::STS
432
438
  # @option options [String] :ssl_ca_store
433
439
  # Sets the X509::Store to verify peer certificate.
434
440
  #
441
+ # @option options [OpenSSL::X509::Certificate] :ssl_cert
442
+ # Sets a client certificate when creating http connections.
443
+ #
444
+ # @option options [OpenSSL::PKey] :ssl_key
445
+ # Sets a client key when creating http connections.
446
+ #
435
447
  # @option options [Float] :ssl_timeout
436
448
  # Sets the SSL timeout in seconds
437
449
  #
@@ -2406,7 +2418,7 @@ module Aws::STS
2406
2418
  tracer: tracer
2407
2419
  )
2408
2420
  context[:gem_name] = 'aws-sdk-core'
2409
- context[:gem_version] = '3.203.0'
2421
+ context[:gem_version] = '3.207.0'
2410
2422
  Seahorse::Client::Request.new(handlers, context)
2411
2423
  end
2412
2424
 
@@ -14,14 +14,11 @@ module Aws::STS
14
14
 
15
15
  class AssumeRole
16
16
  def self.build(context)
17
- unless context.config.regional_endpoint
18
- endpoint = context.config.endpoint.to_s
19
- end
20
17
  Aws::STS::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
  use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
26
23
  )
27
24
  end
@@ -29,14 +26,11 @@ module Aws::STS
29
26
 
30
27
  class AssumeRoleWithSAML
31
28
  def self.build(context)
32
- unless context.config.regional_endpoint
33
- endpoint = context.config.endpoint.to_s
34
- end
35
29
  Aws::STS::EndpointParameters.new(
36
30
  region: context.config.region,
37
31
  use_dual_stack: context.config.use_dualstack_endpoint,
38
32
  use_fips: context.config.use_fips_endpoint,
39
- endpoint: endpoint,
33
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
40
34
  use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
41
35
  )
42
36
  end
@@ -44,14 +38,11 @@ module Aws::STS
44
38
 
45
39
  class AssumeRoleWithWebIdentity
46
40
  def self.build(context)
47
- unless context.config.regional_endpoint
48
- endpoint = context.config.endpoint.to_s
49
- end
50
41
  Aws::STS::EndpointParameters.new(
51
42
  region: context.config.region,
52
43
  use_dual_stack: context.config.use_dualstack_endpoint,
53
44
  use_fips: context.config.use_fips_endpoint,
54
- endpoint: endpoint,
45
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
55
46
  use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
56
47
  )
57
48
  end
@@ -59,14 +50,11 @@ module Aws::STS
59
50
 
60
51
  class DecodeAuthorizationMessage
61
52
  def self.build(context)
62
- unless context.config.regional_endpoint
63
- endpoint = context.config.endpoint.to_s
64
- end
65
53
  Aws::STS::EndpointParameters.new(
66
54
  region: context.config.region,
67
55
  use_dual_stack: context.config.use_dualstack_endpoint,
68
56
  use_fips: context.config.use_fips_endpoint,
69
- endpoint: endpoint,
57
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
70
58
  use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
71
59
  )
72
60
  end
@@ -74,14 +62,11 @@ module Aws::STS
74
62
 
75
63
  class GetAccessKeyInfo
76
64
  def self.build(context)
77
- unless context.config.regional_endpoint
78
- endpoint = context.config.endpoint.to_s
79
- end
80
65
  Aws::STS::EndpointParameters.new(
81
66
  region: context.config.region,
82
67
  use_dual_stack: context.config.use_dualstack_endpoint,
83
68
  use_fips: context.config.use_fips_endpoint,
84
- endpoint: endpoint,
69
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
85
70
  use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
86
71
  )
87
72
  end
@@ -89,14 +74,11 @@ module Aws::STS
89
74
 
90
75
  class GetCallerIdentity
91
76
  def self.build(context)
92
- unless context.config.regional_endpoint
93
- endpoint = context.config.endpoint.to_s
94
- end
95
77
  Aws::STS::EndpointParameters.new(
96
78
  region: context.config.region,
97
79
  use_dual_stack: context.config.use_dualstack_endpoint,
98
80
  use_fips: context.config.use_fips_endpoint,
99
- endpoint: endpoint,
81
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
100
82
  use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
101
83
  )
102
84
  end
@@ -104,14 +86,11 @@ module Aws::STS
104
86
 
105
87
  class GetFederationToken
106
88
  def self.build(context)
107
- unless context.config.regional_endpoint
108
- endpoint = context.config.endpoint.to_s
109
- end
110
89
  Aws::STS::EndpointParameters.new(
111
90
  region: context.config.region,
112
91
  use_dual_stack: context.config.use_dualstack_endpoint,
113
92
  use_fips: context.config.use_fips_endpoint,
114
- endpoint: endpoint,
93
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
115
94
  use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
116
95
  )
117
96
  end
@@ -119,14 +98,11 @@ module Aws::STS
119
98
 
120
99
  class GetSessionToken
121
100
  def self.build(context)
122
- unless context.config.regional_endpoint
123
- endpoint = context.config.endpoint.to_s
124
- end
125
101
  Aws::STS::EndpointParameters.new(
126
102
  region: context.config.region,
127
103
  use_dual_stack: context.config.use_dualstack_endpoint,
128
104
  use_fips: context.config.use_fips_endpoint,
129
- endpoint: endpoint,
105
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
130
106
  use_global_endpoint: context.config.sts_regional_endpoints == 'legacy',
131
107
  )
132
108
  end
@@ -15,11 +15,11 @@ module Aws::STS
15
15
  :endpoint_provider,
16
16
  doc_type: 'Aws::STS::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::STS::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::STS::EndpointParameters`.
22
+ DOCS
23
23
  Aws::STS::EndpointProvider.new
24
24
  end
25
25
 
@@ -40,11 +40,23 @@ module Aws::STS
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
data/lib/aws-sdk-sts.rb CHANGED
@@ -54,6 +54,6 @@ require_relative 'aws-sdk-sts/customizations'
54
54
  # @!group service
55
55
  module Aws::STS
56
56
 
57
- GEM_VERSION = '3.203.0'
57
+ GEM_VERSION = '3.207.0'
58
58
 
59
59
  end
@@ -34,7 +34,9 @@ module Seahorse
34
34
  ssl_ca_bundle: nil,
35
35
  ssl_ca_directory: nil,
36
36
  ssl_ca_store: nil,
37
- ssl_timeout: nil
37
+ ssl_timeout: nil,
38
+ ssl_cert: nil,
39
+ ssl_key: nil
38
40
  }
39
41
 
40
42
  # @api private
@@ -246,7 +248,9 @@ module Seahorse
246
248
  :ssl_ca_bundle => options[:ssl_ca_bundle],
247
249
  :ssl_ca_directory => options[:ssl_ca_directory],
248
250
  :ssl_ca_store => options[:ssl_ca_store],
249
- :ssl_timeout => options[:ssl_timeout]
251
+ :ssl_timeout => options[:ssl_timeout],
252
+ :ssl_cert => options[:ssl_cert],
253
+ :ssl_key => options[:ssl_key]
250
254
  }
251
255
  end
252
256
 
@@ -291,6 +295,8 @@ module Seahorse
291
295
  http.ca_file = ssl_ca_bundle if ssl_ca_bundle
292
296
  http.ca_path = ssl_ca_directory if ssl_ca_directory
293
297
  http.cert_store = ssl_ca_store if ssl_ca_store
298
+ http.cert = ssl_cert if ssl_cert
299
+ http.key = ssl_key if ssl_key
294
300
  else
295
301
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
296
302
  end
@@ -70,6 +70,15 @@ Sets the X509::Store to verify peer certificate.
70
70
  resolve_ssl_timeout(cfg)
71
71
  end
72
72
 
73
+ option(:ssl_cert, default: nil, doc_type: OpenSSL::X509::Certificate, docstring: <<-DOCS)
74
+ Sets a client certificate when creating http connections.
75
+ DOCS
76
+
77
+
78
+ option(:ssl_key, default: nil, doc_type: OpenSSL::PKey, docstring: <<-DOCS)
79
+ Sets a client key when creating http connections.
80
+ DOCS
81
+
73
82
  option(:logger) # for backwards compat
74
83
 
75
84
  handler(Client::NetHttp::Handler, step: :send)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.203.0
4
+ version: 3.207.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-03 00:00:00.000000000 Z
11
+ date: 2024-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath