summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRubén Dávila <ruben@gitlab.com>2018-03-12 16:01:43 -0500
committerRubén Dávila <ruben@gitlab.com>2018-03-12 16:01:43 -0500
commitafe2c15e6bf1005e5bd1d213d3548a1a17a11137 (patch)
treea31f89b2ab3dbec92ef11fb2cf106d190ba68668 /lib
parentafd2d381119c3778140c3dd63c7ef24ecdb4c62e (diff)
downloadgitlab-ce-afe2c15e6bf1005e5bd1d213d3548a1a17a11137.tar.gz
Fix provider server URL used when listing repos to importrd-fix-github-url-when-listing-repositories-at-importing
Also use Gitlab::Auth::OAuth::Provider.config_for to access OmniAuth config
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/auth/saml/config.rb2
-rw-r--r--lib/gitlab/github_import/client.rb5
-rw-r--r--lib/gitlab/gitlab_import/client.rb2
-rw-r--r--lib/gitlab/legacy_github_import/client.rb2
-rw-r--r--lib/google_api/auth.rb2
5 files changed, 5 insertions, 8 deletions
diff --git a/lib/gitlab/auth/saml/config.rb b/lib/gitlab/auth/saml/config.rb
index e654e7fe438..2760b1a3247 100644
--- a/lib/gitlab/auth/saml/config.rb
+++ b/lib/gitlab/auth/saml/config.rb
@@ -4,7 +4,7 @@ module Gitlab
class Config
class << self
def options
- Gitlab.config.omniauth.providers.find { |provider| provider.name == 'saml' }
+ Gitlab::Auth::OAuth::Provider.config_for('saml')
end
def groups
diff --git a/lib/gitlab/github_import/client.rb b/lib/gitlab/github_import/client.rb
index 4f160e4a447..a61beafae0d 100644
--- a/lib/gitlab/github_import/client.rb
+++ b/lib/gitlab/github_import/client.rb
@@ -197,10 +197,7 @@ module Gitlab
end
def github_omniauth_provider
- @github_omniauth_provider ||=
- Gitlab.config.omniauth.providers
- .find { |provider| provider.name == 'github' }
- .to_h
+ @github_omniauth_provider ||= Gitlab::Auth::OAuth::Provider.config_for('github').to_h
end
def rate_limit_counter
diff --git a/lib/gitlab/gitlab_import/client.rb b/lib/gitlab/gitlab_import/client.rb
index 075b3982608..5482504e72e 100644
--- a/lib/gitlab/gitlab_import/client.rb
+++ b/lib/gitlab/gitlab_import/client.rb
@@ -72,7 +72,7 @@ module Gitlab
end
def config
- Gitlab.config.omniauth.providers.find {|provider| provider.name == "gitlab"}
+ Gitlab::Auth::OAuth::Provider.config_for('gitlab')
end
def gitlab_options
diff --git a/lib/gitlab/legacy_github_import/client.rb b/lib/gitlab/legacy_github_import/client.rb
index 53c910d44bd..d8ed0ebca9d 100644
--- a/lib/gitlab/legacy_github_import/client.rb
+++ b/lib/gitlab/legacy_github_import/client.rb
@@ -83,7 +83,7 @@ module Gitlab
end
def config
- Gitlab.config.omniauth.providers.find { |provider| provider.name == "github" }
+ Gitlab::Auth::OAuth::Provider.config_for('github')
end
def github_options
diff --git a/lib/google_api/auth.rb b/lib/google_api/auth.rb
index 99a82c849e0..1aeaa387a49 100644
--- a/lib/google_api/auth.rb
+++ b/lib/google_api/auth.rb
@@ -32,7 +32,7 @@ module GoogleApi
private
def config
- Gitlab.config.omniauth.providers.find { |provider| provider.name == "google_oauth2" }
+ Gitlab::Auth::OAuth::Provider.config_for('google_oauth2')
end
def client