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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "github-ldap"
5
- spec.version = "1.0.10"
5
+ spec.version = "1.0.11"
6
6
  spec.authors = ["David Calavera"]
7
7
  spec.email = ["david.calavera@gmail.com"]
8
8
  spec.description = %q{Ldap authentication for humans}
@@ -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(limit: 1, filter: Net::LDAP::Filter.eq(@uid, login))
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
 
@@ -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.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-ldap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: