github-ldap 1.0.13 → 1.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 663aa6744a1c2d0be074f1a483d7de549c6406ea
4
- data.tar.gz: ec942332f6459f1c49565f9046c6bdd45636b724
3
+ metadata.gz: 07498d4477565ea224ca8af669cc442308276298
4
+ data.tar.gz: cf73c24745848b687a4efacf7d3eaa19a19418bb
5
5
  SHA512:
6
- metadata.gz: 2323046a450b696e794b7eb3e6984d5c107e196ea4939a63ad9d1140a3733891cc1453611ed4bce323d9c470d0cfb86be59cb80cdd6be228bdbcf1e38a7d9f61
7
- data.tar.gz: 20de0be293a681998e4fa66874d5258da002293c6e610a2b24aa6c2f3d1f45be3abc4dba7ef190e3413b8ded3c7e1457f7b9d3398a7cafa35270fb7d39f2064f
6
+ metadata.gz: 96c0ab7db485b52cd67bc1939eaa68fd85c7ae31515e0b06e2abc780980302ac501b1d070b9c05712e7debf804f2cd0618eb4eca1ff81dbddca3887e2f4f22e2
7
+ data.tar.gz: 9ba0caec46275cfd3cced39d07bac7f2ba398a88539f6756d83dea441de784d6d0a198f93a8bc51c9d17c7dc82bbb17fa17ddd588721820e5aa61c3414112f9f
data/.travis.yml CHANGED
@@ -2,3 +2,6 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
+
6
+ notifications:
7
+ email: false
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.0.13"
5
+ spec.version = "1.0.15"
6
6
  spec.authors = ["David Calavera"]
7
7
  spec.email = ["david.calavera@gmail.com"]
8
8
  spec.description = %q{Ldap authentication for humans}
@@ -73,8 +73,9 @@ 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
+ escaped_login = Net::LDAP::Filter.escape(login)
76
77
  rs = search(
77
- filter: Net::LDAP::Filter.eq(@uid, login),
78
+ filter: Net::LDAP::Filter.eq(@uid, escaped_login),
78
79
  attributes: [],
79
80
  limit: 1)
80
81
  rs and rs.first
@@ -119,6 +120,16 @@ module GitHub
119
120
 
120
121
  @connection.search(options)
121
122
  end
123
+
124
+ # Provide a meaningful result after a protocol operation (for example,
125
+ # bind or search) has completed.
126
+ #
127
+ # Returns an OpenStruct containing an LDAP result code and a
128
+ # human-readable string.
129
+ # See http://tools.ietf.org/html/rfc4511#appendix-A
130
+ def get_operation_result
131
+ @connection.get_operation_result
132
+ end
122
133
  end
123
134
  end
124
135
  end
data/test/domain_test.rb CHANGED
@@ -95,6 +95,10 @@ module GitHubLdapDomainTestCases
95
95
  assert_equal 'uid=calavera,dc=github,dc=com', @domain.user?('calavera').dn
96
96
  end
97
97
 
98
+ def test_user_wildcards_are_filtered
99
+ assert !@domain.user?('cal*'), 'Expected uid `cal*` to not complete'
100
+ end
101
+
98
102
  def test_user_does_not_exist
99
103
  assert !@domain.user?('foobar'), 'Expected uid `foobar` to not exist.'
100
104
  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.0.13
4
+ version: 1.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Calavera
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-13 00:00:00.000000000 Z
11
+ date: 2013-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ldap