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
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
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
61 deletions
+69
-61
lib/gitlab/ldap/person.rb
lib/gitlab/ldap/person.rb
+1
-1
spec/lib/gitlab/ldap/auth_hash_spec.rb
spec/lib/gitlab/ldap/auth_hash_spec.rb
+10
-2
spec/lib/gitlab/ldap/person_spec.rb
spec/lib/gitlab/ldap/person_spec.rb
+58
-58
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