aws-sdk-core 3.176.1 → 3.177.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6a876821436f937b2d49db79cb78a374e24cdb7dad61715d4113a9558930bb5
4
- data.tar.gz: ed84f2f3a77a651c58cb0cc71f66483b20e1f96f6e8f7b6b2001301263136845
3
+ metadata.gz: e27672fd173d6d117fd03b8c4f2d63be68f113727cf4d2aa0fcb1a310f94d329
4
+ data.tar.gz: '0329e77dd584bfe1142be767d7eb1dd3dfe80c4d2dc6f3382328fdfddaaadc11'
5
5
  SHA512:
6
- metadata.gz: 7391d189f34826cb514a222724eff6f4b1cee8d97d7be3ca9891b689ea854ee6175549e409933ceb2da3d54d6a5b18e8ce132a442b1ddb3a32b7c9922486df44
7
- data.tar.gz: bf69da8132d6940fb7d49742a22803160f5fb8d4e8cf90665e557af50cbbfec0f83756f4a5df40e378495eac88950c242937b7fbacf9e16d9b937b531f67df9e
6
+ metadata.gz: fd9aaf73cf5da342b331b394ab8f3cb9f2de5bdbbc195be122fbfab07911844583e0c10b53f0fc1dedd93f90d4ac21687ba8baa1f428eb546d08ad8ce47bbb31
7
+ data.tar.gz: 8010064f2bcf25b9c4b72ff7c6b9f9b5f2a6c33e3a81d053543a6b3817357952cfb196d80d875b8a1ef5c26f86287d1f98a8e97435eb04341f4247e911d24334
data/CHANGELOG.md CHANGED
@@ -1,6 +1,17 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 3.177.0 (2023-07-06)
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 - Add support for Request Compression.
14
+
4
15
  3.176.1 (2023-06-29)
5
16
  ------------------
6
17
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.176.1
1
+ 3.177.0
@@ -0,0 +1,217 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aws
4
+ module Plugins
5
+ # @api private
6
+ class RequestCompression < Seahorse::Client::Plugin
7
+ DEFAULT_MIN_COMPRESSION_SIZE = 10_240
8
+ MIN_COMPRESSION_SIZE_LIMIT = 10_485_760
9
+ SUPPORTED_ENCODINGS = %w[gzip].freeze
10
+ CHUNK_SIZE = 1 * 1024 * 1024 # one MB
11
+
12
+ option(
13
+ :disable_request_compression,
14
+ default: false,
15
+ doc_type: 'Boolean',
16
+ docstring: <<-DOCS) do |cfg|
17
+ When set to 'true' the request body will not be compressed
18
+ for supported operations.
19
+ DOCS
20
+ resolve_disable_request_compression(cfg)
21
+ end
22
+
23
+ option(
24
+ :request_min_compression_size_bytes,
25
+ default: 10_240,
26
+ doc_type: 'Integer',
27
+ docstring: <<-DOCS) do |cfg|
28
+ The minimum size in bytes that triggers compression for request
29
+ bodies. The value must be non-negative integer value between 0
30
+ and 10485780 bytes inclusive.
31
+ DOCS
32
+ resolve_request_min_compression_size_bytes(cfg)
33
+ end
34
+
35
+ def after_initialize(client)
36
+ validate_disable_request_compression_input(client.config)
37
+ validate_request_min_compression_size_bytes_input(client.config)
38
+ end
39
+
40
+ def validate_disable_request_compression_input(cfg)
41
+ unless [true, false].include?(cfg.disable_request_compression)
42
+ raise ArgumentError,
43
+ 'Must provide either `true` or `false` for the '\
44
+ '`disable_request_compression` configuration option.'
45
+ end
46
+ end
47
+
48
+ def validate_request_min_compression_size_bytes_input(cfg)
49
+ value = Integer(cfg.request_min_compression_size_bytes)
50
+ unless value.between?(0, MIN_COMPRESSION_SIZE_LIMIT)
51
+ raise ArgumentError,
52
+ 'Must provide a non-negative integer value between '\
53
+ '`0` and `10485760` bytes inclusive for the '\
54
+ '`request_min_compression_size_bytes` configuration option.'
55
+ end
56
+ end
57
+
58
+ def add_handlers(handlers, _config)
59
+ # priority set to ensure compression happens BEFORE checksum
60
+ handlers.add(CompressionHandler, priority: 16, step: :build)
61
+ end
62
+
63
+ class << self
64
+ private
65
+
66
+ def resolve_disable_request_compression(cfg)
67
+ value = ENV['AWS_DISABLE_REQUEST_COMPRESSION'] ||
68
+ Aws.shared_config.disable_request_compression(profile: cfg.profile) ||
69
+ 'false'
70
+ Aws::Util.str_2_bool(value)
71
+ end
72
+
73
+ def resolve_request_min_compression_size_bytes(cfg)
74
+ value = ENV['AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES'] ||
75
+ Aws.shared_config.request_min_compression_size_bytes(profile: cfg.profile) ||
76
+ DEFAULT_MIN_COMPRESSION_SIZE.to_s
77
+ Integer(value)
78
+ end
79
+ end
80
+
81
+ # @api private
82
+ class CompressionHandler < Seahorse::Client::Handler
83
+ def call(context)
84
+ if should_compress?(context)
85
+ selected_encoding = request_encoding_selection(context)
86
+ if selected_encoding
87
+ if streaming?(context.operation.input)
88
+ process_streaming_compression(selected_encoding, context)
89
+ elsif context.http_request.body.size >= context.config.request_min_compression_size_bytes
90
+ process_compression(selected_encoding, context)
91
+ end
92
+ end
93
+ end
94
+ @handler.call(context)
95
+ end
96
+
97
+ private
98
+
99
+ def request_encoding_selection(context)
100
+ encoding_list = context.operation.request_compression['encodings']
101
+ encoding_list.find { |encoding| RequestCompression::SUPPORTED_ENCODINGS.include?(encoding) }
102
+ end
103
+
104
+ def update_content_encoding(encoding, context)
105
+ headers = context.http_request.headers
106
+ if headers['Content-Encoding']
107
+ headers['Content-Encoding'] += ',' + encoding
108
+ else
109
+ headers['Content-Encoding'] = encoding
110
+ end
111
+ end
112
+
113
+ def should_compress?(context)
114
+ context.operation.request_compression &&
115
+ !context.config.disable_request_compression
116
+ end
117
+
118
+ def streaming?(input)
119
+ if payload = input[:payload_member] # checking ref and shape
120
+ payload['streaming'] || payload.shape['streaming']
121
+ else
122
+ false
123
+ end
124
+ end
125
+
126
+ def process_compression(encoding, context)
127
+ case encoding
128
+ when 'gzip'
129
+ gzip_compress(context)
130
+ else
131
+ raise StandardError, "We currently do not support #{encoding} encoding"
132
+ end
133
+ update_content_encoding(encoding, context)
134
+ end
135
+
136
+ def gzip_compress(context)
137
+ compressed = StringIO.new
138
+ compressed.binmode
139
+ gzip_writer = Zlib::GzipWriter.new(compressed)
140
+ if context.http_request.body.respond_to?(:read)
141
+ update_in_chunks(gzip_writer, context.http_request.body)
142
+ else
143
+ gzip_writer.write(context.http_request.body)
144
+ end
145
+ gzip_writer.close
146
+ new_body = StringIO.new(compressed.string)
147
+ context.http_request.body = new_body
148
+ end
149
+
150
+ def update_in_chunks(compressor, io)
151
+ loop do
152
+ chunk = io.read(CHUNK_SIZE)
153
+ break unless chunk
154
+
155
+ compressor.write(chunk)
156
+ end
157
+ end
158
+
159
+ def process_streaming_compression(encoding, context)
160
+ case encoding
161
+ when 'gzip'
162
+ context.http_request.body = GzipIO.new(context.http_request.body)
163
+ else
164
+ raise StandardError, "We currently do not support #{encoding} encoding"
165
+ end
166
+ update_content_encoding(encoding, context)
167
+ end
168
+
169
+ # @api private
170
+ class GzipIO
171
+ def initialize(body)
172
+ @body = body
173
+ @buffer = ChunkBuffer.new
174
+ @gzip_writer = Zlib::GzipWriter.new(@buffer)
175
+ end
176
+
177
+ def read(length, buff = nil)
178
+ if @gzip_writer.closed?
179
+ # an empty string to signify an end as
180
+ # there will be nothing remaining to be read
181
+ StringIO.new('').read(length, buff)
182
+ return
183
+ end
184
+
185
+ chunk = @body.read(length)
186
+ if !chunk || chunk.empty?
187
+ # closing the writer will write one last chunk
188
+ # with a trailer (to be read from the @buffer)
189
+ @gzip_writer.close
190
+ else
191
+ # flush happens first to ensure that header fields
192
+ # are being sent over since write will override
193
+ @gzip_writer.flush
194
+ @gzip_writer.write(chunk)
195
+ end
196
+
197
+ StringIO.new(@buffer.last_chunk).read(length, buff)
198
+ end
199
+ end
200
+
201
+ # @api private
202
+ class ChunkBuffer
203
+ def initialize
204
+ @last_chunk = nil
205
+ end
206
+
207
+ attr_reader :last_chunk
208
+
209
+ def write(data)
210
+ @last_chunk = data
211
+ end
212
+ end
213
+ end
214
+
215
+ end
216
+ end
217
+ end
@@ -198,7 +198,9 @@ module Aws
198
198
  :s3_us_east_1_regional_endpoint,
199
199
  :s3_disable_multiregion_access_points,
200
200
  :defaults_mode,
201
- :sdk_ua_app_id
201
+ :sdk_ua_app_id,
202
+ :disable_request_compression,
203
+ :request_min_compression_size_bytes
202
204
  )
203
205
 
204
206
  private
@@ -28,6 +28,7 @@ require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
28
28
  require 'aws-sdk-core/plugins/transfer_encoding.rb'
29
29
  require 'aws-sdk-core/plugins/http_checksum.rb'
30
30
  require 'aws-sdk-core/plugins/checksum_algorithm.rb'
31
+ require 'aws-sdk-core/plugins/request_compression.rb'
31
32
  require 'aws-sdk-core/plugins/defaults_mode.rb'
32
33
  require 'aws-sdk-core/plugins/recursion_detection.rb'
33
34
  require 'aws-sdk-core/plugins/sign.rb'
@@ -77,6 +78,7 @@ module Aws::SSO
77
78
  add_plugin(Aws::Plugins::TransferEncoding)
78
79
  add_plugin(Aws::Plugins::HttpChecksum)
79
80
  add_plugin(Aws::Plugins::ChecksumAlgorithm)
81
+ add_plugin(Aws::Plugins::RequestCompression)
80
82
  add_plugin(Aws::Plugins::DefaultsMode)
81
83
  add_plugin(Aws::Plugins::RecursionDetection)
82
84
  add_plugin(Aws::Plugins::Sign)
@@ -190,6 +192,10 @@ module Aws::SSO
190
192
  # Set to true to disable SDK automatically adding host prefix
191
193
  # to default service endpoint when available.
192
194
  #
195
+ # @option options [Boolean] :disable_request_compression (false)
196
+ # When set to 'true' the request body will not be compressed
197
+ # for supported operations.
198
+ #
193
199
  # @option options [String] :endpoint
194
200
  # The client endpoint is normally constructed from the `:region`
195
201
  # option. You should only configure an `:endpoint` when connecting
@@ -230,6 +236,11 @@ module Aws::SSO
230
236
  # Used when loading credentials from the shared credentials file
231
237
  # at HOME/.aws/credentials. When not specified, 'default' is used.
232
238
  #
239
+ # @option options [Integer] :request_min_compression_size_bytes (10240)
240
+ # The minimum size in bytes that triggers compression for request
241
+ # bodies. The value must be non-negative integer value between 0
242
+ # and 10485780 bytes inclusive.
243
+ #
233
244
  # @option options [Proc] :retry_backoff
234
245
  # A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
235
246
  # This option is only used in the `legacy` retry mode.
@@ -590,7 +601,7 @@ module Aws::SSO
590
601
  params: params,
591
602
  config: config)
592
603
  context[:gem_name] = 'aws-sdk-core'
593
- context[:gem_version] = '3.176.1'
604
+ context[:gem_version] = '3.177.0'
594
605
  Seahorse::Client::Request.new(handlers, context)
595
606
  end
596
607
 
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.176.1'
57
+ GEM_VERSION = '3.177.0'
58
58
 
59
59
  end
@@ -28,6 +28,7 @@ require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
28
28
  require 'aws-sdk-core/plugins/transfer_encoding.rb'
29
29
  require 'aws-sdk-core/plugins/http_checksum.rb'
30
30
  require 'aws-sdk-core/plugins/checksum_algorithm.rb'
31
+ require 'aws-sdk-core/plugins/request_compression.rb'
31
32
  require 'aws-sdk-core/plugins/defaults_mode.rb'
32
33
  require 'aws-sdk-core/plugins/recursion_detection.rb'
33
34
  require 'aws-sdk-core/plugins/sign.rb'
@@ -77,6 +78,7 @@ module Aws::SSOOIDC
77
78
  add_plugin(Aws::Plugins::TransferEncoding)
78
79
  add_plugin(Aws::Plugins::HttpChecksum)
79
80
  add_plugin(Aws::Plugins::ChecksumAlgorithm)
81
+ add_plugin(Aws::Plugins::RequestCompression)
80
82
  add_plugin(Aws::Plugins::DefaultsMode)
81
83
  add_plugin(Aws::Plugins::RecursionDetection)
82
84
  add_plugin(Aws::Plugins::Sign)
@@ -190,6 +192,10 @@ module Aws::SSOOIDC
190
192
  # Set to true to disable SDK automatically adding host prefix
191
193
  # to default service endpoint when available.
192
194
  #
195
+ # @option options [Boolean] :disable_request_compression (false)
196
+ # When set to 'true' the request body will not be compressed
197
+ # for supported operations.
198
+ #
193
199
  # @option options [String] :endpoint
194
200
  # The client endpoint is normally constructed from the `:region`
195
201
  # option. You should only configure an `:endpoint` when connecting
@@ -230,6 +236,11 @@ module Aws::SSOOIDC
230
236
  # Used when loading credentials from the shared credentials file
231
237
  # at HOME/.aws/credentials. When not specified, 'default' is used.
232
238
  #
239
+ # @option options [Integer] :request_min_compression_size_bytes (10240)
240
+ # The minimum size in bytes that triggers compression for request
241
+ # bodies. The value must be non-negative integer value between 0
242
+ # and 10485780 bytes inclusive.
243
+ #
233
244
  # @option options [Proc] :retry_backoff
234
245
  # A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
235
246
  # This option is only used in the `legacy` retry mode.
@@ -586,7 +597,7 @@ module Aws::SSOOIDC
586
597
  params: params,
587
598
  config: config)
588
599
  context[:gem_name] = 'aws-sdk-core'
589
- context[:gem_version] = '3.176.1'
600
+ context[:gem_version] = '3.177.0'
590
601
  Seahorse::Client::Request.new(handlers, context)
591
602
  end
592
603
 
@@ -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.176.1'
57
+ GEM_VERSION = '3.177.0'
58
58
 
59
59
  end
@@ -28,6 +28,7 @@ require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
28
28
  require 'aws-sdk-core/plugins/transfer_encoding.rb'
29
29
  require 'aws-sdk-core/plugins/http_checksum.rb'
30
30
  require 'aws-sdk-core/plugins/checksum_algorithm.rb'
31
+ require 'aws-sdk-core/plugins/request_compression.rb'
31
32
  require 'aws-sdk-core/plugins/defaults_mode.rb'
32
33
  require 'aws-sdk-core/plugins/recursion_detection.rb'
33
34
  require 'aws-sdk-core/plugins/sign.rb'
@@ -78,6 +79,7 @@ module Aws::STS
78
79
  add_plugin(Aws::Plugins::TransferEncoding)
79
80
  add_plugin(Aws::Plugins::HttpChecksum)
80
81
  add_plugin(Aws::Plugins::ChecksumAlgorithm)
82
+ add_plugin(Aws::Plugins::RequestCompression)
81
83
  add_plugin(Aws::Plugins::DefaultsMode)
82
84
  add_plugin(Aws::Plugins::RecursionDetection)
83
85
  add_plugin(Aws::Plugins::Sign)
@@ -192,6 +194,10 @@ module Aws::STS
192
194
  # Set to true to disable SDK automatically adding host prefix
193
195
  # to default service endpoint when available.
194
196
  #
197
+ # @option options [Boolean] :disable_request_compression (false)
198
+ # When set to 'true' the request body will not be compressed
199
+ # for supported operations.
200
+ #
195
201
  # @option options [String] :endpoint
196
202
  # The client endpoint is normally constructed from the `:region`
197
203
  # option. You should only configure an `:endpoint` when connecting
@@ -232,6 +238,11 @@ module Aws::STS
232
238
  # Used when loading credentials from the shared credentials file
233
239
  # at HOME/.aws/credentials. When not specified, 'default' is used.
234
240
  #
241
+ # @option options [Integer] :request_min_compression_size_bytes (10240)
242
+ # The minimum size in bytes that triggers compression for request
243
+ # bodies. The value must be non-negative integer value between 0
244
+ # and 10485780 bytes inclusive.
245
+ #
235
246
  # @option options [Proc] :retry_backoff
236
247
  # A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
237
248
  # This option is only used in the `legacy` retry mode.
@@ -2319,7 +2330,7 @@ module Aws::STS
2319
2330
  params: params,
2320
2331
  config: config)
2321
2332
  context[:gem_name] = 'aws-sdk-core'
2322
- context[:gem_version] = '3.176.1'
2333
+ context[:gem_version] = '3.177.0'
2323
2334
  Seahorse::Client::Request.new(handlers, context)
2324
2335
  end
2325
2336
 
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.176.1'
57
+ GEM_VERSION = '3.177.0'
58
58
 
59
59
  end
@@ -28,6 +28,9 @@ module Seahorse
28
28
  # @return [Hash]
29
29
  attr_accessor :http_checksum
30
30
 
31
+ # @return [Hash]
32
+ attr_accessor :request_compression
33
+
31
34
  # @return [Boolean]
32
35
  attr_accessor :deprecated
33
36
 
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.176.1
4
+ version: 3.177.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-06-29 00:00:00.000000000 Z
11
+ date: 2023-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath
@@ -185,6 +185,7 @@ files:
185
185
  - lib/aws-sdk-core/plugins/protocols/rest_xml.rb
186
186
  - lib/aws-sdk-core/plugins/recursion_detection.rb
187
187
  - lib/aws-sdk-core/plugins/regional_endpoint.rb
188
+ - lib/aws-sdk-core/plugins/request_compression.rb
188
189
  - lib/aws-sdk-core/plugins/response_paging.rb
189
190
  - lib/aws-sdk-core/plugins/retries/client_rate_limiter.rb
190
191
  - lib/aws-sdk-core/plugins/retries/clock_skew.rb