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
0976623a
Commit
0976623a
authored
May 18, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract EE-specific lines to EE::Gitlab::Auth::LDAP::Config
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
554299ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
ee/lib/ee/gitlab/auth/ldap/config.rb
ee/lib/ee/gitlab/auth/ldap/config.rb
+7
-0
lib/gitlab/auth/ldap/config.rb
lib/gitlab/auth/ldap/config.rb
+6
-2
spec/lib/gitlab/auth/ldap/config_spec.rb
spec/lib/gitlab/auth/ldap/config_spec.rb
+1
-1
No files found.
ee/lib/ee/gitlab/auth/ldap/config.rb
View file @
0976623a
...
...
@@ -6,9 +6,16 @@ module EE
extend
ActiveSupport
::
Concern
class_methods
do
extend
::
Gitlab
::
Utils
::
Override
def
group_sync_enabled?
enabled?
&&
::
License
.
feature_available?
(
:ldap_group_sync
)
end
override
:_available_servers
def
_available_servers
::
License
.
feature_available?
(
:multiple_ldap_servers
)
?
servers
:
super
end
end
end
end
...
...
lib/gitlab/auth/ldap/config.rb
View file @
0976623a
...
...
@@ -3,7 +3,7 @@ module Gitlab
module
Auth
module
LDAP
class
Config
include
::
EE
::
Gitlab
::
Auth
::
LDAP
::
Config
prepend
::
EE
::
Gitlab
::
Auth
::
LDAP
::
Config
NET_LDAP_ENCRYPTION_METHOD
=
{
simple_tls: :simple_tls
,
...
...
@@ -26,7 +26,11 @@ module Gitlab
def
self
.
available_servers
return
[]
unless
enabled?
::
License
.
feature_available?
(
:multiple_ldap_servers
)
?
servers
:
Array
.
wrap
(
servers
.
first
)
_available_servers
end
def
self
.
_available_servers
Array
.
wrap
(
servers
.
first
)
end
def
self
.
providers
...
...
spec/lib/gitlab/auth/ldap/config_spec.rb
View file @
0976623a
...
...
@@ -23,7 +23,7 @@ describe Gitlab::Auth::LDAP::Config do
end
it
'raises an error if a unknown provider is used'
do
expect
{
described_class
.
new
'unknown'
}.
to
raise_error
(
Gitlab
::
Auth
::
LDAP
::
Config
::
InvalidProvider
)
expect
{
described_class
.
new
'unknown'
}.
to
raise_error
(
described_class
::
InvalidProvider
)
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