aws-sdk-s3 1.70.0 → 1.71.1

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: 5a991d91a05dd60c0952369cfe5c4ca7c62b18c01b26afa41d0bc19ca4571c86
4
- data.tar.gz: 03d8fdd2a61fc25246e8ef5c54a61091e6e28d7dceb2070ec2b176b1a491a709
3
+ metadata.gz: 3f240d2ad59da6ec32d1ade570c847520a7d1d7c5a6dd520f180e8ee1520be81
4
+ data.tar.gz: b7e68a56b8637b75a63ce8f1239252ff739e72197fe93ee016c4aa0983ca5743
5
5
  SHA512:
6
- metadata.gz: 1b53eacdfcfe2bdcd3dcc1d8b3719664ea6647a3156399c403f3fb5733ac1b43820e663095f98a0284235b69d0ec6ed40314f41da3647810989824357f891d42
7
- data.tar.gz: b28160c528d2554dd6c5c8d1f4bc2dbbddc5d91cf08d7df81de8a87400225f7d87b75d89e974d07e38af82bdd41aa1d421d9b7383d31007e76196efcb4d991f3
6
+ metadata.gz: 8353d1c03e7e7b126bf139e2fdecea54bd7f13dd776e82ae76cbc2d1042debde43ed5ee076bb9d7b24454822350eae146f4216c45ccc9f9de66f33463a7f2246
7
+ data.tar.gz: 8be6c6424986f229d24455259e4556fc53bada28bc2ec244ae5922fe890900d6b3afd08b58f234282749556f8466e59e7a76d98e9a90941c504c1e28b4011a6b
@@ -68,6 +68,6 @@ require_relative 'aws-sdk-s3/event_streams'
68
68
  # @service
69
69
  module Aws::S3
70
70
 
71
- GEM_VERSION = '1.70.0'
71
+ GEM_VERSION = '1.71.0'
72
72
 
73
73
  end
@@ -44,6 +44,7 @@ require 'aws-sdk-s3/plugins/sse_cpk.rb'
44
44
  require 'aws-sdk-s3/plugins/url_encoded_keys.rb'
45
45
  require 'aws-sdk-s3/plugins/s3_signer.rb'
46
46
  require 'aws-sdk-s3/plugins/bucket_name_restrictions.rb'
47
+ require 'aws-sdk-s3/plugins/streaming_retry.rb'
47
48
  require 'aws-sdk-core/plugins/event_stream_configuration.rb'
48
49
 
49
50
  Aws::Plugins::GlobalConfiguration.add_identifier(:s3)
@@ -106,6 +107,7 @@ module Aws::S3
106
107
  add_plugin(Aws::S3::Plugins::UrlEncodedKeys)
107
108
  add_plugin(Aws::S3::Plugins::S3Signer)
108
109
  add_plugin(Aws::S3::Plugins::BucketNameRestrictions)
110
+ add_plugin(Aws::S3::Plugins::StreamingRetry)
109
111
  add_plugin(Aws::Plugins::EventStreamConfiguration)
110
112
 
111
113
  # @overload initialize(options)
@@ -11670,7 +11672,7 @@ module Aws::S3
11670
11672
  params: params,
11671
11673
  config: config)
11672
11674
  context[:gem_name] = 'aws-sdk-s3'
11673
- context[:gem_version] = '1.70.0'
11675
+ context[:gem_version] = '1.71.0'
11674
11676
  Seahorse::Client::Request.new(handlers, context)
11675
11677
  end
11676
11678
 
@@ -10,6 +10,7 @@ module Aws
10
10
  @cipher = cipher
11
11
  # Ensure that IO is reset between retries
12
12
  @io = io.tap { |io| io.truncate(0) if io.respond_to?(:truncate) }
13
+ @cipher_buffer = String.new
13
14
  end
14
15
 
15
16
  # @return [#write]
@@ -17,7 +18,11 @@ module Aws
17
18
 
18
19
  def write(chunk)
19
20
  # decrypt and write
20
- @io.write(@cipher.update(chunk))
21
+ if @cipher.method(:update).arity == 1
22
+ @io.write(@cipher.update(chunk))
23
+ else
24
+ @io.write(@cipher.update(chunk, @cipher_buffer))
25
+ end
21
26
  end
22
27
 
23
28
  def finalize
@@ -52,8 +52,12 @@ module Aws
52
52
  def encrypt_to_tempfile(cipher, io)
53
53
  encrypted = Tempfile.new(self.object_id.to_s)
54
54
  encrypted.binmode
55
- while chunk = io.read(ONE_MEGABYTE)
56
- encrypted.write(cipher.update(chunk))
55
+ while chunk = io.read(ONE_MEGABYTE, read_buffer ||= String.new)
56
+ if cipher.method(:update).arity == 1
57
+ encrypted.write(cipher.update(chunk))
58
+ else
59
+ encrypted.write(cipher.update(chunk, cipher_buffer ||= String.new))
60
+ end
57
61
  end
58
62
  encrypted.write(cipher.final)
59
63
  encrypted.write(cipher.auth_tag)
@@ -40,7 +40,8 @@ module Aws
40
40
  end
41
41
  end
42
42
 
43
- handler(Handler,
43
+ handler(
44
+ Handler,
44
45
  step: :sign,
45
46
  operations: [
46
47
  :complete_multipart_upload,
@@ -0,0 +1,118 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'forwardable'
4
+
5
+ module Aws
6
+ module S3
7
+ module Plugins
8
+
9
+ # A wrapper around BlockIO that adds no-ops for truncate and rewind
10
+ # @api private
11
+ class RetryableBlockIO
12
+ extend Forwardable
13
+ def_delegators :@block_io, :write, :read, :size
14
+
15
+ def initialize(block_io)
16
+ @block_io = block_io
17
+ end
18
+
19
+ def truncate(_integer); end
20
+
21
+ def rewind; end
22
+ end
23
+
24
+ # A wrapper around ManagedFile that adds no-ops for truncate and rewind
25
+ # @api private
26
+ class RetryableManagedFile
27
+ extend Forwardable
28
+ def_delegators :@file, :write, :read, :size, :open?, :close
29
+
30
+ def initialize(managed_file)
31
+ @file = managed_file
32
+ end
33
+
34
+ def truncate(_integer); end
35
+
36
+ def rewind; end
37
+ end
38
+
39
+ # This handler works with the ResponseTarget plugin to provide smart
40
+ # retries of S3 streaming operations that support the range parameter
41
+ # (currently only: get_object). When a 200 OK with a TruncatedBodyError
42
+ # is received this handler will add a range header that excludes the
43
+ # data that has already been processed (written to file or sent to
44
+ # the target Proc).
45
+ # It is important to not write data to the custom target in the case of
46
+ # a non-success response. We do not want to write an XML error
47
+ # message to someone's file or pass it to a user's Proc.
48
+ # @api private
49
+ class StreamingRetry < Seahorse::Client::Plugin
50
+
51
+ class Handler < Seahorse::Client::Handler
52
+
53
+ def call(context)
54
+ target = context.params[:response_target] || context[:response_target]
55
+
56
+ # retry is only supported when range is NOT set on the initial request
57
+ if supported_target?(target) && !context.params[:range]
58
+ add_event_listeners(context, target)
59
+ end
60
+ @handler.call(context)
61
+ end
62
+
63
+ private
64
+
65
+ def add_event_listeners(context, target)
66
+ context.http_response.on_headers(200..299) do
67
+ case context.http_response.body
68
+ when Seahorse::Client::BlockIO then
69
+ context.http_response.body = RetryableBlockIO.new(context.http_response.body)
70
+ when Seahorse::Client::ManagedFile then
71
+ context.http_response.body = RetryableManagedFile.new(context.http_response.body)
72
+ end
73
+ end
74
+
75
+ context.http_response.on_headers(400..599) do
76
+ context.http_response.body = StringIO.new # something to write the error to
77
+ end
78
+
79
+ context.http_response.on_success(200..299) do
80
+ body = context.http_response.body
81
+ if body.is_a?(RetryableManagedFile) && body.open?
82
+ body.close
83
+ end
84
+ end
85
+
86
+ context.http_response.on_error do |error|
87
+ if retryable_body?(context) && truncated_body?(error)
88
+ context.http_request.headers[:range] = "bytes=#{context.http_response.body.size}-"
89
+ end
90
+ end
91
+ end
92
+
93
+ def truncated_body?(error)
94
+ error.is_a?(Seahorse::Client::NetworkingError) &&
95
+ error.original_error.is_a?(
96
+ Seahorse::Client::NetHttp::Handler::TruncatedBodyError
97
+ )
98
+ end
99
+
100
+ def retryable_body?(context)
101
+ context.http_response.body.is_a?(RetryableBlockIO) ||
102
+ context.http_response.body.is_a?(RetryableManagedFile)
103
+ end
104
+
105
+ def supported_target?(target)
106
+ case target
107
+ when Proc, String, Pathname then true
108
+ else false
109
+ end
110
+ end
111
+ end
112
+
113
+ handler(Handler, step: :sign, operations: [:get_object], priority: 10)
114
+
115
+ end
116
+ end
117
+ end
118
+ 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.70.0
4
+ version: 1.71.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-23 00:00:00.000000000 Z
11
+ date: 2020-06-25 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.99.0
50
+ version: 3.102.1
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.99.0
60
+ version: 3.102.1
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:
@@ -148,6 +148,7 @@ files:
148
148
  - lib/aws-sdk-s3/plugins/s3_host_id.rb
149
149
  - lib/aws-sdk-s3/plugins/s3_signer.rb
150
150
  - lib/aws-sdk-s3/plugins/sse_cpk.rb
151
+ - lib/aws-sdk-s3/plugins/streaming_retry.rb
151
152
  - lib/aws-sdk-s3/plugins/url_encoded_keys.rb
152
153
  - lib/aws-sdk-s3/presigned_post.rb
153
154
  - lib/aws-sdk-s3/presigner.rb
@@ -160,7 +161,7 @@ licenses:
160
161
  metadata:
161
162
  source_code_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-s3
162
163
  changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-s3/CHANGELOG.md
163
- post_install_message:
164
+ post_install_message:
164
165
  rdoc_options: []
165
166
  require_paths:
166
167
  - lib
@@ -175,9 +176,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
176
  - !ruby/object:Gem::Version
176
177
  version: '0'
177
178
  requirements: []
178
- rubyforge_project:
179
- rubygems_version: 2.7.6.2
180
- signing_key:
179
+ rubygems_version: 3.0.3
180
+ signing_key:
181
181
  specification_version: 4
182
182
  summary: AWS SDK for Ruby - Amazon S3
183
183
  test_files: []