net-ldap 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of net-ldap might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c96669822fdcf032465b410615500b91a2f31ec
4
- data.tar.gz: 643738d3f05ae5469ef1eb773326d5943eacf923
3
+ metadata.gz: 421bbec8d29a64da8b006d4403383c4fb9d71de0
4
+ data.tar.gz: 78ede43bcf3b9c3818ea80dac400f708698ae3c0
5
5
  SHA512:
6
- metadata.gz: 6a7a455c387b73745d6da20d890181c20776562751f0c4bd43b9eb9a7ad9d2637771e1dfdaecbeb7e951ba25bca9859219e32e1154a88eed12e162152f47df0e
7
- data.tar.gz: e92116ed732575ba7f0f05fb52f1148bd9c432de28cd3d0391b72835a091294dd7fe260c3b5aa1c96266b31edc9dd861cedd5d6066f57520dfb5c19e05a7b727
6
+ metadata.gz: 2324d55ee702dc88b23a643e15c2accfeb26ec499dd86c5fd482b2db234608d74b854579640b72ae034da947c62f730bcfa9edd1d81f0e274bcc5ed990814223
7
+ data.tar.gz: e9507e6cc5eefc8e307965e067345e81f3bfad5c1af998689075f80fbb8facd4eca5c6af5c2225da3e3611f51ab45c80413c7bcf779ae8726d8a68a85b50d8b8
@@ -1,3 +1,8 @@
1
+ === Net::LDAP 0.12.1
2
+
3
+ * Whitespace formatting cleanup {#236}[https://github.com/ruby-ldap/ruby-net-ldap/pull/236]
4
+ * Set operation result if LDAP server is not accessible {#232}[https://github.com/ruby-ldap/ruby-net-ldap/pull/232]
5
+
1
6
  === Net::LDAP 0.12.0
2
7
 
3
8
  * DRY up connection handling logic {#224}[https://github.com/ruby-ldap/ruby-net-ldap/pull/224]
@@ -1243,5 +1243,11 @@ class Net::LDAP
1243
1243
  :hosts => @hosts,
1244
1244
  :encryption => @encryption,
1245
1245
  :instrumentation_service => @instrumentation_service
1246
+ rescue Errno::ECONNREFUSED, Net::LDAP::ConnectionRefusedError => e
1247
+ @result = {
1248
+ :resultCode => 52,
1249
+ :errorMessage => ResultStrings[ResultCodeUnavailable]
1250
+ }
1251
+ raise e
1246
1252
  end
1247
1253
  end # class LDAP
@@ -29,10 +29,11 @@ module Net
29
29
  t3_msg.serialize
30
30
  }
31
31
 
32
- Net::LDAP::AuthAdapter::Sasl.new(@connection).
33
- bind(:method => :sasl, :mechanism => "GSS-SPNEGO",
34
- :initial_credential => NTLM::Message::Type1.new.serialize,
35
- :challenge_response => nego)
32
+ Net::LDAP::AuthAdapter::Sasl.new(@connection).bind \
33
+ :method => :sasl,
34
+ :mechanism => "GSS-SPNEGO",
35
+ :initial_credential => NTLM::Message::Type1.new.serialize,
36
+ :challenge_response => nego
36
37
  end
37
38
  end
38
39
  end
@@ -21,6 +21,7 @@ class Net::LDAP
21
21
  end
22
22
 
23
23
  private
24
+
24
25
  def warn_deprecation_message
25
26
  warn "Deprecation warning: Net::LDAP::ConnectionRefused will be deprecated. Use Errno::ECONNREFUSED instead."
26
27
  end
@@ -1,5 +1,5 @@
1
1
  module Net
2
2
  class LDAP
3
- VERSION = "0.12.0"
3
+ VERSION = "0.12.1"
4
4
  end
5
5
  end
@@ -33,4 +33,5 @@ the most recent LDAP RFCs (4510-4519, plutions of 4520-4532).}
33
33
  s.add_development_dependency("rake", "~> 10.0")
34
34
  s.add_development_dependency("rubocop", "~> 0.28.0")
35
35
  s.add_development_dependency("test-unit")
36
+ s.add_development_dependency("byebug")
36
37
  end
@@ -47,6 +47,19 @@ class TestLDAPConnection < Test::Unit::TestCase
47
47
  end
48
48
  end
49
49
 
50
+ def test_result_for_connection_failed_is_set
51
+ flexmock(TCPSocket).should_receive(:new).and_raise(Errno::ECONNREFUSED)
52
+
53
+ ldap_client = Net::LDAP.new(host: '127.0.0.1', port: 12345)
54
+
55
+ assert_raise Net::LDAP::ConnectionRefusedError do
56
+ ldap_client.bind(method: :simple, username: 'asdf', password: 'asdf')
57
+ end
58
+
59
+ assert_equal(ldap_client.get_operation_result.code, 52)
60
+ assert_equal(ldap_client.get_operation_result.message, 'Unavailable')
61
+ end
62
+
50
63
  def test_unresponsive_host
51
64
  assert_raise Net::LDAP::Error do
52
65
  Net::LDAP::Connection.new(:host => 'test.mocked.com', :port => 636)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-ldap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francis Cianfrocca
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2015-10-27 00:00:00.000000000 Z
16
+ date: 2015-11-11 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: flexmock
@@ -71,6 +71,20 @@ dependencies:
71
71
  - - ">="
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
+ - !ruby/object:Gem::Dependency
75
+ name: byebug
76
+ requirement: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ type: :development
82
+ prerelease: false
83
+ version_requirements: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
74
88
  description: |-
75
89
  Net::LDAP for Ruby (also called net-ldap) implements client access for the
76
90
  Lightweight Directory Access Protocol (LDAP), an IETF standard protocol for