github-ldap 1.1.1 → 1.1.2
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/group.rb +3 -2
- data/test/fixtures/github-with-missing-entries.ldif +94 -0
- data/test/group_test.rb +18 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 96b1f68d57cf80fa875ffc231b72822bba47c34d
|
|
4
|
+
data.tar.gz: 53c74070947453c23c1fb2163d88a1fa29df21ed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a20a3b6049bc7a8fe8415bed1aab25cdfcc1cd58778a71f62ab1ec966b9545715f38d14225b84d445b9b62e46e9f855adb144b9cf5e18196e19b3830c8770e64
|
|
7
|
+
data.tar.gz: 8c1dd5779c00b8b29b7331886ad575ae830ee1753bd9b538183d7bb489acc3b5320ebc8400987ba8d6ebe62243ae2f6465a3c20ce10aa81751cba1d7e44e4061
|
data/github-ldap.gemspec
CHANGED
data/lib/github/ldap/group.rb
CHANGED
|
@@ -63,8 +63,9 @@ module GitHub
|
|
|
63
63
|
#
|
|
64
64
|
# Returns an array of Net::LDAP::Entry.
|
|
65
65
|
def member_entries
|
|
66
|
-
@member_entries ||= member_names.
|
|
67
|
-
@ldap.domain(m).bind
|
|
66
|
+
@member_entries ||= member_names.each_with_object([]) do |m, a|
|
|
67
|
+
entry = @ldap.domain(m).bind
|
|
68
|
+
a << entry if entry
|
|
68
69
|
end
|
|
69
70
|
end
|
|
70
71
|
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
version: 1
|
|
2
|
+
|
|
3
|
+
# Organizations
|
|
4
|
+
|
|
5
|
+
dn: dc=github,dc=com
|
|
6
|
+
cn: github
|
|
7
|
+
objectClass: dcObject
|
|
8
|
+
objectClass: organization
|
|
9
|
+
dc: github
|
|
10
|
+
o: GitHub Inc.
|
|
11
|
+
|
|
12
|
+
# Admin user
|
|
13
|
+
|
|
14
|
+
dn: uid=admin,dc=github,dc=com
|
|
15
|
+
objectClass: top
|
|
16
|
+
objectClass: person
|
|
17
|
+
objectClass: organizationalPerson
|
|
18
|
+
objectClass: inetOrgPerson
|
|
19
|
+
cn: system administrator
|
|
20
|
+
sn: administrator
|
|
21
|
+
displayName: Directory Superuser
|
|
22
|
+
uid: admin
|
|
23
|
+
userPassword: secret
|
|
24
|
+
|
|
25
|
+
# Groups
|
|
26
|
+
|
|
27
|
+
dn: ou=groups,dc=github,dc=com
|
|
28
|
+
objectclass: organizationalUnit
|
|
29
|
+
|
|
30
|
+
dn: cn=enterprise,ou=groups,dc=github,dc=com
|
|
31
|
+
cn: Enterprise
|
|
32
|
+
objectClass: groupOfNames
|
|
33
|
+
member: uid=calavera,ou=users,dc=github,dc=com
|
|
34
|
+
member: cn=enterprise-devs,ou=groups,dc=github,dc=com
|
|
35
|
+
member: cn=enterprise-ops,ou=groups,dc=github,dc=com
|
|
36
|
+
|
|
37
|
+
dn: cn=enterprise-devs,ou=groups,dc=github,dc=com
|
|
38
|
+
cn: enterprise-devs
|
|
39
|
+
objectClass: groupOfNames
|
|
40
|
+
member: uid=benburkert,ou=users,dc=github,dc=com
|
|
41
|
+
member: cn=enterprise,ou=groups,dc=github,dc=com
|
|
42
|
+
|
|
43
|
+
dn: cn=enterprise-ops,ou=groups,dc=github,dc=com
|
|
44
|
+
cn: enterprise-ops
|
|
45
|
+
objectClass: groupOfNames
|
|
46
|
+
member: uid=sbryant,ou=users,dc=github,dc=com
|
|
47
|
+
member: cn=spaniards,ou=groups,dc=github,dc=com
|
|
48
|
+
|
|
49
|
+
# The last member of this group is missing on purpose.
|
|
50
|
+
# See: https://github.com/github/github-ldap/pull/18
|
|
51
|
+
dn: cn=spaniards,ou=groups,dc=github,dc=com
|
|
52
|
+
cn: spaniards
|
|
53
|
+
objectClass: groupOfNames
|
|
54
|
+
member: uid=calavera,ou=users,dc=github,dc=com
|
|
55
|
+
member: uid=rubiojr,ou=users,dc=github,dc=com
|
|
56
|
+
member: uid=felipe,ou=users,dc=github,dc=com
|
|
57
|
+
|
|
58
|
+
# Users
|
|
59
|
+
|
|
60
|
+
dn: ou=users,dc=github,dc=com
|
|
61
|
+
objectclass: organizationalUnit
|
|
62
|
+
|
|
63
|
+
dn: uid=calavera,ou=users,dc=github,dc=com
|
|
64
|
+
cn: David Calavera
|
|
65
|
+
cn: David
|
|
66
|
+
sn: Calavera
|
|
67
|
+
uid: calavera
|
|
68
|
+
userPassword: passworD1
|
|
69
|
+
mail: calavera@github.com
|
|
70
|
+
objectClass: inetOrgPerson
|
|
71
|
+
|
|
72
|
+
dn: uid=benburkert,ou=users,dc=github,dc=com
|
|
73
|
+
cn: benburkert
|
|
74
|
+
sn: benburkert
|
|
75
|
+
uid: benburkert
|
|
76
|
+
userPassword: passworD1
|
|
77
|
+
mail: benburkert@github.com
|
|
78
|
+
objectClass: inetOrgPerson
|
|
79
|
+
|
|
80
|
+
dn: uid=sbryant,ou=users,dc=github,dc=com
|
|
81
|
+
cn: sbryant
|
|
82
|
+
sn: sbryant
|
|
83
|
+
uid: sbryant
|
|
84
|
+
userPassword: passworD1
|
|
85
|
+
mail: sbryant@github.com
|
|
86
|
+
objectClass: inetOrgPerson
|
|
87
|
+
|
|
88
|
+
dn: uid=rubiojr,ou=users,dc=github,dc=com
|
|
89
|
+
cn: rubiojr
|
|
90
|
+
sn: rubiojr
|
|
91
|
+
uid: rubiojr
|
|
92
|
+
userPassword: passworD1
|
|
93
|
+
mail: rubiojr@github.com
|
|
94
|
+
objectClass: inetOrgPerson
|
data/test/group_test.rb
CHANGED
|
@@ -51,3 +51,21 @@ class GitHubLdapLoopedGroupTest < GitHub::Ldap::Test
|
|
|
51
51
|
assert_equal 4, @group.members.size
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
|
+
|
|
55
|
+
class GitHubLdapMissingEntriesTest < GitHub::Ldap::Test
|
|
56
|
+
def self.test_server_options
|
|
57
|
+
{user_fixtures: FIXTURES.join('github-with-missing-entries.ldif').to_s}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def setup
|
|
61
|
+
@ldap = GitHub::Ldap.new(options)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def test_load_right_members
|
|
65
|
+
assert_equal 3, @ldap.domain("cn=spaniards,ou=groups,dc=github,dc=com").bind[:member].size
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def test_ignore_missing_member_entries
|
|
69
|
+
assert_equal 2, @ldap.group("cn=spaniards,ou=groups,dc=github,dc=com").members.size
|
|
70
|
+
end
|
|
71
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: github-ldap
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Calavera
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-02-
|
|
11
|
+
date: 2014-02-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: net-ldap
|
|
@@ -105,6 +105,7 @@ files:
|
|
|
105
105
|
- test/domain_test.rb
|
|
106
106
|
- test/filter_test.rb
|
|
107
107
|
- test/fixtures/github-with-looped-subgroups.ldif
|
|
108
|
+
- test/fixtures/github-with-missing-entries.ldif
|
|
108
109
|
- test/fixtures/github-with-subgroups.ldif
|
|
109
110
|
- test/group_test.rb
|
|
110
111
|
- test/ldap_test.rb
|
|
@@ -137,6 +138,7 @@ test_files:
|
|
|
137
138
|
- test/domain_test.rb
|
|
138
139
|
- test/filter_test.rb
|
|
139
140
|
- test/fixtures/github-with-looped-subgroups.ldif
|
|
141
|
+
- test/fixtures/github-with-missing-entries.ldif
|
|
140
142
|
- test/fixtures/github-with-subgroups.ldif
|
|
141
143
|
- test/group_test.rb
|
|
142
144
|
- test/ldap_test.rb
|