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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28c2327d79def9d64d8f90b46e6a12b7055ed6ac
4
- data.tar.gz: 3e1a9c422a6d1729c526d21657c51ee15b7662c3
3
+ metadata.gz: 96b1f68d57cf80fa875ffc231b72822bba47c34d
4
+ data.tar.gz: 53c74070947453c23c1fb2163d88a1fa29df21ed
5
5
  SHA512:
6
- metadata.gz: b347d766538664ea6d4a5b93cc4f4ef7eea792f601ae03e4aa8a4f824e0e3d9aa7867257cad27e7daee6a686e1e144b23b5531cb6f38a4b1394f4d3688f8c981
7
- data.tar.gz: 424fa3a3f07d1871c464d9aae38cd48dc2dec3b0a6200060923ee20d13ba59e70c815fca37047d18577d40a034b2a3d4c068b9b39d71d5d13ebb96849d156460
6
+ metadata.gz: a20a3b6049bc7a8fe8415bed1aab25cdfcc1cd58778a71f62ab1ec966b9545715f38d14225b84d445b9b62e46e9f855adb144b9cf5e18196e19b3830c8770e64
7
+ data.tar.gz: 8c1dd5779c00b8b29b7331886ad575ae830ee1753bd9b538183d7bb489acc3b5320ebc8400987ba8d6ebe62243ae2f6465a3c20ce10aa81751cba1d7e44e4061
data/github-ldap.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "github-ldap"
5
- spec.version = "1.1.1"
5
+ spec.version = "1.1.2"
6
6
  spec.authors = ["David Calavera"]
7
7
  spec.email = ["david.calavera@gmail.com"]
8
8
  spec.description = %q{Ldap authentication for humans}
@@ -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.map do |m|
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.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-24 00:00:00.000000000 Z
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