activeldap 5.1.1 → 5.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/doc/text/news.textile +16 -0
- data/lib/active_ldap/adapter/net_ldap.rb +13 -5
- data/lib/active_ldap/attribute_methods.rb +1 -2
- data/lib/active_ldap/attribute_methods/before_type_cast.rb +1 -1
- data/lib/active_ldap/attribute_methods/dirty.rb +4 -7
- data/lib/active_ldap/attribute_methods/query.rb +1 -1
- data/lib/active_ldap/attribute_methods/read.rb +5 -1
- data/lib/active_ldap/attribute_methods/write.rb +1 -1
- data/lib/active_ldap/base.rb +2 -6
- data/lib/active_ldap/populate.rb +5 -3
- data/lib/active_ldap/railties/controller_runtime.rb +1 -2
- data/lib/active_ldap/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8ff0abb4ff702e766243e5ff416b5b526b4ae0f2e0269e4058f00956b27b7de8
|
4
|
+
data.tar.gz: 87e13372b42e5b6c8b58012597f5631ebd92d50b213382f5d6f32a90479b4f60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5b69fb0534269a9fdc2b0eda2882d35a4c74cfde74b3d82af50880e83c49a350f770d18538e6b9fca119aa4ca4c59c9482ca9c447620cdbdfe5327f113a268d
|
7
|
+
data.tar.gz: 10c8ebcb314692ed2e2abafe1a9edd39572c617f8ffe540fcc6ca760aff3c8b7ebd6dbf3f1f2af7d0c76097a340fb2c393516629e229e212af82842d5386d3f5
|
data/doc/text/news.textile
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
h1. News
|
2
2
|
|
3
|
+
h2(#release-5-2-0). 5.2.0: 2018-05-09
|
4
|
+
|
5
|
+
h3. Improvements
|
6
|
+
|
7
|
+
* Added @:dc_base_class@ and @:ou_base_class@ options to
|
8
|
+
@ActiveLdap::Populate.ensure_base@.
|
9
|
+
[GitHub#153][Patch by hide_24]
|
10
|
+
|
11
|
+
* Added Active Model 5.2.0 support.
|
12
|
+
|
13
|
+
* Improved connection error handling for net-ldap.
|
14
|
+
|
15
|
+
h3. Thanks
|
16
|
+
|
17
|
+
* hide_24
|
18
|
+
|
3
19
|
h2(#release-5-1-1). 5.1.1: 2018-01-17
|
4
20
|
|
5
21
|
h3. Improvements
|
@@ -33,8 +33,11 @@ module ActiveLdap
|
|
33
33
|
info = {:uri => uri, :with_start_tls => with_start_tls}
|
34
34
|
[log("connect", info) {Net::LDAP::Connection.new(config)},
|
35
35
|
uri, with_start_tls]
|
36
|
-
rescue Net::LDAP::
|
37
|
-
raise ConnectionError,
|
36
|
+
rescue Net::LDAP::ConnectionError => error
|
37
|
+
raise ConnectionError, error.message
|
38
|
+
rescue Net::LDAP::Error => error
|
39
|
+
message = "#{error.class}: #{error.message}"
|
40
|
+
raise ConnectionError, message, caller(0) + error.backtrace
|
38
41
|
end
|
39
42
|
end
|
40
43
|
end
|
@@ -50,7 +53,7 @@ module ActiveLdap
|
|
50
53
|
def bind(options={})
|
51
54
|
begin
|
52
55
|
super
|
53
|
-
rescue Net::LDAP::
|
56
|
+
rescue Net::LDAP::Error
|
54
57
|
raise AuthenticationError, $!.message
|
55
58
|
end
|
56
59
|
end
|
@@ -148,8 +151,13 @@ module ActiveLdap
|
|
148
151
|
result = log(name, info) do
|
149
152
|
begin
|
150
153
|
@connection.send(method, *args, &block)
|
151
|
-
rescue
|
152
|
-
|
154
|
+
rescue SystemCallError => error
|
155
|
+
message = "#{error.class}: #{error.message}"
|
156
|
+
raise ConnectionError, message, caller(0) + error.backtrace
|
157
|
+
rescue Net::LDAP::ResponseMissingOrInvalidError => error
|
158
|
+
message = "#{error.class}: #{error.message}"
|
159
|
+
message << ": connection may be timed out"
|
160
|
+
raise ConnectionError, message, caller(0) + error.backtrace
|
153
161
|
end
|
154
162
|
end
|
155
163
|
message = nil
|
@@ -9,8 +9,7 @@ module ActiveLdap
|
|
9
9
|
def save(*) #:nodoc:
|
10
10
|
succeeded = super
|
11
11
|
if succeeded
|
12
|
-
|
13
|
-
@changed_attributes.clear
|
12
|
+
changes_applied
|
14
13
|
end
|
15
14
|
succeeded
|
16
15
|
end
|
@@ -18,20 +17,18 @@ module ActiveLdap
|
|
18
17
|
# Attempts to <tt>save!</tt> the record and clears changed attributes if successful.
|
19
18
|
def save!(*) #:nodoc:
|
20
19
|
super.tap do
|
21
|
-
|
22
|
-
@changed_attributes.clear
|
20
|
+
changes_applied
|
23
21
|
end
|
24
22
|
end
|
25
23
|
|
26
24
|
# <tt>reload</tt> the record and clears changed attributes.
|
27
25
|
def reload(*) #:nodoc:
|
28
26
|
super.tap do
|
29
|
-
|
30
|
-
@changed_attributes.clear
|
27
|
+
clear_changes_information
|
31
28
|
end
|
32
29
|
end
|
33
30
|
|
34
|
-
|
31
|
+
private
|
35
32
|
def set_attribute(name, value)
|
36
33
|
if name and name != "objectClass"
|
37
34
|
attribute_will_change!(name) unless value == get_attribute(name)
|
@@ -3,11 +3,15 @@ module ActiveLdap
|
|
3
3
|
module Read
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
|
-
|
6
|
+
private
|
7
7
|
def attribute(attr, *args)
|
8
8
|
return get_attribute(attr, args.first)
|
9
9
|
end
|
10
10
|
|
11
|
+
def _read_attribute(name)
|
12
|
+
get_attribute(name)
|
13
|
+
end
|
14
|
+
|
11
15
|
# get_attribute
|
12
16
|
#
|
13
17
|
# Return the value of the attribute called by method_missing?
|
data/lib/active_ldap/base.rb
CHANGED
@@ -946,9 +946,7 @@ module ActiveLdap
|
|
946
946
|
def clear_object_class_based_cache
|
947
947
|
@entry_attribute = nil
|
948
948
|
@real_names = {}
|
949
|
-
|
950
|
-
not attribute_method?(key)
|
951
|
-
end
|
949
|
+
clear_changes_information
|
952
950
|
end
|
953
951
|
|
954
952
|
def clear_removed_attributes_data(removed_attributes)
|
@@ -1117,7 +1115,7 @@ module ActiveLdap
|
|
1117
1115
|
end
|
1118
1116
|
set_attribute(key, value)
|
1119
1117
|
end
|
1120
|
-
|
1118
|
+
clear_changes_information
|
1121
1119
|
end
|
1122
1120
|
private :initialize_attributes
|
1123
1121
|
|
@@ -1167,8 +1165,6 @@ module ActiveLdap
|
|
1167
1165
|
@dn_split_value = nil
|
1168
1166
|
@connection ||= nil
|
1169
1167
|
@_hashing = false
|
1170
|
-
@previously_changed = []
|
1171
|
-
@changed_attributes = {}
|
1172
1168
|
clear_connection_based_cache
|
1173
1169
|
end
|
1174
1170
|
|
data/lib/active_ldap/populate.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
module ActiveLdap
|
2
2
|
module Populate
|
3
3
|
module_function
|
4
|
-
def ensure_base(base_class=nil)
|
4
|
+
def ensure_base(base_class=nil, options={})
|
5
5
|
base_class ||= Base
|
6
6
|
return unless base_class.search(:scope => :base).empty?
|
7
|
+
dc_base_class = options[:dc_base_class] || base_class
|
8
|
+
ou_base_class = options[:ou_base_class] || base_class
|
7
9
|
|
8
10
|
base_dn = DN.parse(base_class.base)
|
9
11
|
suffixes = []
|
@@ -15,11 +17,11 @@ module ActiveLdap
|
|
15
17
|
begin
|
16
18
|
case name.downcase
|
17
19
|
when "dc"
|
18
|
-
ensure_dc(value, prefix,
|
20
|
+
ensure_dc(value, prefix, dc_base_class)
|
19
21
|
when "ou"
|
20
22
|
ensure_ou(value,
|
21
23
|
:base => prefix,
|
22
|
-
:base_class =>
|
24
|
+
:base_class => ou_base_class)
|
23
25
|
end
|
24
26
|
rescue ActiveLdap::OperationNotPermitted
|
25
27
|
end
|
data/lib/active_ldap/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeldap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Will Drewry
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-05-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -359,7 +359,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
359
359
|
version: '0'
|
360
360
|
requirements: []
|
361
361
|
rubyforge_project: ruby-activeldap
|
362
|
-
rubygems_version: 2.
|
362
|
+
rubygems_version: 2.7.6
|
363
363
|
signing_key:
|
364
364
|
specification_version: 4
|
365
365
|
summary: ActiveLdap is a object-oriented API to LDAP
|