github-ldap 1.0.10 → 1.0.11
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.
- data/github-ldap.gemspec +1 -1
- data/lib/github/ldap/domain.rb +4 -1
- data/test/domain_test.rb +4 -0
- metadata +1 -1
data/github-ldap.gemspec
CHANGED
data/lib/github/ldap/domain.rb
CHANGED
@@ -73,7 +73,10 @@ module GitHub
|
|
73
73
|
# Returns the user if the login matches any `uid`.
|
74
74
|
# Returns nil if there are no matches.
|
75
75
|
def user?(login)
|
76
|
-
rs = search(
|
76
|
+
rs = search(
|
77
|
+
filter: Net::LDAP::Filter.eq(@uid, login),
|
78
|
+
attributes: [],
|
79
|
+
limit: 1)
|
77
80
|
rs and rs.first
|
78
81
|
end
|
79
82
|
|
data/test/domain_test.rb
CHANGED
@@ -109,6 +109,10 @@ class GitHubLdapDomainTest < Minitest::Test
|
|
109
109
|
assert !@domain.user?('foobar'), 'Expected uid `foobar` to not exist.'
|
110
110
|
end
|
111
111
|
|
112
|
+
def test_user_returns_every_attribute
|
113
|
+
assert_equal ['calavera@github.com'], @domain.user?('calavera')[:mail]
|
114
|
+
end
|
115
|
+
|
112
116
|
def test_auth_binds
|
113
117
|
user = @domain.user?('calavera')
|
114
118
|
assert @domain.auth(user, 'secret'), 'Expected user to be bound.'
|