aws-sdk-s3 1.111.1 → 1.111.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-s3/client.rb +1 -1
- data/lib/aws-sdk-s3/file_downloader.rb +1 -1
- data/lib/aws-sdk-s3/presigned_post.rb +29 -17
- data/lib/aws-sdk-s3.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afe521a16dfb274ea2bffc22af08258ee2a755c2165b20cb04b2cc636e26496a
|
4
|
+
data.tar.gz: 9b8c990b785ee0e0deed43ba0a1b7db7ee29a394b7f346afe3ef2376e9199241
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 869a33e38261c190235f2295dc3c2d666674f4f332fe37463337b4209da96d0bec36930292291211b86a5d3107a2342733008cafa973e4a1ddac64404afc0f17
|
7
|
+
data.tar.gz: 3a5793da1ffb76d0277085b077e3206089086df2d583da542c12bd5f173a6cbd171987a13c5cc98bd3d4bd4dbb3474048f7bdad3d740cdc5d70bf191b3799211
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
Unreleased Changes
|
2
2
|
------------------
|
3
3
|
|
4
|
+
1.111.3 (2022-01-24)
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Issue - Fix starts_with fields on `PresignedPost` (#2636).
|
8
|
+
|
9
|
+
1.111.2 (2022-01-20)
|
10
|
+
------------------
|
11
|
+
|
12
|
+
* Issue - Minor cleanups.
|
13
|
+
|
4
14
|
1.111.1 (2022-01-06)
|
5
15
|
------------------
|
6
16
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.111.
|
1
|
+
1.111.3
|
data/lib/aws-sdk-s3/client.rb
CHANGED
@@ -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.
|
14219
|
+
context[:gem_version] = '1.111.3'
|
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
|
-
|
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
|
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,23 @@ 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
|
-
|
287
|
-
|
288
|
-
|
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
|
-
|
291
|
-
|
292
|
-
|
300
|
+
if options[:starts_with]
|
301
|
+
@@allowed_fields << "#{field}_starts_with".to_sym
|
302
|
+
define_method("#{field}_starts_with") do |value|
|
303
|
+
starts_with(field_name, value)
|
304
|
+
end
|
293
305
|
end
|
294
306
|
end
|
295
307
|
end
|
@@ -307,7 +319,7 @@ module Aws
|
|
307
319
|
# @param [String] key
|
308
320
|
# @see http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html)
|
309
321
|
# @return [self]
|
310
|
-
|
322
|
+
define_field(:key) do |key|
|
311
323
|
@key_set = true
|
312
324
|
with('key', key)
|
313
325
|
end
|
@@ -316,7 +328,7 @@ module Aws
|
|
316
328
|
# @param [String] prefix
|
317
329
|
# @see #key
|
318
330
|
# @return [self]
|
319
|
-
|
331
|
+
define_field(:key_starts_with) do |prefix|
|
320
332
|
@key_set = true
|
321
333
|
starts_with('key', prefix)
|
322
334
|
end
|
@@ -399,21 +411,21 @@ module Aws
|
|
399
411
|
# @param [Time] time
|
400
412
|
# @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21
|
401
413
|
# @return [self]
|
402
|
-
|
414
|
+
define_field(:expires) do |time|
|
403
415
|
with('Expires', time.httpdate)
|
404
416
|
end
|
405
417
|
|
406
418
|
# @param [String] prefix
|
407
419
|
# @see #expires
|
408
420
|
# @return [self]
|
409
|
-
|
421
|
+
define_field(:expires_starts_with) do |prefix|
|
410
422
|
starts_with('Expires', prefix)
|
411
423
|
end
|
412
424
|
|
413
425
|
# The minimum and maximum allowable size for the uploaded content.
|
414
426
|
# @param [Range<Integer>] byte_range
|
415
427
|
# @return [self]
|
416
|
-
|
428
|
+
define_field(:content_length_range) do |byte_range|
|
417
429
|
min = byte_range.begin
|
418
430
|
max = byte_range.end
|
419
431
|
max -= 1 if byte_range.exclude_end?
|
@@ -492,7 +504,7 @@ module Aws
|
|
492
504
|
# prefixed with "x-amz-meta-".
|
493
505
|
# @param [Hash<String,String>] hash
|
494
506
|
# @return [self]
|
495
|
-
|
507
|
+
define_field(:metadata) do |hash|
|
496
508
|
hash.each do |key, value|
|
497
509
|
with("x-amz-meta-#{key}", value)
|
498
510
|
end
|
@@ -503,7 +515,7 @@ module Aws
|
|
503
515
|
# @param [Hash<String,String>] hash
|
504
516
|
# @see #metadata
|
505
517
|
# @return [self]
|
506
|
-
|
518
|
+
define_field(:metadata_starts_with) do |hash|
|
507
519
|
hash.each do |key, value|
|
508
520
|
starts_with("x-amz-meta-#{key}", value)
|
509
521
|
end
|
@@ -561,7 +573,7 @@ module Aws
|
|
561
573
|
# @param [String] value
|
562
574
|
# @see #server_side_encryption_customer_algorithm
|
563
575
|
# @return [self]
|
564
|
-
|
576
|
+
define_field(:server_side_encryption_customer_key) do |value|
|
565
577
|
field_name = 'x-amz-server-side-encryption-customer-key'
|
566
578
|
with(field_name, base64(value))
|
567
579
|
with(field_name + '-MD5', base64(OpenSSL::Digest::MD5.digest(value)))
|
@@ -570,7 +582,7 @@ module Aws
|
|
570
582
|
# @param [String] prefix
|
571
583
|
# @see #server_side_encryption_customer_key
|
572
584
|
# @return [self]
|
573
|
-
|
585
|
+
define_field(:server_side_encryption_customer_key_starts_with) do |prefix|
|
574
586
|
field_name = 'x-amz-server-side-encryption-customer-key'
|
575
587
|
starts_with(field_name, prefix)
|
576
588
|
end
|
data/lib/aws-sdk-s3.rb
CHANGED
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.
|
4
|
+
version: 1.111.3
|
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-
|
11
|
+
date: 2022-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-kms
|