Commit 0976623a authored by Rémy Coutable's avatar Rémy Coutable

Extract EE-specific lines to EE::Gitlab::Auth::LDAP::Config

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 554299ea
......@@ -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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment