aws-sdk-core 3.173.1 → 3.174.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: 8a894a8fe85e4f69dec182fc6f18a3dae49ae5ef9ecc91eb404e555098692964
4
- data.tar.gz: 364fa57f088c9d15a450e6de2de3554e50fac98f764de451cc2d890bead5a420
3
+ metadata.gz: d4ecec9eaf3fee0d30bdd88558775c3553537df9dfd3fe4f62b694cba78b7991
4
+ data.tar.gz: f99bff124648f74105f216af8de264e71151357a4ec645531d5c59dcfc696ef9
5
5
  SHA512:
6
- metadata.gz: c381bf0f39f79c2dd992c4f20b4ffacd682dbe226be85fdb261cc5d654b703e9933e70eea27c1b91a16165e9a817731b1b20647bd15ca09162775035e6aea16b
7
- data.tar.gz: b72446b6983d65b96baba7248eba2dc00bca0a1a5c4ac96ad3d7c7a008fb95354d17182ae184abb59874130e96136e7bdb8ed4b9df987619761420903bce16a6
6
+ metadata.gz: 2753ea337d9adde1dab3fbe9d72fbb3f31e9a8061e1a7be017f0eb48a1b56958edd03f8b84c2d634ff10254e4a7a565b40163739497420d5171affd6c880600f
7
+ data.tar.gz: 767e58ebbbf1f3e95e835f86cffda3bc4ed9ba99f5fdc663fcb65c0996f15df918f30a6f27b8cf70b2c888a4dc315c9338c717508bc98f5e75b3f3568ff7a00b
data/CHANGELOG.md CHANGED
@@ -1,6 +1,17 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 3.174.0 (2023-05-31)
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 - Improve User-Agent metrics tracking.
14
+
4
15
  3.173.1 (2023-05-24)
5
16
  ------------------
6
17
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.173.1
1
+ 3.174.0
@@ -201,7 +201,9 @@ module Aws
201
201
  def next_response(params)
202
202
  params = next_page_params(params)
203
203
  request = context.client.build_request(context.operation_name, params)
204
- request.send_request
204
+ Aws::Plugins::UserAgent.feature('paginator') do
205
+ request.send_request
206
+ end
205
207
  end
206
208
 
207
209
  def next_page_params(params)
@@ -4,7 +4,31 @@ module Aws
4
4
  module Plugins
5
5
  # @api private
6
6
  class UserAgent < Seahorse::Client::Plugin
7
+ # @api private
7
8
  option(:user_agent_suffix)
9
+ # @api private
10
+ option(:user_agent_frameworks, default: [])
11
+
12
+ option(
13
+ :sdk_ua_app_id,
14
+ doc_type: 'String',
15
+ docstring: <<-DOCS) do |cfg|
16
+ A unique and opaque application ID that is appended to the
17
+ User-Agent header as app/<sdk_ua_app_id>. It should have a
18
+ maximum length of 50.
19
+ DOCS
20
+ app_id = ENV['AWS_SDK_UA_APP_ID']
21
+ app_id ||= Aws.shared_config.sdk_ua_app_id(profile: cfg.profile)
22
+ app_id
23
+ end
24
+
25
+ def self.feature(feature, &block)
26
+ Thread.current[:aws_sdk_core_user_agent_feature] ||= []
27
+ Thread.current[:aws_sdk_core_user_agent_feature] << "ft/#{feature}"
28
+ block.call
29
+ ensure
30
+ Thread.current[:aws_sdk_core_user_agent_feature].pop
31
+ end
8
32
 
9
33
  # @api private
10
34
  class Handler < Seahorse::Client::Handler
@@ -14,33 +38,112 @@ module Aws
14
38
  end
15
39
 
16
40
  def set_user_agent(context)
17
- ua = "aws-sdk-ruby3/#{CORE_GEM_VERSION}"
41
+ context.http_request.headers['User-Agent'] = UserAgent.new(context).to_s
42
+ end
43
+
44
+ class UserAgent
45
+ def initialize(context)
46
+ @context = context
47
+ end
48
+
49
+ def to_s
50
+ ua = "aws-sdk-ruby3/#{CORE_GEM_VERSION}"
51
+ ua += ' ua/2.0'
52
+ ua += " #{api_metadata}" if api_metadata
53
+ ua += " #{os_metadata}"
54
+ ua += " #{language_metadata}"
55
+ ua += " #{env_metadata}" if env_metadata
56
+ ua += " #{config_metadata}" if config_metadata
57
+ ua += " #{app_id}" if app_id
58
+ ua += " #{feature_metadata}" if feature_metadata
59
+ ua += " #{framework_metadata}" if framework_metadata
60
+ if @context.config.user_agent_suffix
61
+ ua += " #{@context.config.user_agent_suffix}"
62
+ end
63
+ ua.strip
64
+ end
65
+
66
+ private
18
67
 
19
- begin
20
- ua += " #{RUBY_ENGINE}/#{RUBY_VERSION}"
21
- rescue
22
- ua += " RUBY_ENGINE_NA/#{RUBY_VERSION}"
68
+ # Used to be gem_name/gem_version
69
+ def api_metadata
70
+ service_id = @context.config.api.metadata['serviceId']
71
+ return unless service_id
72
+
73
+ service_id = service_id.gsub(' ', '_').downcase
74
+ gem_version = @context[:gem_version]
75
+ "api/#{service_id}##{gem_version}"
76
+ end
77
+
78
+ # Used to be RUBY_PLATFORM
79
+ def os_metadata
80
+ os =
81
+ case RbConfig::CONFIG['host_os']
82
+ when /mac|darwin/
83
+ 'macos'
84
+ when /linux|cygwin/
85
+ 'linux'
86
+ when /mingw|mswin/
87
+ 'windows'
88
+ else
89
+ 'other'
90
+ end
91
+ metadata = "os/#{os}"
92
+ local_version = Gem::Platform.local.version
93
+ metadata += "##{local_version}" if local_version
94
+ metadata += " md/#{RbConfig::CONFIG['host_cpu']}"
95
+ metadata
23
96
  end
24
97
 
25
- ua += " #{RUBY_PLATFORM}"
98
+ # Used to be RUBY_ENGINE/RUBY_VERSION
99
+ def language_metadata
100
+ "lang/#{RUBY_ENGINE}##{RUBY_ENGINE_VERSION} md/#{RUBY_VERSION}"
101
+ end
102
+
103
+ def env_metadata
104
+ return unless (execution_env = ENV['AWS_EXECUTION_ENV'])
105
+
106
+ "exec-env/#{execution_env}"
107
+ end
26
108
 
27
- if context[:gem_name] && context[:gem_version]
28
- ua += " #{context[:gem_name]}/#{context[:gem_version]}"
109
+ def config_metadata
110
+ "cfg/retry-mode##{@context.config.retry_mode}"
29
111
  end
30
112
 
31
- if (execution_env = ENV['AWS_EXECUTION_ENV'])
32
- ua += " exec-env/#{execution_env}"
113
+ def app_id
114
+ return unless (app_id = @context.config.sdk_ua_app_id)
115
+
116
+ # Sanitize and only allow these characters
117
+ app_id = app_id.gsub(/[^!#$%&'*+\-.^_`|~0-9A-Za-z]/, '-')
118
+ "app/#{app_id}"
33
119
  end
34
120
 
35
- if context.config.user_agent_suffix
36
- ua += " #{context.config.user_agent_suffix}"
121
+ def feature_metadata
122
+ return unless Thread.current[:aws_sdk_core_user_agent_feature]
123
+
124
+ Thread.current[:aws_sdk_core_user_agent_feature].join(' ')
37
125
  end
38
126
 
39
- context.http_request.headers['User-Agent'] = ua.strip
127
+ def framework_metadata
128
+ if (frameworks_cfg = @context.config.user_agent_frameworks).empty?
129
+ return
130
+ end
131
+
132
+ # Frameworks may be aws-record, aws-sdk-rails, etc.
133
+ regex = /gems\/(?<name>#{frameworks_cfg.join('|')})-(?<version>\d+\.\d+\.\d+)/.freeze
134
+ frameworks = {}
135
+ Kernel.caller.each do |line|
136
+ match = line.match(regex)
137
+ next unless match
138
+
139
+ frameworks[match[:name]] = match[:version]
140
+ end
141
+ frameworks.map { |n, v| "lib/#{n}##{v}" }.join(' ')
142
+ end
40
143
  end
41
144
  end
42
145
 
43
- handler(Handler)
146
+ handler(Handler, priority: 1)
44
147
  end
45
148
  end
46
149
  end
@@ -197,7 +197,8 @@ module Aws
197
197
  :s3_use_arn_region,
198
198
  :s3_us_east_1_regional_endpoint,
199
199
  :s3_disable_multiregion_access_points,
200
- :defaults_mode
200
+ :defaults_mode,
201
+ :sdk_ua_app_id
201
202
  )
202
203
 
203
204
  private
@@ -62,7 +62,9 @@ module Aws
62
62
  def send_request(options)
63
63
  req = options[:client].build_request(@operation_name, options[:params])
64
64
  req.handlers.remove(RAISE_HANDLER)
65
- req.send_request
65
+ Aws::Plugins::UserAgent.feature('waiter') do
66
+ req.send_request
67
+ end
66
68
  end
67
69
 
68
70
  def acceptor_matches?(acceptor, response)
@@ -275,6 +275,11 @@ module Aws::SSO
275
275
  # in the future.
276
276
  #
277
277
  #
278
+ # @option options [String] :sdk_ua_app_id
279
+ # A unique and opaque application ID that is appended to the
280
+ # User-Agent header as app/<sdk_ua_app_id>. It should have a
281
+ # maximum length of 50.
282
+ #
278
283
  # @option options [String] :secret_access_key
279
284
  #
280
285
  # @option options [String] :session_token
@@ -585,7 +590,7 @@ module Aws::SSO
585
590
  params: params,
586
591
  config: config)
587
592
  context[:gem_name] = 'aws-sdk-core'
588
- context[:gem_version] = '3.173.1'
593
+ context[:gem_version] = '3.174.0'
589
594
  Seahorse::Client::Request.new(handlers, context)
590
595
  end
591
596
 
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.173.1'
57
+ GEM_VERSION = '3.174.0'
58
58
 
59
59
  end
@@ -275,6 +275,11 @@ module Aws::SSOOIDC
275
275
  # in the future.
276
276
  #
277
277
  #
278
+ # @option options [String] :sdk_ua_app_id
279
+ # A unique and opaque application ID that is appended to the
280
+ # User-Agent header as app/<sdk_ua_app_id>. It should have a
281
+ # maximum length of 50.
282
+ #
278
283
  # @option options [String] :secret_access_key
279
284
  #
280
285
  # @option options [String] :session_token
@@ -581,7 +586,7 @@ module Aws::SSOOIDC
581
586
  params: params,
582
587
  config: config)
583
588
  context[:gem_name] = 'aws-sdk-core'
584
- context[:gem_version] = '3.173.1'
589
+ context[:gem_version] = '3.174.0'
585
590
  Seahorse::Client::Request.new(handlers, context)
586
591
  end
587
592
 
@@ -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.173.1'
57
+ GEM_VERSION = '3.174.0'
58
58
 
59
59
  end
@@ -277,6 +277,11 @@ module Aws::STS
277
277
  # in the future.
278
278
  #
279
279
  #
280
+ # @option options [String] :sdk_ua_app_id
281
+ # A unique and opaque application ID that is appended to the
282
+ # User-Agent header as app/<sdk_ua_app_id>. It should have a
283
+ # maximum length of 50.
284
+ #
280
285
  # @option options [String] :secret_access_key
281
286
  #
282
287
  # @option options [String] :session_token
@@ -2314,7 +2319,7 @@ module Aws::STS
2314
2319
  params: params,
2315
2320
  config: config)
2316
2321
  context[:gem_name] = 'aws-sdk-core'
2317
- context[:gem_version] = '3.173.1'
2322
+ context[:gem_version] = '3.174.0'
2318
2323
  Seahorse::Client::Request.new(handlers, context)
2319
2324
  end
2320
2325
 
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.173.1'
57
+ GEM_VERSION = '3.174.0'
58
58
 
59
59
  end
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.173.1
4
+ version: 3.174.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: 2023-05-24 00:00:00.000000000 Z
11
+ date: 2023-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath