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 +4 -4
- data/.travis.yml +3 -0
- data/github-ldap.gemspec +1 -1
- data/lib/github/ldap/domain.rb +12 -1
- data/test/domain_test.rb +4 -0
- 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: 07498d4477565ea224ca8af669cc442308276298
|
4
|
+
data.tar.gz: cf73c24745848b687a4efacf7d3eaa19a19418bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96c0ab7db485b52cd67bc1939eaa68fd85c7ae31515e0b06e2abc780980302ac501b1d070b9c05712e7debf804f2cd0618eb4eca1ff81dbddca3887e2f4f22e2
|
7
|
+
data.tar.gz: 9ba0caec46275cfd3cced39d07bac7f2ba398a88539f6756d83dea441de784d6d0a198f93a8bc51c9d17c7dc82bbb17fa17ddd588721820e5aa61c3414112f9f
|
data/.travis.yml
CHANGED
data/github-ldap.gemspec
CHANGED
data/lib/github/ldap/domain.rb
CHANGED
@@ -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,
|
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.
|
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-
|
11
|
+
date: 2013-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ldap
|