aws-sdk-s3 1.131.0 → 1.132.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: 7b9bd9773bfe93b000fceed47270a7ae0e9460c17afe3ecf99962d93dee82422
4
- data.tar.gz: 47154a5a396f315d9c55dcd7a7002e31ef75d0d6d0b6d8fa816c46e93fed358c
3
+ metadata.gz: adbed389cd50d435107ac0380117b7e1a316f18dc19cc9a140b223320980fb27
4
+ data.tar.gz: feea3f5c604991ae327c7e3a7c1811ea0de5ab4474154e3bc69162d8262def72
5
5
  SHA512:
6
- metadata.gz: 2434d460cfa4d4ea2fede1a4bb023f7c9c24c417bf4819c3647a04b22d0665da9d6c6d419399c7691688aeacb9bd6542e773c262a662d02eb9c08b058a049b8a
7
- data.tar.gz: 9e3dce605906b1b6f3db06a68545e81eddda54eeea98ce369964408b45f54f054b5f4be3c668ab62e0ac83cbbf7ffb3cc828de7474fc06c6b21c095178546a52
6
+ metadata.gz: 3f9adfd588e576e5dd17a9abac897b5d3e113b3fefd03de458fc0c8556c9a43336f84af4a3faf4f8516995cfff58cb9085af209f1f2ef8991204e11f7b7e9164
7
+ data.tar.gz: 5eb78921bec0f584949cec19adc7d6f38c65daabab5f9ed01c7298d7bfb14501512a1ea99abc6449591867bf548bab50ec0fd3fe54c21dd5ddfddafa370aaae6
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.132.0 (2023-07-24)
5
+ ------------------
6
+
7
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
8
+
9
+ * Feature - Add support for verifying checksums in FileDownloader.
10
+
4
11
  1.131.0 (2023-07-20)
5
12
  ------------------
6
13
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.131.0
1
+ 1.132.0
@@ -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.0'
15657
15657
  Seahorse::Client::Request.new(handlers, context)
15658
15658
  end
15659
15659
 
@@ -492,6 +492,18 @@ 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 occured and which
500
+ # algorithm was used.
501
+ #
502
+ # @option options [Callable] on_checksum_validated Called each time a
503
+ # request's checksum is validated with the checksum algorithm and the
504
+ # response. For multipart downloads, this will be called for each
505
+ # part that is downloaded and validated.
506
+ #
495
507
  # @return [Boolean] Returns `true` when the file is downloaded without
496
508
  # any errors.
497
509
  def download_file(destination, options = {})
@@ -31,6 +31,10 @@ module Aws
31
31
  key: options[:key],
32
32
  }
33
33
  @params[:version_id] = options[:version_id] if options[:version_id]
34
+ @params[:checksum_mode] = options[:checksum_mode] || 'ENABLED'
35
+ @on_checksum_validated = options[:on_checksum_validated]
36
+
37
+ validate!
34
38
 
35
39
  Aws::Plugins::UserAgent.feature('s3-transfer') do
36
40
  case @mode
@@ -54,6 +58,17 @@ module Aws
54
58
 
55
59
  private
56
60
 
61
+ def validate!
62
+ if @on_checksum_validated && @params[:checksum_mode] != 'ENABLED'
63
+ raise ArgumentError, "You must set checksum_mode: 'ENABLED' " +
64
+ "when providing a on_checksum_validated callback"
65
+ end
66
+
67
+ if @on_checksum_validated && !@on_checksum_validated.respond_to?(:call)
68
+ raise ArgumentError, 'on_checksum_validated must be callable'
69
+ end
70
+ end
71
+
57
72
  def multipart_download
58
73
  resp = @client.head_object(@params.merge(part_number: 1))
59
74
  count = resp.parts_count
@@ -129,6 +144,9 @@ module Aws
129
144
  @params.merge(param.to_sym => chunk)
130
145
  )
131
146
  write(resp)
147
+ if @on_checksum_validated && resp.checksum_validated
148
+ @on_checksum_validated.call(resp.checksum_validated, resp)
149
+ end
132
150
  end
133
151
  end
134
152
  threads.each(&:join)
@@ -142,9 +160,17 @@ module Aws
142
160
  end
143
161
 
144
162
  def single_request
145
- @client.get_object(
163
+ resp = @client.get_object(
146
164
  @params.merge(response_target: @path)
147
165
  )
166
+
167
+ return resp unless @on_checksum_validated
168
+
169
+ if resp.checksum_validated
170
+ @on_checksum_validated.call(resp.checksum_validated, resp)
171
+ end
172
+
173
+ resp
148
174
  end
149
175
  end
150
176
  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.0'
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.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-07-20 00:00:00.000000000 Z
11
+ date: 2023-07-24 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: