github-ldap 1.1.2 → 1.1.3
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/domain.rb +2 -2
- data/test/domain_test.rb +3 -2
- 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: a5ecee7518b9ae2fdedb3c08c9c4b08e583543b1
|
|
4
|
+
data.tar.gz: 9ba97e83307141282fafc3363e163c6eab0102e7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: daebbb8c5c0903dd0185893c3ac7f71c0701d5db0625c6e20f26b38e48519933aa65128cf6166893a57f1fb3c02cc456a03c76bb220d765f2bc6da02d5e748f8
|
|
7
|
+
data.tar.gz: c4704da31546a9d34eb40ec0d79cf4062a9a19bae41c6580d33f58811dcb856eeb57665942fce43879dfecaa0a9afe59d3ec718d3db51eedae2e90ef5c6086b9
|
data/github-ldap.gemspec
CHANGED
data/lib/github/ldap/domain.rb
CHANGED
|
@@ -52,8 +52,8 @@ module GitHub
|
|
|
52
52
|
groups_map = all_groups.each_with_object({}) {|entry, hash| hash[entry.dn] = entry}
|
|
53
53
|
|
|
54
54
|
if @ldap.virtual_attributes.enabled?
|
|
55
|
-
member_of = groups_map.keys & user_entry[@ldap.virtual_attributes.
|
|
56
|
-
member_of.map {|dn|
|
|
55
|
+
member_of = groups_map.keys & user_entry[@ldap.virtual_attributes.virtual_membership]
|
|
56
|
+
member_of.map {|dn| groups_map[dn]}
|
|
57
57
|
else
|
|
58
58
|
groups_map.each_with_object([]) do |(dn, group), acc|
|
|
59
59
|
acc << group if Group.new(@ldap, group).is_member?(user_entry.dn)
|
data/test/domain_test.rb
CHANGED
|
@@ -84,10 +84,11 @@ module GitHubLdapDomainTestCases
|
|
|
84
84
|
|
|
85
85
|
def test_membership_with_virtual_attributes
|
|
86
86
|
ldap = GitHub::Ldap.new(options.merge(virtual_attributes: true))
|
|
87
|
-
user =
|
|
87
|
+
user = ldap.domain('uid=calavera,dc=github,dc=com').bind
|
|
88
88
|
user[:memberof] = 'cn=Enterprise,ou=Group,dc=github,dc=com'
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
domain = ldap.domain("dc=github,dc=com")
|
|
91
|
+
groups = domain.membership(user, %w(Enterprise People))
|
|
91
92
|
|
|
92
93
|
assert_equal 1, groups.size
|
|
93
94
|
assert_equal 'cn=Enterprise,ou=Group,dc=github,dc=com', groups.first.dn
|
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.3
|
|
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-
|
|
11
|
+
date: 2014-03-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: net-ldap
|