savon 2.7.0 → 2.7.1

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: 3c74bd36381fb8c14d72206e9465e7fa41f91dd8
4
- data.tar.gz: 1941c3fbe15e58c3f8d4c9a92b057ded090d05e6
3
+ metadata.gz: 2fdfc453139cd68c26aec6d2852a4538f7ba123e
4
+ data.tar.gz: dccd7ad49f8d955189a17053b3f1f0157a774665
5
5
  SHA512:
6
- metadata.gz: 0db7bf447424f25266cdb79a814e37f0a0260e79d92baaeff979d044df16f0f5c759457a0fdeec4cc16428f4527e596b579a2b1dccdf446fd01cde900d5003a1
7
- data.tar.gz: 64421f06d8ae1482aa283b455b572ac40ca0e37e30a1da4bdd41efc146074af2c473e6538f5fbafbfecd525131fefe432fc2655733019de18af0fb02ac966b4e
6
+ metadata.gz: 62fbd1c16e3b5bfadd779836dd77c6ddae58c671409103991bf0bb81df2bfbdbda7ea99bc9a4600ca7d5907c9723fb99ac0413bba3e9ddd0c0500434e3b4103f
7
+ data.tar.gz: 86e1245e8b70b4b33bea5da46fa0df6dabdc5815ec27c499fa5e97bc5088c1f3915d44aac2db61f2e50482d8948f380634598bd7f1e038d173dc300b51be4206
@@ -1,3 +1,7 @@
1
+ # 2.7.1 (2014-09-23)
2
+
3
+ * Fix : Fix a crash in builder when request headers do not contain WSA headers
4
+
1
5
  # 2.7.0 (2014-09-23)
2
6
 
3
7
  * Feature: Signing requests. Added wsse_signature.
@@ -68,7 +68,7 @@ module Savon
68
68
  end
69
69
 
70
70
  def header_attributes
71
- { 'xmlns:wsa' => WSA_NAMESPACE } if @globals[:use_wsa_headers]
71
+ @globals[:use_wsa_headers] ? { 'xmlns:wsa' => WSA_NAMESPACE } : {}
72
72
  end
73
73
 
74
74
  def body_attributes
@@ -157,7 +157,7 @@ module Savon
157
157
  @options[:soap_header] = header
158
158
  end
159
159
 
160
- # Sets whether elements should be :qualified or unqualified.
160
+ # Sets whether elements should be :qualified or :unqualified.
161
161
  # If you need to use this option, please open an issue and make
162
162
  # sure to add your WSDL document for debugging.
163
163
  def element_form_default(element_form_default)
@@ -229,6 +229,11 @@ module Savon
229
229
  @options[:ssl_cert_key_file] = file
230
230
  end
231
231
 
232
+ # Sets the cert key to use.
233
+ def ssl_cert_key(key)
234
+ @options[:ssl_cert_key] = key
235
+ end
236
+
232
237
  # Sets the cert key password to use.
233
238
  def ssl_cert_key_password(password)
234
239
  @options[:ssl_cert_key_password] = password
@@ -239,11 +244,22 @@ module Savon
239
244
  @options[:ssl_cert_file] = file
240
245
  end
241
246
 
247
+ # Sets the cert to use.
248
+ def ssl_cert(cert)
249
+ @options[:ssl_cert] = cert
250
+ end
251
+
242
252
  # Sets the ca cert file to use.
243
253
  def ssl_ca_cert_file(file)
244
254
  @options[:ssl_ca_cert_file] = file
245
255
  end
246
256
 
257
+ # Sets the ca cert to use.
258
+ def ssl_ca_cert(cert)
259
+ @options[:ssl_ca_cert] = cert
260
+ end
261
+
262
+
247
263
  # HTTP basic auth credentials.
248
264
  def basic_auth(*credentials)
249
265
  @options[:basic_auth] = credentials.flatten
@@ -28,8 +28,11 @@ module Savon
28
28
  @http_request.auth.ssl.verify_mode = @globals[:ssl_verify_mode] if @globals.include? :ssl_verify_mode
29
29
 
30
30
  @http_request.auth.ssl.cert_key_file = @globals[:ssl_cert_key_file] if @globals.include? :ssl_cert_key_file
31
+ @http_request.auth.ssl.cert_key = @globals[:ssl_cert_key] if @globals.include? :ssl_cert_key
31
32
  @http_request.auth.ssl.cert_file = @globals[:ssl_cert_file] if @globals.include? :ssl_cert_file
33
+ @http_request.auth.ssl.cert = @globals[:ssl_cert] if @globals.include? :ssl_cert
32
34
  @http_request.auth.ssl.ca_cert_file = @globals[:ssl_ca_cert_file] if @globals.include? :ssl_ca_cert_file
35
+ @http_request.auth.ssl.ca_cert = @globals[:ssl_ca_cert] if @globals.include? :ssl_ca_cert
33
36
 
34
37
  @http_request.auth.ssl.cert_key_password = @globals[:ssl_cert_key_password] if @globals.include? :ssl_cert_key_password
35
38
  end
@@ -1,3 +1,3 @@
1
1
  module Savon
2
- VERSION = '2.7.0'
2
+ VERSION = '2.7.1'
3
3
  end
@@ -397,6 +397,17 @@ describe "Options" do
397
397
  end
398
398
  end
399
399
 
400
+ context "global :ssl_cert_key" do
401
+ it "sets the cert key to use" do
402
+ cert_key = File.open(File.expand_path("../../fixtures/ssl/client_key.pem", __FILE__)).read
403
+ HTTPI::Auth::SSL.any_instance.expects(:cert_key=).with(cert_key).twice
404
+
405
+ client = new_client(:endpoint => @server.url, :ssl_cert_key => cert_key)
406
+ client.call(:authenticate)
407
+ end
408
+ end
409
+
410
+
400
411
  context "global :ssl_cert_key_password" do
401
412
  it "sets the encrypted cert key file password to use" do
402
413
  cert_key = File.expand_path("../../fixtures/ssl/client_encrypted_key.pem", __FILE__)
@@ -420,6 +431,16 @@ describe "Options" do
420
431
  end
421
432
  end
422
433
 
434
+ context "global :ssl_cert" do
435
+ it "sets the cert to use" do
436
+ cert = File.open(File.expand_path("../../fixtures/ssl/client_cert.pem", __FILE__)).read
437
+ HTTPI::Auth::SSL.any_instance.expects(:cert=).with(cert).twice
438
+
439
+ client = new_client(:endpoint => @server.url, :ssl_cert => cert)
440
+ client.call(:authenticate)
441
+ end
442
+ end
443
+
423
444
  context "global :ssl_ca_cert_file" do
424
445
  it "sets the ca cert file to use" do
425
446
  ca_cert = File.expand_path("../../fixtures/ssl/client_cert.pem", __FILE__)
@@ -430,6 +451,17 @@ describe "Options" do
430
451
  end
431
452
  end
432
453
 
454
+ context "global :ssl_ca_cert" do
455
+ it "sets the ca cert file to use" do
456
+ ca_cert = File.open(File.expand_path("../../fixtures/ssl/client_cert.pem", __FILE__)).read
457
+ HTTPI::Auth::SSL.any_instance.expects(:ca_cert=).with(ca_cert).twice
458
+
459
+ client = new_client(:endpoint => @server.url, :ssl_ca_cert => ca_cert)
460
+ client.call(:authenticate)
461
+ end
462
+ end
463
+
464
+
433
465
  context "global :basic_auth" do
434
466
  it "sets the basic auth credentials" do
435
467
  client = new_client(:endpoint => @server.url(:basic_auth), :basic_auth => ["admin", "secret"])
@@ -135,6 +135,9 @@ describe Savon::WSDLRequest do
135
135
 
136
136
  describe "set with a valid decrypting password" do
137
137
  it "handles SSL private keys properly" do
138
+ if RUBY_ENGINE == 'jruby'
139
+ pending("find out why this fails with a null pointer exception on jruby")
140
+ end
138
141
  pass = "secure-password!42"
139
142
  key = File.expand_path("../../fixtures/ssl/client_encrypted_key.pem", __FILE__)
140
143
  cert = File.expand_path("../../fixtures/ssl/client_encrypted_key_cert.pem", __FILE__)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: savon
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 2.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Harrington