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
4f97eb9f
Commit
4f97eb9f
authored
Jan 17, 2020
by
Blair Lunceford
Committed by
Imre Farkas
Jan 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Dashes not supported in CN for LDAP Group Sync on first login"
parent
59ec1084
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
changelogs/unreleased/36753-dashes-not-supported-in-cn-for-ldap-group-sync-on-first-login.yml
...ot-supported-in-cn-for-ldap-group-sync-on-first-login.yml
+5
-0
ee/lib/ee/gitlab/auth/ldap/person.rb
ee/lib/ee/gitlab/auth/ldap/person.rb
+1
-1
ee/spec/lib/gitlab/auth/ldap/person_spec.rb
ee/spec/lib/gitlab/auth/ldap/person_spec.rb
+8
-1
No files found.
changelogs/unreleased/36753-dashes-not-supported-in-cn-for-ldap-group-sync-on-first-login.yml
0 → 100644
View file @
4f97eb9f
---
title
:
Support dashes in LDAP group CN for sync on users first log in
merge_request
:
20402
author
:
type
:
fixed
ee/lib/ee/gitlab/auth/ldap/person.rb
View file @
4f97eb9f
...
...
@@ -91,7 +91,7 @@ module EE
def
cn_from_memberof
(
memberof
)
# Only get the first CN value of the string, that's the one that contains
# the group name
memberof
.
match
(
/(?:cn=([\w\s]+))/i
)
&
.
captures
&
.
first
memberof
.
match
(
/(?:cn=([\w\s
-
]+))/i
)
&
.
captures
&
.
first
end
end
end
...
...
ee/spec/lib/gitlab/auth/ldap/person_spec.rb
View file @
4f97eb9f
...
...
@@ -232,7 +232,7 @@ describe Gitlab::Auth::LDAP::Person do
it
'gets the group cn from the memberof value'
do
person
=
described_class
.
new
(
entry
,
'ldapmain'
)
expect
(
person
.
cn_from_memberof
(
'
c
N=Group Policy Creator Owners,CN=Users,DC=Vosmaer,DC=com'
))
expect
(
person
.
cn_from_memberof
(
'
C
N=Group Policy Creator Owners,CN=Users,DC=Vosmaer,DC=com'
))
.
to
eq
(
'Group Policy Creator Owners'
)
end
...
...
@@ -242,6 +242,13 @@ describe Gitlab::Auth::LDAP::Person do
expect
(
person
.
cn_from_memberof
(
'DC=Vosmaer,DC=com'
))
.
to
be_nil
end
it
"supports dashes in the group cn"
do
person
=
described_class
.
new
(
entry
,
'ldapmain'
)
expect
(
person
.
cn_from_memberof
(
'CN=Group-Policy-Creator-Owners,CN=Users,DC=Vosmaer,DC=com'
))
.
to
eq
(
'Group-Policy-Creator-Owners'
)
end
end
describe
'#group_cns'
do
...
...
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