Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-06-01 09:05:07 +0300
committerLin Jen-Shin <godfat@godfat.org>2018-06-01 09:30:10 +0300
commit1e2b6cf514bcefd21520fef63b3fee5a29d334cd (patch)
tree462fc79ea4dd3b80af793f35a69ee0c5bf8bbc1e /lib/gitlab/auth.rb
parent39b6f31c66ff51451033ff84a2832731065cd28d (diff)
Introduce Gitlab::Auth.omniauth_setup_providers
Which could extend from EE
Diffstat (limited to 'lib/gitlab/auth.rb')
-rw-r--r--lib/gitlab/auth.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb
index 7047724cfe1..0f7a7b0ce8d 100644
--- a/lib/gitlab/auth.rb
+++ b/lib/gitlab/auth.rb
@@ -14,8 +14,23 @@ module Gitlab
DEFAULT_SCOPES = [:api].freeze
class << self
- def omniauth_providers
- %w[bitbucket jwt]
+ def omniauth_customized_providers
+ @omniauth_customized_providers ||= %w[bitbucket jwt]
+ end
+
+ def omniauth_setup_providers(provider_names)
+ provider_names.each do |provider|
+ omniauth_setup_a_provider(provider)
+ end
+ end
+
+ def omniauth_setup_a_provider(provider)
+ case provider
+ when 'kerberos'
+ require 'omniauth-kerberos'
+ when *omniauth_customized_providers
+ require_dependency "omni_auth/strategies/#{provider}"
+ end
end
def find_for_git_client(login, password, project:, ip:)