aws-sdk-resources 2.0.15.pre → 2.0.16.pre

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
  SHA1:
3
- metadata.gz: f052a7ea17d6dae941c7488668075d7faecf9767
4
- data.tar.gz: cae90c630414ec0552c9b8e4df95449222d048e7
3
+ metadata.gz: 0e220113a1956aa99dfbe792083ce5a837401a28
4
+ data.tar.gz: 04d6bb70744e607ee5b3f7fafbfaffc083775efb
5
5
  SHA512:
6
- metadata.gz: bc04753ba36090c1c4f521b2c2648d1bfd0f8cfa3071c15cd2ae21ec828cda120aa31c08dfd72941a20e71c12140773ce15fd8b124eb32e2b8e5f1e049a69212
7
- data.tar.gz: 901efaa0baa5c3f8e52871c4ec57c963400c0cf1ebed22ec8f59d34f2cc2fe2d5d4cbfde9fc34af7da5639656e0da834a78723ce3efca06a8c5c16484c71c824
6
+ metadata.gz: 036276e67b40d3da28dbe8e088f3f839141a7bd255131e2e2aa106f4c13d073733610c41fdeac979c6314ff3334ef5845238d8b0f41ab54429b7f42ddf9609df
7
+ data.tar.gz: c4bdd9e7e8b48d495e5360fa4474598c6249367e668d0ae97c613a2bdd4a684ee83903b73c6d57e33bff95ced31ce05714f11ca0c94ea557e312936be5ba7aea
@@ -200,11 +200,14 @@ module Aws
200
200
  # by this string.
201
201
  attr_reader :instruction_file_suffix
202
202
 
203
- # Calls {S3::Client#put_object}. The `:body` option will be encrypted
204
- # client-side before sending data to Amazon S3.
203
+ # Uploads an object to Amazon S3, encrypting data client-side.
204
+ # See {S3::Client#put_object} for documentation on accepted
205
+ # request parameters.
206
+ # @option (see S3::Client#put_object)
207
+ # @return (see S3::Client#put_object)
205
208
  # @see S3::Client#put_object
206
- def put_object(options = {})
207
- req = @client.build_request(:put_object, options)
209
+ def put_object(params = {})
210
+ req = @client.build_request(:put_object, params)
208
211
  req.handlers.add(EncryptHandler, priority: 95)
209
212
  req.context[:encryption] = {
210
213
  materials: @key_provider.encryption_materials,
@@ -214,30 +217,46 @@ module Aws
214
217
  req.send_request
215
218
  end
216
219
 
217
- # Performs an `#get_object` request on the `#config.client`. The
218
- # response body is decrypted as it is read from the HTTP response
219
- # socket. See {Client#get_object} for documentation on valid
220
- # options.
221
- def get_object(options = {})
222
- if options[:range]
220
+ # Gets an object from Amazon S3, decrypting data locally.
221
+ # See {S3::Client#get_object} for documentation on accepted
222
+ # request parameters.
223
+ # @option params [String] :instruction_file_suffix The suffix
224
+ # used to find the instruction file containing the encryption
225
+ # envelope. You should not set this option when the envelope
226
+ # is stored in the object metadata. Defaults to
227
+ # {#instruction_file_suffix}.
228
+ # @option params [String] :instruction_file_suffix
229
+ # @option (see S3::Client#get_object)
230
+ # @return (see S3::Client#get_object)
231
+ # @see S3::Client#get_object
232
+ # @note The `:range` request parameter is not yet supported.
233
+ def get_object(params = {})
234
+ if params[:range]
223
235
  raise NotImplementedError, '#get_object with :range not supported yet'
224
236
  end
225
-
226
- location = options.delete(:envelope_location) || @envelope_location
227
- suffix = options.delete(:instruction_file_suffix) || @instruction_file_suffix
228
-
229
- req = @client.build_request(:get_object, options)
237
+ envelope_location, instruction_file_suffix = envelope_options(params)
238
+ req = @client.build_request(:get_object, params)
230
239
  req.handlers.add(DecryptHandler)
231
240
  req.context[:encryption] = {
232
241
  key_provider: @key_provider,
233
- envelope_location: location,
234
- instruction_file_suffix: suffix,
242
+ envelope_location: envelope_location,
243
+ instruction_file_suffix: instruction_file_suffix,
235
244
  }
236
245
  req.send_request
237
246
  end
238
247
 
239
248
  private
240
249
 
250
+ def envelope_options(params)
251
+ location = params.delete(:envelope_location) || @envelope_location
252
+ suffix = params.delete(:instruction_file_suffix)
253
+ if suffix
254
+ [:instruction_file, suffix]
255
+ else
256
+ [location, @instruction_file_suffix]
257
+ end
258
+ end
259
+
241
260
  def extract_key_provider(options)
242
261
  if options[:key_provider]
243
262
  options[:key_provider]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.15.pre
4
+ version: 2.0.16.pre
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: 2014-12-17 00:00:00.000000000 Z
11
+ date: 2014-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.15
19
+ version: 2.0.16
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.15
26
+ version: 2.0.16
27
27
  description: Provides resource-oriented abstractions for AWS.
28
28
  email:
29
29
  executables: []