github-ldap 1.1.0 → 1.1.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/github-ldap.gemspec +1 -1
- data/lib/github/ldap.rb +6 -2
- data/test/group_test.rb +8 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28c2327d79def9d64d8f90b46e6a12b7055ed6ac
|
4
|
+
data.tar.gz: 3e1a9c422a6d1729c526d21657c51ee15b7662c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b347d766538664ea6d4a5b93cc4f4ef7eea792f601ae03e4aa8a4f824e0e3d9aa7867257cad27e7daee6a686e1e144b23b5531cb6f38a4b1394f4d3688f8c981
|
7
|
+
data.tar.gz: 424fa3a3f07d1871c464d9aae38cd48dc2dec3b0a6200060923ee20d13ba59e70c815fca37047d18577d40a034b2a3d4c068b9b39d71d5d13ebb96849d156460
|
data/github-ldap.gemspec
CHANGED
data/lib/github/ldap.rb
CHANGED
@@ -87,11 +87,15 @@ module GitHub
|
|
87
87
|
# base_name: is the dn of the base root.
|
88
88
|
#
|
89
89
|
# Returns a new Group object.
|
90
|
+
# Returns nil if the dn is not in the server.
|
90
91
|
def group(base_name)
|
92
|
+
entry = domain(base_name).bind
|
93
|
+
return unless entry
|
94
|
+
|
91
95
|
if @virtual_attributes.enabled?
|
92
|
-
VirtualGroup.new(self,
|
96
|
+
VirtualGroup.new(self, entry)
|
93
97
|
else
|
94
|
-
Group.new(self,
|
98
|
+
Group.new(self, entry)
|
95
99
|
end
|
96
100
|
end
|
97
101
|
|
data/test/group_test.rb
CHANGED
@@ -6,11 +6,12 @@ class GitHubLdapGroupTest < GitHub::Ldap::Test
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def groups_domain
|
9
|
-
|
9
|
+
@ldap.domain("ou=groups,dc=github,dc=com")
|
10
10
|
end
|
11
11
|
|
12
12
|
def setup
|
13
|
-
@
|
13
|
+
@ldap = GitHub::Ldap.new(options)
|
14
|
+
@group = @ldap.group("cn=enterprise,ou=groups,dc=github,dc=com")
|
14
15
|
end
|
15
16
|
|
16
17
|
def test_subgroups
|
@@ -30,6 +31,11 @@ class GitHubLdapGroupTest < GitHub::Ldap::Test
|
|
30
31
|
groups = groups_domain.filter_groups('devs')
|
31
32
|
assert_equal 1, groups.size
|
32
33
|
end
|
34
|
+
|
35
|
+
def test_unknown_group
|
36
|
+
refute @ldap.group("cn=foobar,ou=groups,dc=github,dc=com"),
|
37
|
+
"Expected to not bind any group"
|
38
|
+
end
|
33
39
|
end
|
34
40
|
|
35
41
|
class GitHubLdapLoopedGroupTest < GitHub::Ldap::Test
|