Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
eff30fff
Commit
eff30fff
authored
Apr 15, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve dn_matches_filter method
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
1fe67799
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
7 deletions
+2
-7
lib/gitlab/ldap/adapter.rb
lib/gitlab/ldap/adapter.rb
+1
-6
spec/lib/gitlab/ldap/ldap_adapter_spec.rb
spec/lib/gitlab/ldap/ldap_adapter_spec.rb
+1
-1
No files found.
lib/gitlab/ldap/adapter.rb
View file @
eff30fff
...
...
@@ -107,12 +107,7 @@ module Gitlab
end
def
dn_matches_filter?
(
dn
,
filter
)
results
=
ldap_search
(
base:
dn
,
filter:
filter
,
attributes:
%w{dn}
)
if
results
.
blank?
false
# Net::LDAP encountered an LDAP error
else
results
.
any?
end
ldap_search
(
base:
dn
,
filter:
filter
,
attributes:
%w{dn}
).
any?
end
def
ldap_search
(
*
args
)
...
...
spec/lib/gitlab/ldap/ldap_adapter_spec.rb
View file @
eff30fff
...
...
@@ -23,7 +23,7 @@ describe Gitlab::LDAP::Adapter do
end
context
"when the search encounters an error"
do
before
{
ldap
.
stub
(
search:
nil
)
}
before
{
ldap
.
stub
(
search:
nil
,
get_operation_result:
double
(
code:
1
,
message:
'some error'
)
)
}
it
{
should
be_false
}
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment