aws-sdk-s3 1.8.0 → 1.8.2

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
  SHA1:
3
- metadata.gz: 11e9a946e4c62cd4e65425e89902c241af285bde
4
- data.tar.gz: a2d9222f53c8f42be08062566e1c918619c6aa44
3
+ metadata.gz: d7148cc33c898dd318c42d6c85703593aa147bee
4
+ data.tar.gz: a047d88bc816ca70f830778d228b0bcc9cf20145
5
5
  SHA512:
6
- metadata.gz: ce6d03f49def68da923382a840324f932f872f552d772abea6ceb16388088584ed18ac87d33279f0b675e594d966b771d21ace3e27f483d23f5602fbb925621e
7
- data.tar.gz: e19d2fcdba9c44c11633f40cca6f66f7de128b6f48417ed2368f74dd0bde1dc2342bcfceecf665716431e8d599486be7ecb087ecd6f528f3b536d2987cd96bb9
6
+ metadata.gz: 99396fcd7b62b692c23dbb0ba3662a241fa87e654de6ddc80e344d1f42b2e8c5f99b354d7a619656def60ca7255dc69a503b46b98d076d84e64a5c67470fc214
7
+ data.tar.gz: 01d123f13e3b527c55f460fc43d2c7ce0f5d7c31ae8c9ef7caad5c619f2330c492563c029e8bf4021af05cc2289667eef0982cd016222c550727f858b4f82451
@@ -6087,7 +6087,7 @@ module Aws::S3
6087
6087
  params: params,
6088
6088
  config: config)
6089
6089
  context[:gem_name] = 'aws-sdk-s3'
6090
- context[:gem_version] = '1.8.0'
6090
+ context[:gem_version] = '1.8.2'
6091
6091
  Seahorse::Client::Request.new(handlers, context)
6092
6092
  end
6093
6093
 
@@ -25,6 +25,7 @@ module Aws
25
25
  POSSIBLE_ENCRYPTION_FORMATS = %w(
26
26
  AES/GCM/NoPadding
27
27
  AES/CBC/PKCS5Padding
28
+ AES/CBC/PKCS7Padding
28
29
  )
29
30
 
30
31
  def call(context)
@@ -162,7 +163,7 @@ module Aws
162
163
  # The encrypted object contains both the cipher text
163
164
  # plus a trailing auth tag. This decrypter will the body
164
165
  # expect for the trailing auth tag.
165
- decrypter = IOAuthDecrypter.new(
166
+ IOAuthDecrypter.new(
166
167
  io: http_resp.body,
167
168
  encrypted_content_length: content_length - auth_tag_length,
168
169
  cipher: cipher)
@@ -45,6 +45,8 @@ module Aws
45
45
  case envelope['x-amz-cek-alg']
46
46
  when 'AES/CBC/PKCS5Padding'
47
47
  :CBC
48
+ when 'AES/CBC/PKCS7Padding'
49
+ :CBC
48
50
  when 'AES/GCM/NoPadding'
49
51
  :GCM
50
52
  else
@@ -89,39 +89,13 @@ module Aws
89
89
  if @chunk_size && @chunk_size > file_size
90
90
  raise ArgumentError, ":chunk_size shouldn't exceed total file size."
91
91
  else
92
- default_chunk_size = @chunk_size || [(file_size.to_f / MAX_PARTS).ceil, MIN_CHUNK_SIZE].max.to_i
92
+ @chunk_size || [(file_size.to_f / MAX_PARTS).ceil, MIN_CHUNK_SIZE].max.to_i
93
93
  end
94
94
  end
95
95
 
96
- def sort_files(files)
97
- # sort file by start range count or part number
98
- files.sort do |a, b|
99
- a[/([^\=]+)$/].split('-')[0].to_i <=> b[/([^\=]+)$/].split('-')[0].to_i
100
- end
101
- end
102
-
103
- def concatenate_parts(fileparts)
104
- File.open(@path, 'wb')do |output_path|
105
- sort_files(fileparts).each {|part| IO.copy_stream(part, output_path)}
106
- end
107
- end
108
-
109
- def file_batches(chunks, dir, mode)
110
- batches = []
96
+ def batches(chunks, mode)
111
97
  chunks = (1..chunks) if mode.eql? 'part_number'
112
- chunks.each_slice(@thread_count) do |slice|
113
- batches << map_files(slice, dir, mode)
114
- end
115
- batches
116
- end
117
-
118
- def map_files(slice, dir, mode)
119
- case mode
120
- when 'range'
121
- slice.inject({}) {|h, chunk| h[chunk] = File.join(dir, chunk); h}
122
- when 'part_number'
123
- slice.inject({}) {|h, part| h[part] = File.join(dir, "part_number=#{part}"); h}
124
- end
98
+ chunks.each_slice(@thread_count).to_a
125
99
  end
126
100
 
127
101
  def multithreaded_get_by_ranges(chunks)
@@ -133,32 +107,28 @@ module Aws
133
107
  end
134
108
 
135
109
  def thread_batches(chunks, param)
136
- # create a tmp dir under destination dir for batches
137
- dir = Dir.mktmpdir(nil, File.dirname(@path))
138
- batches = file_batches(chunks, dir, param)
139
- parts = batches.flat_map(&:values)
140
- begin
141
- batches.each do |batch|
142
- threads = []
143
- batch.each do |chunk, file|
144
- threads << Thread.new do
145
- resp = @client.get_object(
146
- :bucket => @bucket,
147
- :key => @key,
148
- param.to_sym => chunk,
149
- :response_target => file
150
- )
151
- end
110
+ batches(chunks, param).each do |batch|
111
+ threads = []
112
+ batch.each do |chunk|
113
+ threads << Thread.new do
114
+ resp = @client.get_object(
115
+ :bucket => @bucket,
116
+ :key => @key,
117
+ param.to_sym => chunk
118
+ )
119
+ write(resp)
152
120
  end
153
- threads.each(&:join)
154
121
  end
155
- concatenate_parts(parts)
156
- ensure
157
- # clean up tmp dir
158
- FileUtils.remove_entry(dir)
122
+ threads.each(&:join)
159
123
  end
160
124
  end
161
125
 
126
+ def write(resp)
127
+ range, _ = resp.content_range.split(" ").last.split("/")
128
+ head, _ = range.split("-").map {|s| s.to_i}
129
+ IO.write(@path, resp.body.read, head)
130
+ end
131
+
162
132
  def single_request
163
133
  @client.get_object(
164
134
  bucket: @bucket, key: @key, response_target: @path
@@ -73,7 +73,7 @@ each bucket. [Go here for more information](http://docs.aws.amazon.com/AmazonS3
73
73
  end
74
74
 
75
75
  def validate_bucket_name!(bucket_name)
76
- unless BucketDns.dns_compatible?(bucket_name, ssl = true)
76
+ unless BucketDns.dns_compatible?(bucket_name, _ssl = true)
77
77
  msg = "unable to use `accelerate: true` on buckets with "
78
78
  msg << "non-DNS compatible names"
79
79
  raise ArgumentError, msg
@@ -38,7 +38,7 @@ for all operations.
38
38
  def apply_dualstack_endpoint(context)
39
39
  bucket_name = context.params[:bucket]
40
40
  region = context.config.region
41
- force_path_style = context.config.force_path_style
41
+ context.config.force_path_style
42
42
  dns_suffix = Aws::Partitions::EndpointProvider.dns_suffix_for(region)
43
43
 
44
44
  if use_bucket_dns?(bucket_name, context)
@@ -132,7 +132,7 @@ module Aws
132
132
  end
133
133
 
134
134
  def build_signer(cfg)
135
- signer = Aws::Sigv4::Signer.new(
135
+ Aws::Sigv4::Signer.new(
136
136
  service: 's3',
137
137
  region: cfg.region,
138
138
  credentials_provider: cfg.credentials,
data/lib/aws-sdk-s3.rb CHANGED
@@ -62,6 +62,6 @@ require_relative 'aws-sdk-s3/customizations'
62
62
  # @service
63
63
  module Aws::S3
64
64
 
65
- GEM_VERSION = '1.8.0'
65
+ GEM_VERSION = '1.8.2'
66
66
 
67
67
  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.8.0
4
+ version: 1.8.2
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: 2017-11-29 00:00:00.000000000 Z
11
+ date: 2018-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-kms