acs-ldap 0.2.0 → 0.2.1
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/lib/acs/ldap/mapper.rb +1 -1
- data/lib/acs/ldap/pusher.rb +12 -5
- data/lib/acs/ldap/version.rb +1 -1
- data/log/acs_ldap.log +372 -359
- data/spec/acs/ldap/pusher_spec.rb +9 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ac45707d304faeaa2a67eaacf945d13aeeff317
|
4
|
+
data.tar.gz: 72615c12fb0b23404500819541eac7d9d3f21ccd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d829a90c37601abab9f1c7d26ad53baadca96b89cc60bd53437add329af2a699dbcd901d5ddbb1f6487725b45f58a87eeacab3c500313086ae0d991ac0905933
|
7
|
+
data.tar.gz: 6117567fb46a06c73a049ad390f2fe8e79841716d20b3228fe5d525ba8b3111ee38f5a2c73317fab970210d2ef80024afef46511b28d54f0d0b3b77d6e042d0c
|
data/lib/acs/ldap/mapper.rb
CHANGED
@@ -15,7 +15,7 @@ class Acs::Ldap::Mapper
|
|
15
15
|
@ou = ou
|
16
16
|
@method_separator = options[:method_separator] || '.'
|
17
17
|
@force_method_calls = options[:force_method_calls] || false
|
18
|
-
Acs::Ldap::logger.
|
18
|
+
Acs::Ldap::logger.debug "Acs::Ldap::Mapper with options methods_separator '#{@method_separator}' force_method_calls '#{@force_method_calls}'"
|
19
19
|
end
|
20
20
|
|
21
21
|
# Populate a hash based on the provided mapping and object
|
data/lib/acs/ldap/pusher.rb
CHANGED
@@ -11,7 +11,7 @@ class Acs::Ldap::Pusher
|
|
11
11
|
@mapper = mapper
|
12
12
|
end
|
13
13
|
|
14
|
-
def save(model)
|
14
|
+
def save(model, options = {})
|
15
15
|
if exist?(model)
|
16
16
|
update(model)
|
17
17
|
else
|
@@ -19,7 +19,7 @@ class Acs::Ldap::Pusher
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
def create(model)
|
22
|
+
def create(model, options = {})
|
23
23
|
attributes = @mapper.attributes(model).except!(:uid)
|
24
24
|
attributes.merge!(objectClass: @mapper.object_class)
|
25
25
|
|
@@ -31,11 +31,18 @@ class Acs::Ldap::Pusher
|
|
31
31
|
)
|
32
32
|
end
|
33
33
|
|
34
|
-
def update(model,
|
34
|
+
def update(model, options = {})
|
35
|
+
changes = options.fetch(:changes, nil)
|
35
36
|
attributes = @mapper.attributes(model).except(:uid)
|
36
37
|
operations = []
|
37
38
|
attributes.each do |key, value|
|
38
|
-
|
39
|
+
if attributes.nil? or attributes.include?(key)
|
40
|
+
if changes.nil?
|
41
|
+
operations << [:replace, key.to_s, value]
|
42
|
+
else
|
43
|
+
operations << [:replace, key.to_s, value] if changes.has_key?(key)
|
44
|
+
end
|
45
|
+
end
|
39
46
|
end
|
40
47
|
|
41
48
|
@connector.update(
|
@@ -44,7 +51,7 @@ class Acs::Ldap::Pusher
|
|
44
51
|
)
|
45
52
|
end
|
46
53
|
|
47
|
-
def destroy(model)
|
54
|
+
def destroy(model, options = {})
|
48
55
|
@connector.delete(dn(model))
|
49
56
|
end
|
50
57
|
|
data/lib/acs/ldap/version.rb
CHANGED