aws-sdk-core 2.1.0 → 2.1.4

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.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/apis/autoscaling/2011-01-01/api-2.json +41 -4
  3. data/apis/cloudfront/{2014-11-06 → 2015-04-17}/api-2.json +92 -52
  4. data/apis/cloudfront/{2014-11-06 → 2015-04-17}/paginators-1.json +0 -0
  5. data/apis/cloudfront/{2014-11-06 → 2015-04-17}/waiters-2.json +0 -0
  6. data/apis/codecommit/2015-04-13/api-2.json +885 -0
  7. data/apis/codecommit/2015-04-13/paginators-1.json +14 -0
  8. data/apis/codepipeline/2015-07-09/api-2.json +1640 -0
  9. data/apis/cognito-identity/2014-06-30/api-2.json +18 -0
  10. data/apis/cognito-sync/2014-06-30/api-2.json +22 -0
  11. data/apis/config/2014-11-12/api-2.json +24 -1
  12. data/apis/ec2/2015-04-15/api-2.json +34 -3
  13. data/apis/ec2/2015-04-15/resources-1.json +66 -17
  14. data/apis/ecs/2014-11-13/api-2.json +22 -3
  15. data/apis/email/2010-12-01/api-2.json +163 -2
  16. data/apis/glacier/2012-06-01/api-2.json +174 -0
  17. data/apis/iam/2010-05-08/api-2.json +346 -17
  18. data/apis/iam/2010-05-08/paginators-1.json +32 -0
  19. data/apis/iam/2010-05-08/resources-1.json +8 -0
  20. data/apis/iam/2010-05-08/waiters-2.json +22 -0
  21. data/apis/lambda/2015-03-31/api-2.json +4 -1
  22. data/apis/opsworks/2013-02-18/api-2.json +88 -34
  23. data/apis/redshift/2012-12-01/api-2.json +423 -5
  24. data/apis/redshift/2012-12-01/waiters-2.json +33 -23
  25. data/apis/sts/2011-06-15/api-2.json +2 -2
  26. data/bin/aws.rb +6 -0
  27. data/lib/aws-sdk-core/api/builder.rb +8 -0
  28. data/lib/aws-sdk-core/api/docs/builder.rb +4 -4
  29. data/lib/aws-sdk-core/api/docs/operation_documenter.rb +1 -1
  30. data/lib/aws-sdk-core/api/shape_map.rb +10 -8
  31. data/lib/aws-sdk-core/client_stubs.rb +6 -2
  32. data/lib/aws-sdk-core/cloudfront.rb +4 -4
  33. data/lib/aws-sdk-core/codecommit.rb +5 -0
  34. data/lib/aws-sdk-core/codepipeline.rb +4 -0
  35. data/lib/aws-sdk-core/credential_provider.rb +5 -7
  36. data/lib/aws-sdk-core/dynamodb/attribute_value.rb +2 -2
  37. data/lib/aws-sdk-core/dynamodb.rb +14 -0
  38. data/lib/aws-sdk-core/eager_loader.rb +5 -6
  39. data/lib/aws-sdk-core/iam.rb +1 -0
  40. data/lib/aws-sdk-core/instance_profile_credentials.rb +1 -1
  41. data/lib/aws-sdk-core/json/handler.rb +4 -4
  42. data/lib/aws-sdk-core/pageable_response.rb +44 -34
  43. data/lib/aws-sdk-core/pager.rb +2 -3
  44. data/lib/aws-sdk-core/plugins/dynamodb_simple_attributes.rb +4 -0
  45. data/lib/aws-sdk-core/plugins/ec2_copy_encrypted_snapshot.rb +2 -1
  46. data/lib/aws-sdk-core/plugins/regional_endpoint.rb +2 -2
  47. data/lib/aws-sdk-core/plugins/response_paging.rb +1 -0
  48. data/lib/aws-sdk-core/shared_credentials.rb +2 -2
  49. data/lib/aws-sdk-core/signers/s3.rb +31 -3
  50. data/lib/aws-sdk-core/stubbing/protocols/ec2.rb +3 -5
  51. data/lib/aws-sdk-core/stubbing/protocols/rest_xml.rb +0 -1
  52. data/lib/aws-sdk-core/type_builder.rb +14 -0
  53. data/lib/aws-sdk-core/version.rb +1 -1
  54. data/lib/aws-sdk-core/xml/parser/engines/oga.rb +39 -0
  55. data/lib/aws-sdk-core/xml/parser.rb +4 -1
  56. data/lib/aws-sdk-core.rb +19 -15
  57. data/lib/seahorse/client/http/request.rb +1 -1
  58. data/lib/seahorse/client/http/response.rb +5 -3
  59. data/lib/seahorse/client/net_http/connection_pool.rb +2 -2
  60. metadata +13 -15
  61. data/apis/config/2014-10-17/api-2.json +0 -694
  62. data/apis/config/2014-10-17/paginators-1.json +0 -10
  63. data/apis/ec2/2014-10-01/api-2.json +0 -10267
  64. data/apis/ec2/2014-10-01/paginators-1.json +0 -125
  65. data/apis/ec2/2014-10-01/resources-1.json +0 -2289
  66. data/apis/ec2/2014-10-01/waiters-2.json +0 -453
  67. data/apis/ec2/2015-03-01/api-2.json +0 -11245
  68. data/apis/ec2/2015-03-01/paginators-1.json +0 -125
  69. data/apis/ec2/2015-03-01/resources-1.json +0 -2479
  70. data/apis/ec2/2015-03-01/waiters-2.json +0 -458
@@ -1,7 +1,7 @@
1
1
  require 'set'
2
2
  require 'time'
3
3
  require 'openssl'
4
- require 'uri'
4
+ require 'webrick/httputils'
5
5
 
6
6
  module Aws
7
7
  module Signers
@@ -53,7 +53,7 @@ module Aws
53
53
  def signature(request)
54
54
  string_to_sign = string_to_sign(request)
55
55
  signature = digest(credentials.secret_access_key, string_to_sign)
56
- URI.escape(signature)
56
+ uri_escape(signature)
57
57
  end
58
58
 
59
59
  def digest(secret, string_to_sign)
@@ -150,7 +150,35 @@ module Aws
150
150
  def signed_querystring_params(endpoint)
151
151
  endpoint.query.to_s.split('&').select do |p|
152
152
  SIGNED_QUERYSTRING_PARAMS.include?(p.split('=')[0])
153
- end.map { |p| URI.decode(p) }
153
+ end.map { |p| CGI.unescape(p) }
154
+ end
155
+
156
+ def uri_escape(s)
157
+
158
+ #URI.escape(s)
159
+
160
+ # URI.escape is deprecated, replacing it with escape from webrick
161
+ # to squelch the massive number of warnings generated from Ruby.
162
+ # The following script was used to determine the differences
163
+ # between the various escape methods available. The webrick
164
+ # escape only had two differences and it is available in the
165
+ # standard lib.
166
+ #
167
+ # (0..255).each {|c|
168
+ # s = [c].pack("C")
169
+ # e = [
170
+ # CGI.escape(s),
171
+ # ERB::Util.url_encode(s),
172
+ # URI.encode_www_form_component(s),
173
+ # WEBrick::HTTPUtils.escape_form(s),
174
+ # WEBrick::HTTPUtils.escape(s),
175
+ # URI.escape(s),
176
+ # ]
177
+ # next if e.uniq.length == 1
178
+ # puts("%5s %5s %5s %5s %5s %5s %5s" % ([s.inspect] + e))
179
+ # }
180
+ #
181
+ WEBrick::HTTPUtils.escape(s).gsub('%5B', '[').gsub('%5D', ']')
154
182
  end
155
183
 
156
184
  end
@@ -31,11 +31,9 @@ module Aws
31
31
 
32
32
  def build_body(api, operation, data)
33
33
  xml = []
34
- if rules = operation.output
35
- Xml::Builder.new(operation.output, target:xml).to_xml(data)
36
- xml.shift
37
- xml.pop
38
- end
34
+ Xml::Builder.new(operation.output, target:xml).to_xml(data)
35
+ xml.shift
36
+ xml.pop
39
37
  xmlns = "http://ec2.amazonaws.com/doc/#{api.version}/".inspect
40
38
  xml.unshift(" <requestId>stubbed-request-id</requestId>")
41
39
  xml.unshift("<#{operation.name}Response xmlns=#{xmlns}>\n")
@@ -7,7 +7,6 @@ module Aws
7
7
 
8
8
  def body_for(api, operation, rules, data)
9
9
  xml = []
10
- builder = Aws::Xml::DocBuilder.new(target: xml, indent: ' ')
11
10
  rules.location_name = operation.name + 'Result'
12
11
  rules['xmlNamespace'] = { 'uri' => api.metadata['xmlNamespace'] }
13
12
  Xml::Builder.new(rules, target:xml).to_xml(data)
@@ -0,0 +1,14 @@
1
+ module Aws
2
+ # @api private
3
+ class TypeBuilder
4
+
5
+ def initialize(svc_module)
6
+ @types_module = svc_module.const_set(:Types, Module.new)
7
+ end
8
+
9
+ def build_type(shape, shapes)
10
+ @types_module.const_set(shape.name, Structure.new(*shape.member_names))
11
+ end
12
+
13
+ end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module Aws
2
- VERSION = '2.1.0'
2
+ VERSION = '2.1.4'
3
3
  end
@@ -0,0 +1,39 @@
1
+ require 'oga'
2
+
3
+ module Aws
4
+ module Xml
5
+ class Parser
6
+ class OgaEngine
7
+
8
+ def initialize(stack)
9
+ @stack = stack
10
+ @depth = 0
11
+ end
12
+
13
+ def parse(xml)
14
+ Oga.sax_parse_xml(self, xml, strict:true)
15
+ rescue LL::ParserError => error
16
+ raise ParsingError.new(error.message, nil, nil)
17
+ end
18
+
19
+ def on_element(namespace, name, attrs = {})
20
+ @depth += 1
21
+ @stack.start_element(name)
22
+ attrs.each do |attr|
23
+ @stack.attr(*attr)
24
+ end
25
+ end
26
+
27
+ def on_text(value)
28
+ @stack.text(value) if @depth > 0
29
+ end
30
+
31
+ def after_element(_, _)
32
+ @stack.end_element
33
+ @depth -= 1
34
+ end
35
+
36
+ end
37
+ end
38
+ end
39
+ end
@@ -10,6 +10,7 @@ module Aws
10
10
 
11
11
  autoload :LibxmlEngine, 'aws-sdk-core/xml/parser/engines/libxml'
12
12
  autoload :NokogiriEngine, 'aws-sdk-core/xml/parser/engines/nokogiri'
13
+ autoload :OgaEngine, 'aws-sdk-core/xml/parser/engines/oga'
13
14
  autoload :OxEngine, 'aws-sdk-core/xml/parser/engines/ox'
14
15
  autoload :RexmlEngine, 'aws-sdk-core/xml/parser/engines/rexml'
15
16
 
@@ -35,6 +36,7 @@ module Aws
35
36
  # Must be one of the following values:
36
37
  #
37
38
  # * :ox
39
+ # * :oga
38
40
  # * :libxml
39
41
  # * :nokogiri
40
42
  # * :rexml
@@ -47,6 +49,7 @@ module Aws
47
49
  # One of:
48
50
  #
49
51
  # * {OxEngine}
52
+ # * {OgaEngine}
50
53
  # * {LibxmlEngine}
51
54
  # * {NokogiriEngine}
52
55
  # * {RexmlEngine}
@@ -71,7 +74,7 @@ module Aws
71
74
 
72
75
  end
73
76
 
74
- self.engine = [:ox, :libxml, :nokogiri, :rexml].find do |name|
77
+ self.engine = [:ox, :oga, :libxml, :nokogiri, :rexml].find do |name|
75
78
  try_load_engine(name)
76
79
  end
77
80
 
data/lib/aws-sdk-core.rb CHANGED
@@ -26,7 +26,9 @@ module Aws
26
26
  CloudTrail
27
27
  CloudWatch
28
28
  CloudWatchLogs
29
+ CodeCommit
29
30
  CodeDeploy
31
+ CodePipeline
30
32
  CognitoIdentity
31
33
  CognitoSync
32
34
  ConfigService
@@ -99,6 +101,7 @@ module Aws
99
101
  autoload :SharedCredentials, 'aws-sdk-core/shared_credentials'
100
102
  autoload :Structure, 'aws-sdk-core/structure'
101
103
  autoload :TreeHash, 'aws-sdk-core/tree_hash'
104
+ autoload :TypeBuilder, 'aws-sdk-core/type_builder'
102
105
  autoload :VERSION, 'aws-sdk-core/version'
103
106
 
104
107
  # @api private
@@ -191,7 +194,6 @@ module Aws
191
194
  # @api private
192
195
  module Signers
193
196
  autoload :Base, 'aws-sdk-core/signers/base'
194
- autoload :Handler, 'aws-sdk-core/signers/handler'
195
197
  autoload :S3, 'aws-sdk-core/signers/s3'
196
198
  autoload :V2, 'aws-sdk-core/signers/v2'
197
199
  autoload :V3, 'aws-sdk-core/signers/v3'
@@ -285,16 +287,25 @@ module Aws
285
287
  eager_loader = EagerLoader.new
286
288
  eager_loader.load(JMESPath)
287
289
  eager_loader.load(Seahorse)
288
- (options[:services] || SERVICE_MODULE_NAMES).each do |svc_name|
289
- begin
290
- eager_loader.load(Aws.const_get(svc_name))
291
- rescue NameError
292
- raise ArgumentError, "invalid service Aws::#{svc_name}"
293
- end
290
+ sub_modules(options).each do |module_or_class|
291
+ eager_loader.load(module_or_class)
294
292
  end
295
293
  eager_loader
296
294
  end
297
295
 
296
+ def sub_modules(options = {})
297
+ constants = Aws.constants.map(&:to_s)
298
+ if options[:services]
299
+ constants -= SERVICE_MODULE_NAMES
300
+ constants += options[:services] || SERVICE_MODULE_NAMES
301
+ end
302
+ constants.inject([]) do |modules, const_name|
303
+ constant = Aws.const_get(const_name)
304
+ modules << constant if Module === constant
305
+ modules
306
+ end
307
+ end
308
+
298
309
  # Yields to the given block for each service that has already been
299
310
  # defined via {add_service}. Also yields to the given block for
300
311
  # each new service added after the callback is registered.
@@ -339,18 +350,11 @@ module Aws
339
350
 
340
351
  # build service client classes
341
352
  service_added do |name, svc_module, options|
353
+ options[:type_builder] ||= TypeBuilder.new(svc_module)
342
354
  svc_module.const_set(:Client, Client.define(name, options))
343
355
  svc_module.const_set(:Errors, Module.new { extend Errors::DynamicErrors })
344
356
  end
345
357
 
346
- # define a struct class for each client data type
347
- service_added do |name, svc_module, options|
348
- svc_module.const_set(:Types, Module.new)
349
- svc_module::Client.api.metadata['shapes'].each_structure do |shape|
350
- svc_module::Types.const_set(shape.name, shape[:struct_class])
351
- end
352
- end
353
-
354
358
  # enable response paging
355
359
  service_added do |name, svc_module, options|
356
360
  if paginators = options[:paginators]
@@ -11,7 +11,7 @@ module Seahorse
11
11
  # @option options [Headers] :headers (Headers.new)
12
12
  # @option options [Body] :body (StringIO.new)
13
13
  def initialize(options = {})
14
- self.endpoint = options[:endpoint] if options[:endpoint]
14
+ self.endpoint = options[:endpoint]
15
15
  self.http_method = options[:http_method] || 'GET'
16
16
  self.headers = Headers.new(options[:headers] || {})
17
17
  self.body = options[:body]
@@ -23,12 +23,14 @@ module Seahorse
23
23
  # @return [Headers]
24
24
  attr_accessor :headers
25
25
 
26
- # @return [IO]
27
- attr_accessor :body
28
-
29
26
  # @return [StandardError, nil]
30
27
  attr_reader :error
31
28
 
29
+ # @return [IO]
30
+ def body
31
+ @body
32
+ end
33
+
32
34
  # @param [#read, #size, #rewind] io
33
35
  def body=(io)
34
36
  @body = case io
@@ -106,9 +106,9 @@ module Seahorse
106
106
  session.continue_timeout = http_continue_timeout if
107
107
  session.respond_to?(:continue_timeout=)
108
108
  yield(session)
109
- rescue Exception => error
109
+ rescue
110
110
  session.finish if session
111
- raise error
111
+ raise
112
112
  else
113
113
  # No error raised? Good, check the session into the pool.
114
114
  @pool_mutex.synchronize { @pool[endpoint] << session }
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.1.0
4
+ version: 2.1.4
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: 2015-06-12 00:00:00.000000000 Z
11
+ date: 2015-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath
@@ -39,21 +39,22 @@ files:
39
39
  - apis/cloudformation/2010-05-15/paginators-1.json
40
40
  - apis/cloudformation/2010-05-15/resources-1.json
41
41
  - apis/cloudformation/2010-05-15/waiters-2.json
42
- - apis/cloudfront/2014-11-06/api-2.json
43
- - apis/cloudfront/2014-11-06/paginators-1.json
44
- - apis/cloudfront/2014-11-06/waiters-2.json
42
+ - apis/cloudfront/2015-04-17/api-2.json
43
+ - apis/cloudfront/2015-04-17/paginators-1.json
44
+ - apis/cloudfront/2015-04-17/waiters-2.json
45
45
  - apis/cloudhsm/2014-05-30/api-2.json
46
46
  - apis/cloudsearch/2013-01-01/api-2.json
47
47
  - apis/cloudsearch/2013-01-01/paginators-1.json
48
48
  - apis/cloudsearchdomain/2013-01-01/api-2.json
49
49
  - apis/cloudtrail/2013-11-01/api-2.json
50
50
  - apis/cloudtrail/2013-11-01/paginators-1.json
51
+ - apis/codecommit/2015-04-13/api-2.json
52
+ - apis/codecommit/2015-04-13/paginators-1.json
51
53
  - apis/codedeploy/2014-10-06/api-2.json
52
54
  - apis/codedeploy/2014-10-06/paginators-1.json
55
+ - apis/codepipeline/2015-07-09/api-2.json
53
56
  - apis/cognito-identity/2014-06-30/api-2.json
54
57
  - apis/cognito-sync/2014-06-30/api-2.json
55
- - apis/config/2014-10-17/api-2.json
56
- - apis/config/2014-10-17/paginators-1.json
57
58
  - apis/config/2014-11-12/api-2.json
58
59
  - apis/config/2014-11-12/paginators-1.json
59
60
  - apis/datapipeline/2012-10-29/api-2.json
@@ -65,14 +66,6 @@ files:
65
66
  - apis/dynamodb/2012-08-10/paginators-1.json
66
67
  - apis/dynamodb/2012-08-10/resources-1.json
67
68
  - apis/dynamodb/2012-08-10/waiters-2.json
68
- - apis/ec2/2014-10-01/api-2.json
69
- - apis/ec2/2014-10-01/paginators-1.json
70
- - apis/ec2/2014-10-01/resources-1.json
71
- - apis/ec2/2014-10-01/waiters-2.json
72
- - apis/ec2/2015-03-01/api-2.json
73
- - apis/ec2/2015-03-01/paginators-1.json
74
- - apis/ec2/2015-03-01/resources-1.json
75
- - apis/ec2/2015-03-01/waiters-2.json
76
69
  - apis/ec2/2015-04-15/api-2.json
77
70
  - apis/ec2/2015-04-15/paginators-1.json
78
71
  - apis/ec2/2015-04-15/resources-1.json
@@ -105,6 +98,7 @@ files:
105
98
  - apis/iam/2010-05-08/api-2.json
106
99
  - apis/iam/2010-05-08/paginators-1.json
107
100
  - apis/iam/2010-05-08/resources-1.json
101
+ - apis/iam/2010-05-08/waiters-2.json
108
102
  - apis/importexport/2010-06-01/api-2.json
109
103
  - apis/importexport/2010-06-01/paginators-1.json
110
104
  - apis/kinesis/2013-12-02/api-2.json
@@ -186,7 +180,9 @@ files:
186
180
  - lib/aws-sdk-core/cloudtrail.rb
187
181
  - lib/aws-sdk-core/cloudwatch.rb
188
182
  - lib/aws-sdk-core/cloudwatchlogs.rb
183
+ - lib/aws-sdk-core/codecommit.rb
189
184
  - lib/aws-sdk-core/codedeploy.rb
185
+ - lib/aws-sdk-core/codepipeline.rb
190
186
  - lib/aws-sdk-core/cognitoidentity.rb
191
187
  - lib/aws-sdk-core/cognitosync.rb
192
188
  - lib/aws-sdk-core/configservice.rb
@@ -317,6 +313,7 @@ files:
317
313
  - lib/aws-sdk-core/support.rb
318
314
  - lib/aws-sdk-core/swf.rb
319
315
  - lib/aws-sdk-core/tree_hash.rb
316
+ - lib/aws-sdk-core/type_builder.rb
320
317
  - lib/aws-sdk-core/version.rb
321
318
  - lib/aws-sdk-core/waiters/errors.rb
322
319
  - lib/aws-sdk-core/waiters/null_provider.rb
@@ -332,6 +329,7 @@ files:
332
329
  - lib/aws-sdk-core/xml/parser.rb
333
330
  - lib/aws-sdk-core/xml/parser/engines/libxml.rb
334
331
  - lib/aws-sdk-core/xml/parser/engines/nokogiri.rb
332
+ - lib/aws-sdk-core/xml/parser/engines/oga.rb
335
333
  - lib/aws-sdk-core/xml/parser/engines/ox.rb
336
334
  - lib/aws-sdk-core/xml/parser/engines/rexml.rb
337
335
  - lib/aws-sdk-core/xml/parser/frame.rb