net-ldap 0.18.0 → 0.19.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: c8d5def02bd0ce6b44457f5c1c7983f8730131a1a7082b3765791b14a0ee576b
4
- data.tar.gz: 41a50fda89f8c8e7a6a1c182e894181d910367a356c67f031dec8072e1544e3e
3
+ metadata.gz: 1fdcc1a3fefe3fb2bf1dbb91ec9e00734252fdda634ae0e2344b9dd6e6b86cd2
4
+ data.tar.gz: 8526bd506b632e74193c80119280fd4b333731b1e3d75791427a12e62cab775a
5
5
  SHA512:
6
- metadata.gz: c5ae1310f3668a7f12f4817ede1cdd9310b8b262a40f41639d29e6cf0ba105f3bd6df8f6b892abed3924b03987c18f0e3f0c9bb2c848ed9d33a4662d53783f83
7
- data.tar.gz: f2b4573b1af8db1dd16b9b31202a53edd08829d399fb94bd27cb400b8b1246929dca87744bd5156c4910a4fd53a4c4689a3917258d165e472135fbf50afceb7c
6
+ metadata.gz: e2f9e53240eeedd964463c6bc719cc86e57e5a66c5a769371e16d97005f9b63933797f33384e0192b6e128cc4fec1de46e3cca2886fce963439d86b4b3c0665f
7
+ data.tar.gz: e4af635dce612600ba48a110ebae1d3c30c00f9c5adcfeba1b6eca1d4d760646674d399cac256f96490bcad6d884146cb891ac14d57f8734556ed7e331baac90
data/History.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ === Net::LDAP 0.19.0
2
+ * Net::LDAP::DN - Retain trailing spaces in RDN values in DNs #412
3
+ * Add in ability for users to specify LDAP controls when conducting searches #411
4
+ * Document connect_timeout in Constructor Details #415
5
+ * Fix openssl error when using multiple hosts #417
6
+
1
7
  === Net::LDAP 0.18.0
2
8
  * Fix escaping of # and space in attrs #408
3
9
  * Add support to use SNI #406
@@ -30,10 +30,9 @@ class Net::LDAP::Connection #:nodoc:
30
30
  @socket_class = socket_class
31
31
  end
32
32
 
33
- def prepare_socket(server, timeout=nil)
33
+ def prepare_socket(server, timeout=nil, hostname='127.0.0.1')
34
34
  socket = server[:socket]
35
35
  encryption = server[:encryption]
36
- hostname = server[:host]
37
36
 
38
37
  @conn = socket
39
38
  setup_encryption(encryption, timeout, hostname) if encryption
@@ -51,7 +50,7 @@ class Net::LDAP::Connection #:nodoc:
51
50
  errors = []
52
51
  hosts.each do |host, port|
53
52
  begin
54
- prepare_socket(server.merge(socket: @socket_class.new(host, port, socket_opts)), timeout)
53
+ prepare_socket(server.merge(socket: @socket_class.new(host, port, socket_opts)), timeout, host)
55
54
  if encryption
56
55
  if encryption[:tls_options] &&
57
56
  encryption[:tls_options][:verify_mode] &&
@@ -425,6 +424,7 @@ class Net::LDAP::Connection #:nodoc:
425
424
  # this breaks when calling to_ber. (Can't force binary data to UTF-8)
426
425
  # we have to disable paging (even though server supports it) to get around this...
427
426
 
427
+ user_controls = args.fetch(:controls, [])
428
428
  controls = []
429
429
  controls <<
430
430
  [
@@ -434,7 +434,12 @@ class Net::LDAP::Connection #:nodoc:
434
434
  rfc2696_cookie.map(&:to_ber).to_ber_sequence.to_s.to_ber,
435
435
  ].to_ber_sequence if paged
436
436
  controls << ber_sort if ber_sort
437
- controls = controls.empty? ? nil : controls.to_ber_contextspecific(0)
437
+ if controls.empty? && user_controls.empty?
438
+ controls = nil
439
+ else
440
+ controls += user_controls
441
+ controls = controls.to_ber_contextspecific(0)
442
+ end
438
443
 
439
444
  write(request, controls, message_id)
440
445
 
data/lib/net/ldap/dn.rb CHANGED
@@ -81,7 +81,7 @@ class Net::LDAP::DN
81
81
  value << char
82
82
  when ',' then
83
83
  state = :key
84
- yield key.string.strip, value.string.rstrip
84
+ yield key.string.strip, value.string
85
85
  key = StringIO.new
86
86
  value = StringIO.new;
87
87
  else
@@ -93,7 +93,7 @@ class Net::LDAP::DN
93
93
  when '\\' then state = :value_normal_escape
94
94
  when ',' then
95
95
  state = :key
96
- yield key.string.strip, value.string.rstrip
96
+ yield key.string.strip, value.string
97
97
  key = StringIO.new
98
98
  value = StringIO.new;
99
99
  else value << char
@@ -142,7 +142,7 @@ class Net::LDAP::DN
142
142
  when ' ' then state = :value_end
143
143
  when ',' then
144
144
  state = :key
145
- yield key.string.strip, value.string.rstrip
145
+ yield key.string.strip, value.string
146
146
  key = StringIO.new
147
147
  value = StringIO.new;
148
148
  else raise Net::LDAP::InvalidDNError, "DN badly formed"
@@ -159,7 +159,7 @@ class Net::LDAP::DN
159
159
  when ' ' then state = :value_end
160
160
  when ',' then
161
161
  state = :key
162
- yield key.string.strip, value.string.rstrip
162
+ yield key.string.strip, value.string
163
163
  key = StringIO.new
164
164
  value = StringIO.new;
165
165
  else raise Net::LDAP::InvalidDNError, "DN badly formed"
@@ -172,7 +172,7 @@ class Net::LDAP::DN
172
172
  raise Net::LDAP::InvalidDNError, "DN badly formed" unless
173
173
  [:value, :value_normal, :value_hexstring, :value_end].include? state
174
174
 
175
- yield key.string.strip, value.string.rstrip
175
+ yield key.string.strip, value.string
176
176
  end
177
177
 
178
178
  ##
@@ -1,5 +1,5 @@
1
1
  module Net
2
2
  class LDAP
3
- VERSION = "0.18.0"
3
+ VERSION = "0.19.0"
4
4
  end
5
5
  end
data/lib/net/ldap.rb CHANGED
@@ -480,6 +480,8 @@ class Net::LDAP
480
480
  # server says it supports them. This is a fix for MS Active Directory
481
481
  # * :instrumentation_service => An object responsible for instrumenting
482
482
  # operations, compatible with ActiveSupport::Notifications' public API.
483
+ # * :connect_timeout => The TCP socket timeout (in seconds) to use when
484
+ # connecting to the LDAP server (default 5 seconds).
483
485
  # * :encryption => specifies the encryption to be used in communicating
484
486
  # with the LDAP server. The value must be a Hash containing additional
485
487
  # parameters, which consists of two keys:
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.18.0
4
+ version: 0.19.0
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: 2023-04-04 00:00:00.000000000 Z
16
+ date: 2024-01-03 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: flexmock
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  - !ruby/object:Gem::Version
164
164
  version: '0'
165
165
  requirements: []
166
- rubygems_version: 3.4.7
166
+ rubygems_version: 3.4.14
167
167
  signing_key:
168
168
  specification_version: 4
169
169
  summary: Net::LDAP for Ruby (also called net-ldap) implements client access for the