aws-sdk-core 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,4 +2,5 @@ Aws.add_service(:ElasticTranscoder, {
2
2
  api: File.join(Aws::APIS_DIR, 'ElasticTranscoder.api.json'),
3
3
  docs: File.join(Aws::APIS_DIR, 'ElasticTranscoder.docs.json'),
4
4
  paginators: File.join(Aws::APIS_DIR, 'ElasticTranscoder.paginators.json'),
5
+ waiters: File.join(Aws::APIS_DIR, 'ElasticTranscoder.waiters.json'),
5
6
  })
@@ -29,8 +29,10 @@ module Aws
29
29
  # @param [String, nil] prefix
30
30
  def structure(structure, values, prefix)
31
31
  values.each do |name, value|
32
- member_shape = structure.member(name)
33
- format(member_shape, value, prefix + query_name(member_shape))
32
+ unless value.nil?
33
+ member_shape = structure.member(name)
34
+ format(member_shape, value, prefix + query_name(member_shape))
35
+ end
34
36
  end
35
37
  end
36
38
 
@@ -29,8 +29,10 @@ module Aws
29
29
  # @param [String, nil] prefix
30
30
  def structure(structure, values, prefix)
31
31
  values.each do |name, value|
32
- member_shape = structure.member(name)
33
- format(member_shape, value, prefix + query_name(member_shape))
32
+ unless value.nil?
33
+ member_shape = structure.member(name)
34
+ format(member_shape, value, prefix + query_name(member_shape))
35
+ end
34
36
  end
35
37
  end
36
38
 
@@ -7,8 +7,15 @@ module Aws
7
7
  #
8
8
  # signer = Aws::S3::Presigner.new
9
9
  # url = signer.presigned_url(:get_object, bucket: "bucket", key: "key")
10
+ #
10
11
  class Presigner
11
12
 
13
+ # @api private
14
+ ONE_WEEK = 60 * 60 * 24 * 7
15
+
16
+ # @api private
17
+ FIFTEEN_MINUTES = 60 * 15
18
+
12
19
  # @option options [Client] :client Optionally provide an existing
13
20
  # S3 client
14
21
  def initialize(options = {})
@@ -17,13 +24,17 @@ module Aws
17
24
 
18
25
  # @param [Symbol] method Symbolized method name of the operation you want
19
26
  # to presign.
20
- # @option params [Integer] :expires_in (86400) The number of seconds
21
- # before the presigned URL expires. Must be less than 604800 seconds
22
- # (one week).
27
+ #
28
+ # @option params [Integer] :expires_in (900) The number of seconds
29
+ # before the presigned URL expires. Defaults to 15 minutes.
30
+ #
31
+ # @raise [ArgumentError] Raises an ArgumentError if `:expires_in`
32
+ # exceeds one week.
33
+ #
23
34
  def presigned_url(method, params = {})
24
35
  request = @client.build_request(method, params)
25
36
  request.handle(PresignHandler, step: :sign, priority: 99)
26
- expires_in = params.delete(:expires_in) || 86400
37
+ expires_in = params.delete(:expires_in) || FIFTEEN_MINUTES
27
38
  validate_expires_in_header(expires_in)
28
39
  request.context[:presigned_expires_in] = expires_in
29
40
  request.send_request.data
@@ -31,7 +42,7 @@ module Aws
31
42
 
32
43
  private
33
44
  def validate_expires_in_header(expires_in)
34
- if(expires_in > 604800)
45
+ if(expires_in > ONE_WEEK)
35
46
  raise ArgumentError.new(
36
47
  "expires_in value of #{expires_in} exceeds one-week maximum"
37
48
  )
@@ -1,3 +1,3 @@
1
1
  module Aws
2
- VERSION = '2.0.2'
2
+ VERSION = '2.0.3'
3
3
  end
@@ -179,11 +179,14 @@ module Seahorse
179
179
  # @param [Model::Api, Hash] api
180
180
  # @return [Model::Api]
181
181
  def set_api(api)
182
- if api.is_a?(Hash)
183
- @api = Model::Api.new(api)
184
- else
185
- @api = api
186
- end
182
+ @api =
183
+ case api
184
+ when nil then Model::Api.new({})
185
+ when Model::Api then api
186
+ when Hash then Model::Api.new(api)
187
+ when String then Model::Api.new(Util.load_json(api))
188
+ else raise ArgumentError, "invalid api definition #{api}"
189
+ end
187
190
  define_operation_methods
188
191
  @api
189
192
  end
@@ -20,6 +20,7 @@ module Seahorse
20
20
  # @attr_reader [Boolean] ssl_verify_peer
21
21
  # @attr_reader [String,nil] ssl_ca_bundle
22
22
  # @attr_reader [String,nil] ssl_ca_directory
23
+ # @attr_reader [String,nil] ssl_ca_store
23
24
  class ConnectionPool
24
25
 
25
26
  @pools_mutex = Mutex.new
@@ -36,6 +37,7 @@ module Seahorse
36
37
  ssl_verify_peer: true,
37
38
  ssl_ca_bundle: nil,
38
39
  ssl_ca_directory: nil,
40
+ ssl_ca_store: nil,
39
41
  }
40
42
 
41
43
  # @api private
@@ -237,6 +239,7 @@ module Seahorse
237
239
  :ssl_verify_peer => verify_peer,
238
240
  :ssl_ca_bundle => options[:ssl_ca_bundle],
239
241
  :ssl_ca_directory => options[:ssl_ca_directory],
242
+ :ssl_ca_store => options[:ssl_ca_store],
240
243
  }
241
244
  end
242
245
 
@@ -269,6 +272,7 @@ module Seahorse
269
272
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
270
273
  http.ca_file = ssl_ca_bundle if ssl_ca_bundle
271
274
  http.ca_path = ssl_ca_directory if ssl_ca_directory
275
+ http.cert_store = ssl_ca_store if ssl_ca_store
272
276
  else
273
277
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
274
278
  end
@@ -12,6 +12,7 @@ module Seahorse
12
12
  # @seahorse.client.option [Boolean] :ssl_verify_peer (true)
13
13
  # @seahorse.client.option [String] :ssl_ca_bundle
14
14
  # @seahorse.client.option [String] :ssl_ca_directory
15
+ # @seahorse.client.option [String] :ssl_ca_store
15
16
  class NetHttp < Plugin
16
17
 
17
18
  Client::NetHttp::ConnectionPool::OPTIONS.each_pair do |name, default|
@@ -1,4 +1,5 @@
1
1
  require 'cgi'
2
+ require 'multi_json'
2
3
 
3
4
  module Seahorse
4
5
  module Util
@@ -24,6 +25,10 @@ module Seahorse
24
25
  CGI::escape(string.encode('UTF-8')).gsub('+', '%20').gsub('%7E', '~')
25
26
  end
26
27
 
28
+ def load_json(path)
29
+ MultiJson.load(File.open(path, 'r', encoding: 'UTF-8') { |f| f.read })
30
+ end
31
+
27
32
  end
28
33
 
29
34
  @irregular_inflections = {}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
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-10-08 00:00:00.000000000 Z
11
+ date: 2014-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -82,7 +82,9 @@ files:
82
82
  - lib/aws-sdk-core/api/service_customizations.rb
83
83
  - lib/aws-sdk-core/autoscaling.rb
84
84
  - lib/aws-sdk-core/client.rb
85
+ - lib/aws-sdk-core/client_paging.rb
85
86
  - lib/aws-sdk-core/client_stubs.rb
87
+ - lib/aws-sdk-core/client_waiters.rb
86
88
  - lib/aws-sdk-core/cloudformation.rb
87
89
  - lib/aws-sdk-core/cloudfront.rb
88
90
  - lib/aws-sdk-core/cloudsearch.rb
@@ -276,6 +278,7 @@ files:
276
278
  - apis/ElasticLoadBalancing.paginators.json
277
279
  - apis/ElasticTranscoder.api.json
278
280
  - apis/ElasticTranscoder.paginators.json
281
+ - apis/ElasticTranscoder.waiters.json
279
282
  - apis/EMR.api.json
280
283
  - apis/EMR.paginators.json
281
284
  - apis/Glacier.api.json
@@ -349,3 +352,4 @@ signing_key:
349
352
  specification_version: 4
350
353
  summary: AWS SDK for Ruby - Core
351
354
  test_files: []
355
+ has_rdoc: