savon 2.7.0 → 2.7.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/savon/builder.rb +1 -1
- data/lib/savon/options.rb +17 -1
- data/lib/savon/request.rb +3 -0
- data/lib/savon/version.rb +1 -1
- data/spec/savon/options_spec.rb +32 -0
- data/spec/savon/request_spec.rb +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fdfc453139cd68c26aec6d2852a4538f7ba123e
|
4
|
+
data.tar.gz: dccd7ad49f8d955189a17053b3f1f0157a774665
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62fbd1c16e3b5bfadd779836dd77c6ddae58c671409103991bf0bb81df2bfbdbda7ea99bc9a4600ca7d5907c9723fb99ac0413bba3e9ddd0c0500434e3b4103f
|
7
|
+
data.tar.gz: 86e1245e8b70b4b33bea5da46fa0df6dabdc5815ec27c499fa5e97bc5088c1f3915d44aac2db61f2e50482d8948f380634598bd7f1e038d173dc300b51be4206
|
data/CHANGELOG.md
CHANGED
data/lib/savon/builder.rb
CHANGED
data/lib/savon/options.rb
CHANGED
@@ -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
|
data/lib/savon/request.rb
CHANGED
@@ -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
|
data/lib/savon/version.rb
CHANGED
data/spec/savon/options_spec.rb
CHANGED
@@ -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"])
|
data/spec/savon/request_spec.rb
CHANGED
@@ -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__)
|