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
d8b3c327
Commit
d8b3c327
authored
May 14, 2015
by
Corey Hinshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AuthHash should not parameterize email user
parent
66706570
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
auth_hash.rb
lib/gitlab/o_auth/auth_hash.rb
+1
-1
auth_hash_spec.rb
spec/lib/gitlab/o_auth/auth_hash_spec.rb
+2
-2
No files found.
lib/gitlab/o_auth/auth_hash.rb
View file @
d8b3c327
...
...
@@ -62,7 +62,7 @@ module Gitlab
# Get the first part of the email address (before @)
# In addtion in removes illegal characters
def
generate_username
(
email
)
email
.
match
(
/^[^@]*/
)[
0
].
parameterize
email
.
match
(
/^[^@]*/
)[
0
].
mb_chars
.
normalize
(
:kd
).
gsub
(
/[^\x00-\x7F]/
,
''
).
to_s
end
def
generate_temporarily_email
(
username
)
...
...
spec/lib/gitlab/o_auth/auth_hash_spec.rb
View file @
d8b3c327
...
...
@@ -14,7 +14,7 @@ describe Gitlab::OAuth::AuthHash, lib: true do
let
(
:uid_raw
)
do
"CN=Onur K
\xC3\xBC\xC3\xA7\xC3\xBC
k,OU=Test,DC=example,DC=net"
end
let
(
:email_raw
)
{
"onur.k
\xC3\xBC\xC3\xA7\xC3\xBC
k@example.net"
}
let
(
:email_raw
)
{
"onur.k
\xC3\xBC\xC3\xA7\xC3\xBC
k
_ABC-123
@example.net"
}
let
(
:nickname_raw
)
{
"ok
\xC3\xBC\xC3\xA7\xC3\xBC
k"
}
let
(
:first_name_raw
)
{
'Onur'
}
let
(
:last_name_raw
)
{
"K
\xC3\xBC\xC3\xA7\xC3\xBC
k"
}
...
...
@@ -66,7 +66,7 @@ describe Gitlab::OAuth::AuthHash, lib: true do
before
{
info_hash
.
delete
(
:nickname
)
}
it
'takes the first part of the email as username'
do
expect
(
auth_hash
.
username
).
to
eql
'onur
-kucuk
'
expect
(
auth_hash
.
username
).
to
eql
'onur
.kucuk_ABC-123
'
end
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