net-ldap 0.17.0 → 0.18.0

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
  SHA256:
3
- metadata.gz: 02707fcb56d13184b4bbcc16c1555a0d417efb7e20c216a97ee8f28c9553ea84
4
- data.tar.gz: 26a82f5021146fe6ec84d83e41722364964e155eb898102e3a8618facc020d9a
3
+ metadata.gz: c8d5def02bd0ce6b44457f5c1c7983f8730131a1a7082b3765791b14a0ee576b
4
+ data.tar.gz: 41a50fda89f8c8e7a6a1c182e894181d910367a356c67f031dec8072e1544e3e
5
5
  SHA512:
6
- metadata.gz: d19e1bc7cdcaceff6263f2bca2e9326ef441e301ab74556c42313e01704800abb59231f760abec64a8f2d1e313c18324b97c57a64d2b2ee24943be9e4bd2c428
7
- data.tar.gz: fa69d36265e7b11b7c83cf812caca680e30af3a0be31c145d70396835081fc06f6a2bf43262ec08f4d6fab1094823dc70de069441229a991f3c5b2eadeb7c4e5
6
+ metadata.gz: c5ae1310f3668a7f12f4817ede1cdd9310b8b262a40f41639d29e6cf0ba105f3bd6df8f6b892abed3924b03987c18f0e3f0c9bb2c848ed9d33a4662d53783f83
7
+ data.tar.gz: f2b4573b1af8db1dd16b9b31202a53edd08829d399fb94bd27cb400b8b1246929dca87744bd5156c4910a4fd53a4c4689a3917258d165e472135fbf50afceb7c
data/History.rdoc CHANGED
@@ -1,3 +1,20 @@
1
+ === Net::LDAP 0.18.0
2
+ * Fix escaping of # and space in attrs #408
3
+ * Add support to use SNI #406
4
+ * Drop Ruby 2.5 and JRuby 9.2 from CI tests
5
+ * Bump rubocop to 1.48.1
6
+ * Update CI for TruffleRuby 22
7
+
8
+ === Net::LDAP 0.17.1
9
+ * Fixed shebang of bash #385
10
+ * Omit some tests for now until we update our CA cert #386
11
+ * Add Ruby 3.0 support #388
12
+ * Add TruffleRuby 21.0.0 to CI #389
13
+ * Correct a typo in an error message #391
14
+ * Enable bundler caching for travis #390
15
+ * Fix circular require while loading lib/net/ldap/entry.rb and lib/net/ldap/dataset.rb #392
16
+ * Handle nil value in GetbyteForSSLSocket::getbyte #306
17
+
1
18
  === Net::LDAP 0.17.0
2
19
  * Added private recursive_delete as alternative to DELETE_TREE #268
3
20
  * Test suite updates #373 #376 #377
data/README.rdoc CHANGED
@@ -23,7 +23,7 @@ the most recent LDAP RFCs (4510–4519, plus portions of 4520–4532).
23
23
 
24
24
  == Synopsis
25
25
 
26
- See {Net::LDAP on rubydoc.info}[https://www.rubydoc.info/gems/net-ldap/Net/LDAP] for documentation and usage samples.
26
+ See {Net::LDAP on rubydoc.info}[https://www.rubydoc.info/github/ruby-ldap/ruby-net-ldap] for documentation and usage samples.
27
27
 
28
28
  == Requirements
29
29
 
@@ -33,9 +33,10 @@ class Net::LDAP::Connection #:nodoc:
33
33
  def prepare_socket(server, timeout=nil)
34
34
  socket = server[:socket]
35
35
  encryption = server[:encryption]
36
+ hostname = server[:host]
36
37
 
37
38
  @conn = socket
38
- setup_encryption(encryption, timeout) if encryption
39
+ setup_encryption(encryption, timeout, hostname) if encryption
39
40
  end
40
41
 
41
42
  def open_connection(server)
@@ -74,7 +75,8 @@ class Net::LDAP::Connection #:nodoc:
74
75
 
75
76
  module GetbyteForSSLSocket
76
77
  def getbyte
77
- getc.ord
78
+ c = getc
79
+ c && c.ord
78
80
  end
79
81
  end
80
82
 
@@ -85,7 +87,7 @@ class Net::LDAP::Connection #:nodoc:
85
87
  end
86
88
  end
87
89
 
88
- def self.wrap_with_ssl(io, tls_options = {}, timeout=nil)
90
+ def self.wrap_with_ssl(io, tls_options = {}, timeout=nil, hostname=nil)
89
91
  raise Net::LDAP::NoOpenSSLError, "OpenSSL is unavailable" unless Net::LDAP::HasOpenSSL
90
92
 
91
93
  ctx = OpenSSL::SSL::SSLContext.new
@@ -95,6 +97,7 @@ class Net::LDAP::Connection #:nodoc:
95
97
  ctx.set_params(tls_options) unless tls_options.empty?
96
98
 
97
99
  conn = OpenSSL::SSL::SSLSocket.new(io, ctx)
100
+ conn.hostname = hostname
98
101
 
99
102
  begin
100
103
  if timeout
@@ -147,11 +150,11 @@ class Net::LDAP::Connection #:nodoc:
147
150
  # communications, as with simple_tls. Thanks for Kouhei Sutou for
148
151
  # generously contributing the :start_tls path.
149
152
  #++
150
- def setup_encryption(args, timeout=nil)
153
+ def setup_encryption(args, timeout=nil, hostname=nil)
151
154
  args[:tls_options] ||= {}
152
155
  case args[:method]
153
156
  when :simple_tls
154
- @conn = self.class.wrap_with_ssl(@conn, args[:tls_options], timeout)
157
+ @conn = self.class.wrap_with_ssl(@conn, args[:tls_options], timeout, hostname)
155
158
  # additional branches requiring server validation and peer certs, etc.
156
159
  # go here.
157
160
  when :start_tls
@@ -169,7 +172,7 @@ class Net::LDAP::Connection #:nodoc:
169
172
 
170
173
  raise Net::LDAP::StartTLSError,
171
174
  "start_tls failed: #{pdu.result_code}" unless pdu.result_code.zero?
172
- @conn = self.class.wrap_with_ssl(@conn, args[:tls_options], timeout)
175
+ @conn = self.class.wrap_with_ssl(@conn, args[:tls_options], timeout, hostname)
173
176
  else
174
177
  raise Net::LDAP::EncMethodUnsupportedError, "unsupported encryption method #{args[:method]}"
175
178
  end
@@ -1,5 +1,3 @@
1
- require_relative 'entry'
2
-
3
1
  # -*- ruby encoding: utf-8 -*-
4
2
  ##
5
3
  # An LDAP Dataset. Used primarily as an intermediate format for converting
data/lib/net/ldap/dn.rb CHANGED
@@ -192,27 +192,19 @@ class Net::LDAP::DN
192
192
  # http://tools.ietf.org/html/rfc2253 section 2.4 lists these exceptions
193
193
  # for dn values. All of the following must be escaped in any normal string
194
194
  # using a single backslash ('\') as escape.
195
- ESCAPES = {
196
- ',' => ',',
197
- '+' => '+',
198
- '"' => '"',
199
- '\\' => '\\',
200
- '<' => '<',
201
- '>' => '>',
202
- ';' => ';',
203
- }
195
+ ESCAPES = %w[, + " \\ < > ;]
204
196
 
205
- # Compiled character class regexp using the keys from the above hash, and
197
+ # Compiled character class regexp using the values from the above list, and
206
198
  # checking for a space or # at the start, or space at the end, of the
207
199
  # string.
208
200
  ESCAPE_RE = Regexp.new("(^ |^#| $|[" +
209
- ESCAPES.keys.map { |e| Regexp.escape(e) }.join +
201
+ ESCAPES.map { |e| Regexp.escape(e) }.join +
210
202
  "])")
211
203
 
212
204
  ##
213
205
  # Escape a string for use in a DN value
214
206
  def self.escape(string)
215
- string.gsub(ESCAPE_RE) { |char| "\\" + ESCAPES[char] }
207
+ string.gsub(ESCAPE_RE) { |char| "\\" + char }
216
208
  end
217
209
 
218
210
  ##
@@ -1,5 +1,3 @@
1
- require_relative 'dataset'
2
-
3
1
  # -*- ruby encoding: utf-8 -*-
4
2
  ##
5
3
  # Objects of this class represent individual entries in an LDAP directory.
@@ -1,5 +1,5 @@
1
1
  module Net
2
2
  class LDAP
3
- VERSION = "0.17.0"
3
+ VERSION = "0.18.0"
4
4
  end
5
5
  end
data/lib/net/ldap.rb CHANGED
@@ -412,7 +412,7 @@ class Net::LDAP
412
412
  ResultCodeStrongerAuthRequired => "Stronger Auth Needed",
413
413
  ResultCodeReferral => "Referral",
414
414
  ResultCodeAdminLimitExceeded => "Admin Limit Exceeded",
415
- ResultCodeUnavailableCriticalExtension => "Unavailable crtical extension",
415
+ ResultCodeUnavailableCriticalExtension => "Unavailable critical extension",
416
416
  ResultCodeConfidentialityRequired => "Confidentiality Required",
417
417
  ResultCodeSaslBindInProgress => "saslBindInProgress",
418
418
  ResultCodeNoSuchAttribute => "No Such Attribute",
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.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francis Cianfrocca
@@ -10,10 +10,10 @@ authors:
10
10
  - Kaspar Schiess
11
11
  - Austin Ziegler
12
12
  - Michael Schaarschmidt
13
- autorequire:
13
+ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2020-11-30 00:00:00.000000000 Z
16
+ date: 2023-04-04 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: flexmock
@@ -49,14 +49,14 @@ dependencies:
49
49
  requirements:
50
50
  - - "~>"
51
51
  - !ruby/object:Gem::Version
52
- version: 0.49.0
52
+ version: '1.48'
53
53
  type: :development
54
54
  prerelease: false
55
55
  version_requirements: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: 0.49.0
59
+ version: '1.48'
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: test-unit
62
62
  requirement: !ruby/object:Gem::Requirement
@@ -146,7 +146,7 @@ homepage: http://github.com/ruby-ldap/ruby-net-ldap
146
146
  licenses:
147
147
  - MIT
148
148
  metadata: {}
149
- post_install_message:
149
+ post_install_message:
150
150
  rdoc_options:
151
151
  - "--main"
152
152
  - README.rdoc
@@ -163,8 +163,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  - !ruby/object:Gem::Version
164
164
  version: '0'
165
165
  requirements: []
166
- rubygems_version: 3.1.4
167
- signing_key:
166
+ rubygems_version: 3.4.7
167
+ signing_key:
168
168
  specification_version: 4
169
169
  summary: Net::LDAP for Ruby (also called net-ldap) implements client access for the
170
170
  Lightweight Directory Access Protocol (LDAP), an IETF standard protocol for accessing