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
0
Merge Requests
0
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
Jérome Perrin
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
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
lib/gitlab/o_auth/auth_hash.rb
lib/gitlab/o_auth/auth_hash.rb
+1
-1
spec/lib/gitlab/o_auth/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
...
@@ -62,7 +62,7 @@ module Gitlab
# Get the first part of the email address (before @)
# Get the first part of the email address (before @)
# In addtion in removes illegal characters
# In addtion in removes illegal characters
def
generate_username
(
email
)
def
generate_username
(
email
)
email
.
match
(
/^[^@]*/
)[
0
].
parameterize
email
.
match
(
/^[^@]*/
)[
0
].
mb_chars
.
normalize
(
:kd
).
gsub
(
/[^\x00-\x7F]/
,
''
).
to_s
end
end
def
generate_temporarily_email
(
username
)
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
...
@@ -14,7 +14,7 @@ describe Gitlab::OAuth::AuthHash, lib: true do
let
(
:uid_raw
)
do
let
(
:uid_raw
)
do
"CN=Onur K
\xC3\xBC\xC3\xA7\xC3\xBC
k,OU=Test,DC=example,DC=net"
"CN=Onur K
\xC3\xBC\xC3\xA7\xC3\xBC
k,OU=Test,DC=example,DC=net"
end
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
(
:nickname_raw
)
{
"ok
\xC3\xBC\xC3\xA7\xC3\xBC
k"
}
let
(
:first_name_raw
)
{
'Onur'
}
let
(
:first_name_raw
)
{
'Onur'
}
let
(
:last_name_raw
)
{
"K
\xC3\xBC\xC3\xA7\xC3\xBC
k"
}
let
(
:last_name_raw
)
{
"K
\xC3\xBC\xC3\xA7\xC3\xBC
k"
}
...
@@ -66,7 +66,7 @@ describe Gitlab::OAuth::AuthHash, lib: true do
...
@@ -66,7 +66,7 @@ describe Gitlab::OAuth::AuthHash, lib: true do
before
{
info_hash
.
delete
(
:nickname
)
}
before
{
info_hash
.
delete
(
:nickname
)
}
it
'takes the first part of the email as username'
do
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
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