soap-object 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzUzYTViOTE3ZDJmYTI1OTRhNWFhYjllMGI5ZmU4ZTdmZDQxYmI1NQ==
4
+ NDIwMTlmZDU5ODgxODQwYjQxZjBiODJjYTRhZDQ1NTY0NGM0ZjFkMg==
5
5
  data.tar.gz: !binary |-
6
- MTNlMDRhMGY5YjU0NTEzNzk5N2E5NTI2MzMyNTgxNmExN2YyNjZmZQ==
6
+ NzMwMWY4Zjk4MmZlMTA5NGVmNDUyNWFkNWJlMzJlZDM3MmQ3NDI5Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDIyYzBmZjdiYWY2NTE1NGRjNTU0YTFmZTNjMjM5ODM4MDdhZDJkYWMzNGFl
10
- YjkwZjhjYjZmMGE4OGZmYjZkOTRlNDEyOTkxNmFhZGM1NTlkY2M1N2UyMmNl
11
- ZTZlMTI4NmVlOGViMjU2ZjhlN2FlYTc5ZmM4MDFiODI4Mjk3ODA=
9
+ ZjQxMDkzODA0MjdjNWUzNDIwZWQ2Nzk2Nzc2MzYzNjU5NzFkZjY3NGMxYWU4
10
+ MzJlOWQ2NzkxYzI2OTlhMThjOTgwYzJhNDU1OTI3NWE1YWQ5NjQ3NmEwMWRl
11
+ N2UwYmMyY2I4NGFlMTA3NjY4YmYwNjU3MDU4NTM0NjUwNTJjMjk=
12
12
  data.tar.gz: !binary |-
13
- NTk2MGJhNTcwNzNhNWNkYjNkYzg5MDczZjZmYzFkNmI2MjQ3NDg4ODA2ZTIy
14
- ZTgyYjcxNjM5YWI1MDVkNDY0YTc4M2RmYmU5YjYyNTAwZTc5YmU2MWY4ZWNm
15
- MDQ2NTQyY2MyNGNlM2NlNTc4MzFkZTRlOWJjYjk3MzI0MDE4ZmE=
13
+ ZWU0MTQ5YWRkYjFmYjk1YmMxY2M5MjFjNDFlMDQ3MWEzMWQwMjNhMWYyOGNk
14
+ NjI3NmRlMDc5MDZjMmI2MDE0ZjZjYmU2ZDQzZWRhZWE4Nzc2MGZjYjUzOTll
15
+ M2ZiZmFiYzY2NjQxMjZkODkwOWUwNWFhNTgzMzA4NzM3ZDJiN2M=
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ === Version 0.6.3 / 2015-3-26
2
+ * Enhancements
3
+ * Added ability to disable ssl verification
4
+
1
5
  === Version 0.6.2 / 2015-3-12
2
6
  * Enhancements
3
7
  * Calling xpath on Savon response, to take advantage of namespace collecting from response.
data/lib/soap-object.rb CHANGED
@@ -118,7 +118,8 @@ module SoapObject
118
118
  :with_encoding,
119
119
  :with_basic_auth,
120
120
  :with_digest_auth,
121
- :with_log_level].each do |sym|
121
+ :with_log_level,
122
+ :with_ssl_verification].each do |sym|
122
123
  properties = properties.merge(self.send sym) if self.respond_to? sym
123
124
  end
124
125
  properties
@@ -6,7 +6,7 @@ module SoapObject
6
6
  # Sets the url for the wsdl. It can be a path to a local file or
7
7
  # a url to a remote server containing the file.
8
8
  #
9
- # @param [Stroing] either the local path to or the remote url to
9
+ # @param [String] either the local path to or the remote url to
10
10
  # the wsdl to use for all requests.
11
11
  #
12
12
  def wsdl(url)
@@ -107,5 +107,19 @@ module SoapObject
107
107
  {log: true, log_level: level}
108
108
  end
109
109
  end
110
+
111
+ #
112
+ # Enable/Disable SSL verification when calling services over HTTPS (Default is true)
113
+ #
114
+ # @param [Boolean] valid values are true, false
115
+ #
116
+ def ssl_verification(enable)
117
+ unless enable
118
+ define_method(:with_ssl_verification) do
119
+ {ssl_verify_mode: :none}
120
+ end
121
+ end
122
+ end
123
+
110
124
  end
111
125
  end
@@ -1,5 +1,5 @@
1
1
  module Soap
2
2
  module Object
3
- VERSION = "0.6.2"
3
+ VERSION = "0.6.3"
4
4
  end
5
5
  end
@@ -12,12 +12,18 @@ class TestServiceWithWsdl
12
12
  basic_auth 'steve', 'secret'
13
13
  digest_auth 'digest', 'auth'
14
14
  log_level :error
15
+ ssl_verification false
15
16
  end
16
17
 
17
- class TestServiceWithOutLogging
18
+ class TestSoapObjectWithoutClientProperties
18
19
  include SoapObject
19
20
  end
20
21
 
22
+ class TestSoapObjectWithExplicitSslVerification
23
+ include SoapObject
24
+ ssl_verification true
25
+ end
26
+
21
27
  class TestWorld
22
28
  include SoapObject::Factory
23
29
  end
@@ -68,7 +74,7 @@ describe SoapObject do
68
74
  end
69
75
 
70
76
  it "should disable logging when no logging level set" do
71
- expect(TestServiceWithOutLogging.new.send(:client_properties)[:log]).to eq(false)
77
+ expect(TestSoapObjectWithoutClientProperties.new.send(:client_properties)[:log]).to eq(false)
72
78
  end
73
79
 
74
80
  it "should enable logging when logging level set" do
@@ -79,6 +85,18 @@ describe SoapObject do
79
85
  expect(subject.send(:client_properties)[:log_level]).to eq(:error)
80
86
  end
81
87
 
88
+ it "should enable SSL verification by default" do
89
+ expect(TestSoapObjectWithoutClientProperties.new.send(:client_properties)[:ssl_verify_mode]).to be_nil
90
+ end
91
+
92
+ it "should allow one to disable SSL verification" do
93
+ expect(subject.send(:client_properties)[:ssl_verify_mode]).to eq(:none)
94
+ end
95
+
96
+ it "should allow one to explicitly enable SSL verification" do
97
+ expect(TestSoapObjectWithExplicitSslVerification.new.send(:client_properties)[:ssl_verify_mode]).to be_nil
98
+ end
99
+
82
100
  end
83
101
 
84
102
  context "when using the factory to create to service" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soap-object
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey S. Morgan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-12 00:00:00.000000000 Z
12
+ date: 2015-03-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: savon