net-ldap 0.18.0 → 0.19.0
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/History.rdoc +6 -0
- data/lib/net/ldap/connection.rb +9 -4
- data/lib/net/ldap/dn.rb +5 -5
- data/lib/net/ldap/version.rb +1 -1
- data/lib/net/ldap.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fdcc1a3fefe3fb2bf1dbb91ec9e00734252fdda634ae0e2344b9dd6e6b86cd2
|
4
|
+
data.tar.gz: 8526bd506b632e74193c80119280fd4b333731b1e3d75791427a12e62cab775a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/net/ldap/connection.rb
CHANGED
@@ -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
|
-
|
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
|
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
|
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
|
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
|
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
|
175
|
+
yield key.string.strip, value.string
|
176
176
|
end
|
177
177
|
|
178
178
|
##
|
data/lib/net/ldap/version.rb
CHANGED
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.
|
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:
|
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.
|
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
|