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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b9bd9773bfe93b000fceed47270a7ae0e9460c17afe3ecf99962d93dee82422
4
- data.tar.gz: 47154a5a396f315d9c55dcd7a7002e31ef75d0d6d0b6d8fa816c46e93fed358c
3
+ metadata.gz: 3e9c124873324a9bbaa9f9486830a64940d0b0eef231e64a411ff9b324c740be
4
+ data.tar.gz: cf26234ca89937e9aa39e44be5ad26b85902ad2eca5f1dbfa9fccf32a93e917e
5
5
  SHA512:
6
- metadata.gz: 2434d460cfa4d4ea2fede1a4bb023f7c9c24c417bf4819c3647a04b22d0665da9d6c6d419399c7691688aeacb9bd6542e773c262a662d02eb9c08b058a049b8a
7
- data.tar.gz: 9e3dce605906b1b6f3db06a68545e81eddda54eeea98ce369964408b45f54f054b5f4be3c668ab62e0ac83cbbf7ffb3cc828de7474fc06c6b21c095178546a52
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.131.0
1
+ 1.132.1
@@ -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.131.0'
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
@@ -73,6 +73,6 @@ require_relative 'aws-sdk-s3/event_streams'
73
73
  # @!group service
74
74
  module Aws::S3
75
75
 
76
- GEM_VERSION = '1.131.0'
76
+ GEM_VERSION = '1.132.1'
77
77
 
78
78
  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.131.0
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-07-20 00:00:00.000000000 Z
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.177.0
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.177.0
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: