ldap_fluff 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ldap_fluff might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/ldap_fluff/ad_member_service.rb +2 -2
- data/test/ad_member_services_test.rb +7 -7
- 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: 5648d1eb100608b85c3815cc5ae5a215cd1ce5b0
|
4
|
+
data.tar.gz: afb387b8210f7120263b218bb2e3def00a7deb80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11596e7ac3c290ab3270432bfc0f13fbed11d39a8ebd4daa9f5f699656405b1f5f27c9637afc8a4b08c4829a72e2cbea2084b50d38ff271c48bfa5d1354784cc
|
7
|
+
data.tar.gz: 58d72eb169b5df0a0d4f00cb29b44c56e82b7436b5b85e530daf4e17698768e1a3fd211f3e2c07ee0b1d7de344ef3477371196cbe1209aa5de1fae974559728a
|
@@ -30,11 +30,11 @@ class LdapFluff::ActiveDirectory::MemberService < LdapFluff::GenericMemberServic
|
|
30
30
|
def _walk_group_ancestry(group_dns = [])
|
31
31
|
set = []
|
32
32
|
group_dns.each do |group_dn|
|
33
|
-
search = @ldap.search(:base => group_dn, :scope => Net::LDAP::SearchScope_BaseObject)
|
33
|
+
search = @ldap.search(:base => group_dn, :scope => Net::LDAP::SearchScope_BaseObject, :attributes => ['memberof'])
|
34
34
|
if !search.nil? && !search.first.nil?
|
35
35
|
group = search.first
|
36
|
+
set += _walk_group_ancestry(group[:memberof])
|
36
37
|
set += group[:memberof]
|
37
|
-
set += _walk_group_ancestry(set)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
set
|
@@ -11,7 +11,7 @@ class TestADMemberService < MiniTest::Test
|
|
11
11
|
|
12
12
|
def basic_user
|
13
13
|
@ldap.expect(:search, ad_user_payload, [:filter => ad_name_filter("john")])
|
14
|
-
@ldap.expect(:search, ad_parent_payload(1), [:base => ad_group_dn, :scope => 0])
|
14
|
+
@ldap.expect(:search, ad_parent_payload(1), [:base => ad_group_dn, :scope => 0, :attributes => ['memberof']])
|
15
15
|
end
|
16
16
|
|
17
17
|
def basic_group
|
@@ -21,27 +21,27 @@ class TestADMemberService < MiniTest::Test
|
|
21
21
|
def nest_deep(n)
|
22
22
|
# add all the expects
|
23
23
|
1.upto(n-1) do |i|
|
24
|
-
@ldap.expect(:search, ad_parent_payload(i + 1), [:base => ad_group_dn("bros#{i}"), :scope => 0])
|
24
|
+
@ldap.expect(:search, ad_parent_payload(i + 1), [:base => ad_group_dn("bros#{i}"), :scope => 0, :attributes => ['memberof']])
|
25
25
|
end
|
26
26
|
# terminate or we loop FOREVER
|
27
|
-
@ldap.expect(:search, [], [:base => ad_group_dn("bros#{n}"), :scope => 0])
|
27
|
+
@ldap.expect(:search, [], [:base => ad_group_dn("bros#{n}"), :scope => 0, :attributes => ['memberof']])
|
28
28
|
end
|
29
29
|
|
30
30
|
def double_nested(n)
|
31
31
|
# add all the expects
|
32
32
|
1.upto(n - 1) do |i|
|
33
|
-
@ldap.expect(:search, ad_double_payload(i + 1), [:base => ad_group_dn("bros#{i}"), :scope => 0])
|
33
|
+
@ldap.expect(:search, ad_double_payload(i + 1), [:base => ad_group_dn("bros#{i}"), :scope => 0, :attributes => ['memberof']])
|
34
34
|
end
|
35
35
|
# terminate or we loop FOREVER
|
36
|
-
@ldap.expect(:search, [], [:base => ad_group_dn("bros#{n}"), :scope => 0])
|
36
|
+
@ldap.expect(:search, [], [:base => ad_group_dn("bros#{n}"), :scope => 0, :attributes => ['memberof']])
|
37
37
|
(n - 1).downto(1) do |j|
|
38
|
-
@ldap.expect(:search, [], [:base => ad_group_dn("broskies#{j + 1}"), :scope => 0])
|
38
|
+
@ldap.expect(:search, [], [:base => ad_group_dn("broskies#{j + 1}"), :scope => 0, :attributes => ['memberof']])
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_find_user
|
43
43
|
basic_user
|
44
|
-
@ldap.expect(:search, [], [:base => ad_group_dn('bros1'), :scope => 0])
|
44
|
+
@ldap.expect(:search, [], [:base => ad_group_dn('bros1'), :scope => 0, :attributes => ['memberof']])
|
45
45
|
@adms.ldap = @ldap
|
46
46
|
assert_equal(%w(group bros1), @adms.find_user_groups("john"))
|
47
47
|
@ldap.verify
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ldap_fluff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordan O'Mara
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2015-
|
15
|
+
date: 2015-09-09 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: net-ldap
|