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
f8c8ae29
Commit
f8c8ae29
authored
Oct 08, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use LDAP::Config in all of the adapter methods
parent
212b406f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
lib/gitlab/ldap/adapter.rb
lib/gitlab/ldap/adapter.rb
+4
-4
lib/gitlab/ldap/config.rb
lib/gitlab/ldap/config.rb
+8
-0
spec/lib/gitlab/ldap/access_spec.rb
spec/lib/gitlab/ldap/access_spec.rb
+1
-1
No files found.
lib/gitlab/ldap/adapter.rb
View file @
f8c8ae29
...
...
@@ -31,7 +31,7 @@ module Gitlab
#
def
groups
(
cn
=
"*"
,
size
=
nil
)
options
=
{
base:
config
[
'group_base'
]
,
base:
config
.
group_base
,
filter:
Net
::
LDAP
::
Filter
.
eq
(
"cn"
,
cn
)
}
...
...
@@ -54,13 +54,13 @@ module Gitlab
}
else
options
=
{
base:
config
[
'base'
]
,
base:
config
.
base
,
filter:
Net
::
LDAP
::
Filter
.
eq
(
field
,
value
)
}
end
if
config
[
'user_filter'
]
.
present?
user_filter
=
Net
::
LDAP
::
Filter
.
construct
(
config
[
'user_filter'
]
)
if
config
.
user_filter
.
present?
user_filter
=
Net
::
LDAP
::
Filter
.
construct
(
config
.
user_filter
)
options
[
:filter
]
=
if
options
[
:filter
]
Net
::
LDAP
::
Filter
.
join
(
options
[
:filter
],
user_filter
)
...
...
lib/gitlab/ldap/config.rb
View file @
f8c8ae29
...
...
@@ -23,6 +23,14 @@ module Gitlab
end
end
def
base
options
[
'base'
]
end
def
uid
options
[
'uid'
]
end
def
sync_ssh_keys?
sync_ssh_keys
.
present?
end
...
...
spec/lib/gitlab/ldap/access_spec.rb
View file @
f8c8ae29
...
...
@@ -34,7 +34,7 @@ describe Gitlab::LDAP::Access do
subject
{
access
.
update_permissions
}
it
"syncs ssh keys if enabled by configuration"
do
access
.
stub
sync_ssh_keys?:
true
access
.
stub
sync_ssh_keys?:
'sshpublickey'
expect
(
access
).
to
receive
(
:update_ssh_keys
).
once
subject
...
...
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