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
7bca8745
Commit
7bca8745
authored
Sep 23, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-ldap-attributes' into 'master'
Fix LDAP attribute mapping See merge request !1408
parents
0175769a
73a3df4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
lib/gitlab/ldap/auth_hash.rb
lib/gitlab/ldap/auth_hash.rb
+2
-1
spec/lib/gitlab/ldap/auth_hash_spec.rb
spec/lib/gitlab/ldap/auth_hash_spec.rb
+6
-6
No files found.
lib/gitlab/ldap/auth_hash.rb
View file @
7bca8745
...
@@ -6,7 +6,7 @@ module Gitlab
...
@@ -6,7 +6,7 @@ module Gitlab
private
private
def
get_info
(
key
)
def
get_info
(
key
)
attributes
=
ldap_config
.
attributes
[
key
]
attributes
=
ldap_config
.
attributes
[
key
.
to_s
]
return
super
unless
attributes
return
super
unless
attributes
attributes
=
Array
(
attributes
)
attributes
=
Array
(
attributes
)
...
@@ -14,6 +14,7 @@ module Gitlab
...
@@ -14,6 +14,7 @@ module Gitlab
value
=
nil
value
=
nil
attributes
.
each
do
|
attribute
|
attributes
.
each
do
|
attribute
|
value
=
get_raw
(
attribute
)
value
=
get_raw
(
attribute
)
value
=
value
.
first
if
value
break
if
value
.
present?
break
if
value
.
present?
end
end
...
...
spec/lib/gitlab/ldap/auth_hash_spec.rb
View file @
7bca8745
...
@@ -24,10 +24,10 @@ describe Gitlab::LDAP::AuthHash do
...
@@ -24,10 +24,10 @@ describe Gitlab::LDAP::AuthHash do
let
(
:raw_info
)
do
let
(
:raw_info
)
do
{
{
uid:
'123456'
,
uid:
[
'123456'
]
,
email:
'johnsmith@example.com'
,
email:
[
'johnsmith@example.com'
]
,
cn:
'Smith, J.'
,
cn:
[
'Smith, J.'
]
,
fullName:
'John Smith'
fullName:
[
'John Smith'
]
}
}
end
end
...
@@ -45,8 +45,8 @@ describe Gitlab::LDAP::AuthHash do
...
@@ -45,8 +45,8 @@ describe Gitlab::LDAP::AuthHash do
context
"with overridden attributes"
do
context
"with overridden attributes"
do
let
(
:attributes
)
do
let
(
:attributes
)
do
{
{
username:
[
'mail'
,
'email'
],
'username'
=>
[
'mail'
,
'email'
],
name:
'fullName'
'name'
=>
'fullName'
}
}
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