aws-sdk-s3 1.111.1 → 1.111.2

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: 38f76aeff028d48361d6a37f648b6035f02251a9cf48fddeba1ae687bd518a10
4
- data.tar.gz: ef1db30e3ea4005a508022155596cfd0a2f99e0878845013830b3fca977235f5
3
+ metadata.gz: c4b9969b0cc2ef0c3aa57e20cb70ca2980642eb62f03dafbb5d8938a58e0a78c
4
+ data.tar.gz: f2906d9902a3c605cd88f1c8a30d40d0da8873ef112543081d92de2e17e3e252
5
5
  SHA512:
6
- metadata.gz: 3620be3214f229605b2cc10ab633d3b73875b3b1b2b6fa379255301f892cc48a128ee4d8c8141cce33d997aa041efb4117ed7c54fa3067a94eaf81e94f8a19b5
7
- data.tar.gz: b72e254e2555044f4ff6a6a031852d0c6688f4f1a116a0f5922035781a55b431c415b160a58c78d242db8b11f300ff04e17f9f18b65c912a36e5d4ebba9aad77
6
+ metadata.gz: 45eb5902e3c9cea6e93663a2ee896dfd30e7dcd293f6147efe0dc97619fa4c426556d3c3f69b3acc6a1aee00484e23d4c65a46aa55115fb88f9b9095ebda3318
7
+ data.tar.gz: 1e543e87ea98242d1568479957dcd0c071e8c3798e999d79a4c541c5786397183f4f2e7238cd033cdefa6d04870f800afe1d7d1a05b2a461b560880290f4801a
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.111.2 (2022-01-20)
5
+ ------------------
6
+
7
+ * Issue - Minor cleanups.
8
+
4
9
  1.111.1 (2022-01-06)
5
10
  ------------------
6
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.111.1
1
+ 1.111.2
@@ -14216,7 +14216,7 @@ module Aws::S3
14216
14216
  params: params,
14217
14217
  config: config)
14218
14218
  context[:gem_name] = 'aws-sdk-s3'
14219
- context[:gem_version] = '1.111.1'
14219
+ context[:gem_version] = '1.111.2'
14220
14220
  Seahorse::Client::Request.new(handlers, context)
14221
14221
  end
14222
14222
 
@@ -134,7 +134,7 @@ module Aws
134
134
  def write(resp)
135
135
  range, _ = resp.content_range.split(' ').last.split('/')
136
136
  head, _ = range.split('-').map {|s| s.to_i}
137
- IO.write(@path, resp.body.read, head)
137
+ File.write(@path, resp.body.read, head)
138
138
  end
139
139
 
140
140
  def single_request
@@ -176,6 +176,7 @@ module Aws
176
176
  # ```
177
177
  #
178
178
  class PresignedPost
179
+ @@allowed_fields = []
179
180
 
180
181
  # @param [Credentials] credentials Security credentials for signing
181
182
  # the post policy.
@@ -247,7 +248,12 @@ module Aws
247
248
  case option_name
248
249
  when :allow_any then allow_any(option_value)
249
250
  when :signature_expiration then @signature_expiration = option_value
250
- else send("#{option_name}", option_value)
251
+ else
252
+ if @@allowed_fields.include?(option_name)
253
+ send("#{option_name}", option_value)
254
+ else
255
+ raise ArgumentError, "Unsupported option: #{option_name}"
256
+ end
251
257
  end
252
258
  end
253
259
  end
@@ -279,17 +285,22 @@ module Aws
279
285
  end
280
286
 
281
287
  # @api private
282
- def self.define_field(field, *args)
288
+ def self.define_field(field, *args, &block)
289
+ @@allowed_fields << field
283
290
  options = args.last.is_a?(Hash) ? args.pop : {}
284
291
  field_name = args.last || field.to_s
285
292
 
286
- define_method("#{field}") do |value|
287
- with(field_name, value)
288
- end
293
+ if block_given?
294
+ define_method("#{field}", block)
295
+ else
296
+ define_method("#{field}") do |value|
297
+ with(field_name, value)
298
+ end
289
299
 
290
- if options[:starts_with]
291
- define_method("#{field}_starts_with") do |value|
292
- starts_with(field_name, value)
300
+ if options[:starts_with]
301
+ define_method("#{field}_starts_with") do |value|
302
+ starts_with(field_name, value)
303
+ end
293
304
  end
294
305
  end
295
306
  end
@@ -307,7 +318,7 @@ module Aws
307
318
  # @param [String] key
308
319
  # @see http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html)
309
320
  # @return [self]
310
- def key(key)
321
+ define_field(:key) do |key|
311
322
  @key_set = true
312
323
  with('key', key)
313
324
  end
@@ -316,7 +327,7 @@ module Aws
316
327
  # @param [String] prefix
317
328
  # @see #key
318
329
  # @return [self]
319
- def key_starts_with(prefix)
330
+ define_field(:key_starts_with) do |prefix|
320
331
  @key_set = true
321
332
  starts_with('key', prefix)
322
333
  end
@@ -399,21 +410,21 @@ module Aws
399
410
  # @param [Time] time
400
411
  # @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21
401
412
  # @return [self]
402
- def expires(time)
413
+ define_field(:expires) do |time|
403
414
  with('Expires', time.httpdate)
404
415
  end
405
416
 
406
417
  # @param [String] prefix
407
418
  # @see #expires
408
419
  # @return [self]
409
- def expires_starts_with(prefix)
420
+ define_field(:expires_starts_with) do |prefix|
410
421
  starts_with('Expires', prefix)
411
422
  end
412
423
 
413
424
  # The minimum and maximum allowable size for the uploaded content.
414
425
  # @param [Range<Integer>] byte_range
415
426
  # @return [self]
416
- def content_length_range(byte_range)
427
+ define_field(:content_length_range) do |byte_range|
417
428
  min = byte_range.begin
418
429
  max = byte_range.end
419
430
  max -= 1 if byte_range.exclude_end?
@@ -492,7 +503,7 @@ module Aws
492
503
  # prefixed with "x-amz-meta-".
493
504
  # @param [Hash<String,String>] hash
494
505
  # @return [self]
495
- def metadata(hash)
506
+ define_field(:metadata) do |hash|
496
507
  hash.each do |key, value|
497
508
  with("x-amz-meta-#{key}", value)
498
509
  end
@@ -503,7 +514,7 @@ module Aws
503
514
  # @param [Hash<String,String>] hash
504
515
  # @see #metadata
505
516
  # @return [self]
506
- def metadata_starts_with(hash)
517
+ define_field(:metadata_starts_with) do |hash|
507
518
  hash.each do |key, value|
508
519
  starts_with("x-amz-meta-#{key}", value)
509
520
  end
@@ -561,7 +572,7 @@ module Aws
561
572
  # @param [String] value
562
573
  # @see #server_side_encryption_customer_algorithm
563
574
  # @return [self]
564
- def server_side_encryption_customer_key(value)
575
+ define_field(:server_side_encryption_customer_key) do |value|
565
576
  field_name = 'x-amz-server-side-encryption-customer-key'
566
577
  with(field_name, base64(value))
567
578
  with(field_name + '-MD5', base64(OpenSSL::Digest::MD5.digest(value)))
@@ -570,7 +581,7 @@ module Aws
570
581
  # @param [String] prefix
571
582
  # @see #server_side_encryption_customer_key
572
583
  # @return [self]
573
- def server_side_encryption_customer_key_starts_with(prefix)
584
+ define_field(:server_side_encryption_customer_key_starts_with) do |prefix|
574
585
  field_name = 'x-amz-server-side-encryption-customer-key'
575
586
  starts_with(field_name, prefix)
576
587
  end
data/lib/aws-sdk-s3.rb CHANGED
@@ -69,6 +69,6 @@ require_relative 'aws-sdk-s3/event_streams'
69
69
  # @!group service
70
70
  module Aws::S3
71
71
 
72
- GEM_VERSION = '1.111.1'
72
+ GEM_VERSION = '1.111.2'
73
73
 
74
74
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.111.1
4
+ version: 1.111.2
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: 2022-01-06 00:00:00.000000000 Z
11
+ date: 2022-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-kms