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
63132b75
Commit
63132b75
authored
Oct 03, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable provider based LDAP adapter
parent
a6422e27
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
lib/gitlab/ldap/adapter.rb
lib/gitlab/ldap/adapter.rb
+13
-7
No files found.
lib/gitlab/ldap/adapter.rb
View file @
63132b75
module
Gitlab
module
LDAP
class
Adapter
attr_reader
:ldap
attr_reader
:
provider
,
:
ldap
def
self
.
open
(
&
block
)
Net
::
LDAP
.
open
(
adapter_options
)
do
|
ldap
|
block
.
call
(
self
.
new
(
ldap
))
def
self
.
open
(
provider
,
&
block
)
Net
::
LDAP
.
open
(
adapter_options
(
provider
)
)
do
|
ldap
|
block
.
call
(
self
.
new
(
provider
,
ldap
))
end
end
...
...
@@ -13,7 +13,12 @@ module Gitlab
Gitlab
.
config
.
ldap
end
def
self
.
adapter_options
def
self
.
config_for
(
provider
)
config
.
servers
.
find
{
|
server
|
server
.
provider_name
==
provider
}
end
def
self
.
adapter_options
(
provider
)
config
=
config_for
(
provider
)
encryption
=
case
config
[
'method'
].
to_s
when
'ssl'
...
...
@@ -45,7 +50,8 @@ module Gitlab
end
def
initialize
(
ldap
=
nil
)
def
initialize
(
provider
,
ldap
=
nil
)
@provider
=
provider
@ldap
=
ldap
||
Net
::
LDAP
.
new
(
self
.
class
.
adapter_options
)
end
...
...
@@ -133,7 +139,7 @@ module Gitlab
private
def
config
@config
||=
self
.
class
.
config
@config
||=
self
.
class
.
config
_for
(
provider
)
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