aws-sdk-s3 1.131.0 → 1.132.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-s3/client.rb +1 -1
- data/lib/aws-sdk-s3/customizations/object.rb +13 -0
- data/lib/aws-sdk-s3/file_downloader.rb +33 -1
- data/lib/aws-sdk-s3.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e9c124873324a9bbaa9f9486830a64940d0b0eef231e64a411ff9b324c740be
|
4
|
+
data.tar.gz: cf26234ca89937e9aa39e44be5ad26b85902ad2eca5f1dbfa9fccf32a93e917e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 534772057f8571cdb4ce8e6ba47350b672723cc37f654cd5befa1e426c59eb12b7ddb51620ed20dc513c7e4b16dfab54507c261ad8124ca1abe841a1573e1b9f
|
7
|
+
data.tar.gz: ab4ebcde9d217b7e14c7f94696793ece9a2c5c74921e5e087f156585ffd76d9536776054a1a76e9b5965576d41bd9a1d0efc20fddda1aa472272f15d71e48322
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
Unreleased Changes
|
2
2
|
------------------
|
3
3
|
|
4
|
+
1.132.1 (2023-08-09)
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Issue - Add support for disabling checksum validation in `Object#download_file` (#2893).
|
8
|
+
|
9
|
+
1.132.0 (2023-07-24)
|
10
|
+
------------------
|
11
|
+
|
12
|
+
* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
|
13
|
+
|
14
|
+
* Feature - Add support for verifying checksums in FileDownloader.
|
15
|
+
|
4
16
|
1.131.0 (2023-07-20)
|
5
17
|
------------------
|
6
18
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.132.1
|
data/lib/aws-sdk-s3/client.rb
CHANGED
@@ -15653,7 +15653,7 @@ module Aws::S3
|
|
15653
15653
|
params: params,
|
15654
15654
|
config: config)
|
15655
15655
|
context[:gem_name] = 'aws-sdk-s3'
|
15656
|
-
context[:gem_version] = '1.
|
15656
|
+
context[:gem_version] = '1.132.1'
|
15657
15657
|
Seahorse::Client::Request.new(handlers, context)
|
15658
15658
|
end
|
15659
15659
|
|
@@ -492,6 +492,19 @@ module Aws
|
|
492
492
|
# retrieve the object. For more about object versioning, see:
|
493
493
|
# https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectVersioning.html
|
494
494
|
#
|
495
|
+
# @option options [String] checksum_mode (ENABLED) When `ENABLED` and
|
496
|
+
# the object has a stored checksum, it will be used to validate the
|
497
|
+
# download and will raise an `Aws::Errors::ChecksumError` if
|
498
|
+
# checksum validation fails. You may provide a `on_checksum_validated`
|
499
|
+
# callback if you need to verify that validation occurred and which
|
500
|
+
# algorithm was used. To disable checksum validation, set
|
501
|
+
# `checksum_mode` to "DISABLED".
|
502
|
+
#
|
503
|
+
# @option options [Callable] on_checksum_validated Called each time a
|
504
|
+
# request's checksum is validated with the checksum algorithm and the
|
505
|
+
# response. For multipart downloads, this will be called for each
|
506
|
+
# part that is downloaded and validated.
|
507
|
+
#
|
495
508
|
# @return [Boolean] Returns `true` when the file is downloaded without
|
496
509
|
# any errors.
|
497
510
|
def download_file(destination, options = {})
|
@@ -32,6 +32,16 @@ module Aws
|
|
32
32
|
}
|
33
33
|
@params[:version_id] = options[:version_id] if options[:version_id]
|
34
34
|
|
35
|
+
# checksum_mode only supports the value "ENABLED"
|
36
|
+
# falsey values (false/nil) or "DISABLED" should be considered
|
37
|
+
# disabled and the api parameter should be unset.
|
38
|
+
if (checksum_mode = options.fetch(:checksum_mode, 'ENABLED'))
|
39
|
+
@params[:checksum_mode] = checksum_mode unless checksum_mode.upcase == 'DISABLED'
|
40
|
+
end
|
41
|
+
@on_checksum_validated = options[:on_checksum_validated]
|
42
|
+
|
43
|
+
validate!
|
44
|
+
|
35
45
|
Aws::Plugins::UserAgent.feature('s3-transfer') do
|
36
46
|
case @mode
|
37
47
|
when 'auto' then multipart_download
|
@@ -54,6 +64,17 @@ module Aws
|
|
54
64
|
|
55
65
|
private
|
56
66
|
|
67
|
+
def validate!
|
68
|
+
if @on_checksum_validated && @params[:checksum_mode] != 'ENABLED'
|
69
|
+
raise ArgumentError, "You must set checksum_mode: 'ENABLED' " +
|
70
|
+
"when providing a on_checksum_validated callback"
|
71
|
+
end
|
72
|
+
|
73
|
+
if @on_checksum_validated && !@on_checksum_validated.respond_to?(:call)
|
74
|
+
raise ArgumentError, 'on_checksum_validated must be callable'
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
57
78
|
def multipart_download
|
58
79
|
resp = @client.head_object(@params.merge(part_number: 1))
|
59
80
|
count = resp.parts_count
|
@@ -129,6 +150,9 @@ module Aws
|
|
129
150
|
@params.merge(param.to_sym => chunk)
|
130
151
|
)
|
131
152
|
write(resp)
|
153
|
+
if @on_checksum_validated && resp.checksum_validated
|
154
|
+
@on_checksum_validated.call(resp.checksum_validated, resp)
|
155
|
+
end
|
132
156
|
end
|
133
157
|
end
|
134
158
|
threads.each(&:join)
|
@@ -142,9 +166,17 @@ module Aws
|
|
142
166
|
end
|
143
167
|
|
144
168
|
def single_request
|
145
|
-
@client.get_object(
|
169
|
+
resp = @client.get_object(
|
146
170
|
@params.merge(response_target: @path)
|
147
171
|
)
|
172
|
+
|
173
|
+
return resp unless @on_checksum_validated
|
174
|
+
|
175
|
+
if resp.checksum_validated
|
176
|
+
@on_checksum_validated.call(resp.checksum_validated, resp)
|
177
|
+
end
|
178
|
+
|
179
|
+
resp
|
148
180
|
end
|
149
181
|
end
|
150
182
|
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.
|
4
|
+
version: 1.132.1
|
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-
|
11
|
+
date: 2023-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-kms
|
@@ -47,7 +47,7 @@ dependencies:
|
|
47
47
|
version: '3'
|
48
48
|
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 3.
|
50
|
+
version: 3.179.0
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
version: '3'
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 3.
|
60
|
+
version: 3.179.0
|
61
61
|
description: Official AWS Ruby gem for Amazon Simple Storage Service (Amazon S3).
|
62
62
|
This gem is part of the AWS SDK for Ruby.
|
63
63
|
email:
|