BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
a3ec58da
Commit
a3ec58da
authored
Sep 17, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Downcase normalized LDAP DNs and UIDs
parent
4ae32d95
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
person.rb
lib/gitlab/ldap/person.rb
+1
-1
auth_hash_spec.rb
spec/lib/gitlab/ldap/auth_hash_spec.rb
+10
-2
person_spec.rb
spec/lib/gitlab/ldap/person_spec.rb
+0
-0
No files found.
lib/gitlab/ldap/person.rb
View file @
a3ec58da
...
...
@@ -100,7 +100,7 @@ module Gitlab
private
def
self
.
normalize_dn_part
(
part
)
cleaned
=
part
.
strip
cleaned
=
part
.
strip
.
downcase
if
cleaned
.
ends_with?
(
'\\'
)
# If it ends with an escape character that is not followed by a
...
...
spec/lib/gitlab/ldap/auth_hash_spec.rb
View file @
a3ec58da
...
...
@@ -68,10 +68,18 @@ describe Gitlab::LDAP::AuthHash do
describe
'#uid'
do
context
'when there is extraneous (but valid) whitespace'
do
let
(
:given_uid
)
{
'uid =
John Smith , ou = P
eople, dc= example,dc =com'
}
let
(
:given_uid
)
{
'uid =
john smith , ou = p
eople, dc= example,dc =com'
}
it
'removes the extraneous whitespace'
do
expect
(
auth_hash
.
uid
).
to
eq
(
'uid=John Smith,ou=People,dc=example,dc=com'
)
expect
(
auth_hash
.
uid
).
to
eq
(
'uid=john smith,ou=people,dc=example,dc=com'
)
end
end
context
'when there are upper case characters'
do
let
(
:given_uid
)
{
'UID=John Smith,ou=People,dc=example,dc=com'
}
it
'downcases'
do
expect
(
auth_hash
.
uid
).
to
eq
(
'uid=john smith,ou=people,dc=example,dc=com'
)
end
end
end
...
...
spec/lib/gitlab/ldap/person_spec.rb
View file @
a3ec58da
This diff is collapsed.
Click to expand it.
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