aws-sdk-core 3.0.0.rc7 → 3.0.0.rc8

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: 0b7d91df64c3126cf3188aad6c49f4c8b095f44c
4
- data.tar.gz: acdab5f0c71bb0a261d1e7f03fa0f3ee06ae601d
3
+ metadata.gz: e488f568ce29d25bb890051d48ad9031f10bc38f
4
+ data.tar.gz: b4d1b49a01d4221be5f92521ba4f13a08fbaf4ea
5
5
  SHA512:
6
- metadata.gz: 115c0dd880b82240492988d648200be72072ff6883ec8c8b46188367d3b58151cdbb03b94f757d53dafc662112adb372347a3007a0f24b4dab1902b8a9085a8e
7
- data.tar.gz: f66cd8d4a9164cd64186165c9ce099513b64465ac90f9df87d759fa2f3836bd1eba9977afc040c9573aefb370b56bbccf6f9003c4a8827b7bd7bb12d65f1b6e9
6
+ metadata.gz: cfbf6a376a94e2792d4b0c9694495bbdef4be9f71161c5be61683a07d41123a8aa301e01abaefbc70d242e0079478fdb6bf6022679bb35569ac8934541e60772
7
+ data.tar.gz: 7893cea9ecf83566f15a46f405f9b8cd8a5b5e85f8a811d3b037eaf15bb2b4a2f897aeaa7435b29c8920fa827c54b10d20df9d64e04961804412d9683c4ec6e3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.0.rc7
1
+ 3.0.0.rc8
@@ -124,6 +124,25 @@ module Aws
124
124
  ))
125
125
  end
126
126
 
127
+ # Close any long-lived connections maintained by the SDK's internal
128
+ # connection pool.
129
+ #
130
+ # Applications that rely heavily on the `fork()` system call on POSIX systems
131
+ # should call this method in the child process directly after fork to ensure
132
+ # there are no race conditions between the parent
133
+ # process and its children
134
+ # for the pooled TCP connections.
135
+ #
136
+ # Child processes that make multi-threaded calls to the SDK should block on
137
+ # this call before beginning work.
138
+ #
139
+ # @return [nil]
140
+ def empty_connection_pools!
141
+ Seahorse::Client::NetHttp::ConnectionPool.pools.each do |pool|
142
+ pool.empty!
143
+ end
144
+ end
145
+
127
146
  # @api private
128
147
  def eager_autoload!(*args)
129
148
  msg = 'Aws.eager_autoload is no longer needed, usage of '
@@ -11,7 +11,7 @@ module Aws
11
11
  #
12
12
  # @api private
13
13
  # begin
14
- SENSITIVE = [:access_token, :account_name, :admin_contact, :artifact_credentials, :auth_code, :base_32_string_seed, :client_id, :client_secret, :copy_source_sse_customer_key, :credentials, :email, :id, :id_token, :local_console_password, :master_account_email, :message, :name, :new_password, :notes, :old_password, :owner_information, :parameters, :password, :payload, :plaintext, :previous_password, :private_key, :proposed_password, :public_key, :qr_code_png, :query, :refresh_token, :registrant_contact, :secret_access_key, :secret_hash, :service_password, :shared_secret, :sse_customer_key, :ssekms_key_id, :status_message, :task_parameters, :tech_contact, :temporary_password, :trust_password, :upload_credentials, :upload_url, :username, :value, :values, :variables, :zip_file]
14
+ SENSITIVE = [:access_token, :account_name, :admin_contact, :artifact_credentials, :auth_code, :base_32_string_seed, :client_id, :client_secret, :copy_source_sse_customer_key, :credentials, :db_password, :description, :email, :id, :id_token, :local_console_password, :master_account_email, :message, :name, :new_password, :notes, :old_password, :owner_information, :parameters, :password, :payload, :plaintext, :previous_password, :private_key, :proposed_password, :public_key, :qr_code_png, :query, :refresh_token, :registrant_contact, :secret_access_key, :secret_hash, :service_password, :shared_secret, :sse_customer_key, :ssekms_key_id, :status_message, :task_parameters, :tech_contact, :temporary_password, :trust_password, :upload_credentials, :upload_url, :username, :value, :values, :variables, :zip_file]
15
15
  # end
16
16
 
17
17
  def initialize(options = {})
@@ -0,0 +1,29 @@
1
+ module Aws
2
+ module Plugins
3
+
4
+ # Converts input value to JSON Syntax for members with jsonvalue trait
5
+ class JsonvalueConverter < Seahorse::Client::Plugin
6
+
7
+ # @api private
8
+ class Handler < Seahorse::Client::Handler
9
+
10
+ def call(context)
11
+ context.operation.input.shape.members.each do |m, ref|
12
+ if ref['jsonvalue']
13
+ param_value = context.params[m]
14
+ unless param_value.respond_to?(:to_json)
15
+ raise ArgumentError, "The value of params[#{m}] is not JSON serializable."
16
+ end
17
+ context.params[m] = param_value.to_json
18
+ end
19
+ end
20
+ @handler.call(context)
21
+ end
22
+
23
+ end
24
+
25
+ handler(Handler, step: :initialize)
26
+ end
27
+
28
+ end
29
+ end
@@ -96,7 +96,7 @@ module Aws
96
96
 
97
97
  # @api private
98
98
  def apply_signature(options = {})
99
- context = options[:context]
99
+ context = apply_authtype(options[:context])
100
100
  signer = options[:signer] || context.config.sigv4_signer
101
101
  req = context.http_request
102
102
 
@@ -125,6 +125,14 @@ module Aws
125
125
  context[:string_to_sign] = signature.string_to_sign
126
126
  end
127
127
 
128
+ # @api private
129
+ def apply_authtype(context)
130
+ if context.operation['authtype'].eql?('v4-unsigned-body') &&
131
+ context.http_request.endpoint.scheme.eql?('https')
132
+ context.http_request.headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD'
133
+ end
134
+ context
135
+ end
128
136
  end
129
137
  end
130
138
  end
@@ -1,4 +1,5 @@
1
1
  require 'time'
2
+ require 'base64'
2
3
 
3
4
  module Aws
4
5
  module Rest
@@ -28,6 +29,7 @@ module Aws
28
29
  private
29
30
 
30
31
  def apply_header_value(headers, ref, value)
32
+ value = apply_json_trait(value) if ref['jsonvalue']
31
33
  headers[ref.location_name] =
32
34
  case ref.shape
33
35
  when TimestampShape then value.utc.httpdate
@@ -42,6 +44,13 @@ module Aws
42
44
  end
43
45
  end
44
46
 
47
+ # With complex headers value in json syntax,
48
+ # base64 encodes value to aviod weird characters
49
+ # causing potential issues in headers
50
+ def apply_json_trait(value)
51
+ Base64.strict_encode64(value)
52
+ end
53
+
45
54
  end
46
55
  end
47
56
  end
@@ -1,4 +1,6 @@
1
1
  require 'time'
2
+ require 'base64'
3
+ require 'json'
2
4
 
3
5
  module Aws
4
6
  module Rest
@@ -31,6 +33,7 @@ module Aws
31
33
  end
32
34
 
33
35
  def cast_value(ref, value)
36
+ value = extract_json_trait(value) if ref['jsonvalue']
34
37
  case ref.shape
35
38
  when StringShape then value
36
39
  when IntegerShape then value.to_i
@@ -60,6 +63,10 @@ module Aws
60
63
  end
61
64
  end
62
65
 
66
+ def extract_json_trait(value)
67
+ JSON.parse(Base64.decode64(value))
68
+ end
69
+
63
70
  end
64
71
  end
65
72
  end
@@ -1,4 +1,4 @@
1
- require 'cgi'
1
+ require 'cgi/util'
2
2
 
3
3
  module Aws
4
4
  # @api private
@@ -1,4 +1,4 @@
1
- require 'cgi'
1
+ require 'cgi/util'
2
2
 
3
3
  module Aws
4
4
  module Xml
@@ -40,6 +40,6 @@ require_relative 'aws-sdk-sts/customizations'
40
40
  # @service
41
41
  module Aws::STS
42
42
 
43
- GEM_VERSION = '3.0.0.rc6'
43
+ GEM_VERSION = '3.0.0.rc7'
44
44
 
45
45
  end
@@ -18,6 +18,7 @@ require 'aws-sdk-core/plugins/regional_endpoint.rb'
18
18
  require 'aws-sdk-core/plugins/response_paging.rb'
19
19
  require 'aws-sdk-core/plugins/stub_responses.rb'
20
20
  require 'aws-sdk-core/plugins/idempotency_token.rb'
21
+ require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
21
22
  require 'aws-sdk-core/plugins/signature_v4.rb'
22
23
  require 'aws-sdk-core/plugins/protocols/query.rb'
23
24
 
@@ -45,6 +46,7 @@ module Aws::STS
45
46
  add_plugin(Aws::Plugins::ResponsePaging)
46
47
  add_plugin(Aws::Plugins::StubResponses)
47
48
  add_plugin(Aws::Plugins::IdempotencyToken)
49
+ add_plugin(Aws::Plugins::JsonvalueConverter)
48
50
  add_plugin(Aws::Plugins::SignatureV4)
49
51
  add_plugin(Aws::Plugins::Protocols::Query)
50
52
 
@@ -1249,7 +1251,7 @@ module Aws::STS
1249
1251
  params: params,
1250
1252
  config: config)
1251
1253
  context[:gem_name] = 'aws-sdk-core'
1252
- context[:gem_version] = '3.0.0.rc6'
1254
+ context[:gem_version] = '3.0.0.rc7'
1253
1255
  Seahorse::Client::Request.new(handlers, context)
1254
1256
  end
1255
1257
 
@@ -173,7 +173,9 @@ module Seahorse
173
173
  end
174
174
 
175
175
  def _http_response_body(response)
176
- summarize_value(response.context.http_response.body_contents)
176
+ response.context.http_response.body.respond_to?(:rewind) ?
177
+ summarize_value(response.context.http_response.body_contents) :
178
+ ''
177
179
  end
178
180
 
179
181
  def _error_class(response)
@@ -1,4 +1,4 @@
1
- require 'cgi'
1
+ require 'cgi/util'
2
2
 
3
3
  module Seahorse
4
4
  # @api private
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: 3.0.0.rc7
4
+ version: 3.0.0.rc8
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-03-09 00:00:00.000000000 Z
11
+ date: 2017-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath
@@ -92,6 +92,7 @@ files:
92
92
  - lib/aws-sdk-core/plugins/global_configuration.rb
93
93
  - lib/aws-sdk-core/plugins/helpful_socket_errors.rb
94
94
  - lib/aws-sdk-core/plugins/idempotency_token.rb
95
+ - lib/aws-sdk-core/plugins/jsonvalue_converter.rb
95
96
  - lib/aws-sdk-core/plugins/logging.rb
96
97
  - lib/aws-sdk-core/plugins/param_converter.rb
97
98
  - lib/aws-sdk-core/plugins/param_validator.rb