Commit f3b1e0d3 authored by Imre Farkas's avatar Imre Farkas

Merge branch 'feature/omniauth_alicloud' into 'master'

Add omniauth provider AliCloud

See merge request gitlab-org/gitlab!83925
parents 547a8c58 d8265f09
...@@ -41,6 +41,7 @@ gem 'omniauth-azure-activedirectory-v2', '~> 1.0' ...@@ -41,6 +41,7 @@ gem 'omniauth-azure-activedirectory-v2', '~> 1.0'
gem 'omniauth-azure-oauth2', '~> 0.0.9' # Deprecated v1 version gem 'omniauth-azure-oauth2', '~> 0.0.9' # Deprecated v1 version
gem 'omniauth-cas3', '~> 1.1.4' gem 'omniauth-cas3', '~> 1.1.4'
gem 'omniauth-dingtalk-oauth2', '~> 1.0' gem 'omniauth-dingtalk-oauth2', '~> 1.0'
gem 'omniauth-alicloud', '~> 1.0.1'
gem 'omniauth-facebook', '~> 4.0.0' gem 'omniauth-facebook', '~> 4.0.0'
gem 'omniauth-github', '~> 1.4' gem 'omniauth-github', '~> 1.4'
gem 'omniauth-gitlab', '~> 1.0.2' gem 'omniauth-gitlab', '~> 1.0.2'
......
...@@ -829,6 +829,8 @@ GEM ...@@ -829,6 +829,8 @@ GEM
omniauth (1.9.1) omniauth (1.9.1)
hashie (>= 3.4.6) hashie (>= 3.4.6)
rack (>= 1.6.2, < 3) rack (>= 1.6.2, < 3)
omniauth-alicloud (1.0.1)
omniauth-oauth2 (~> 1.7.1)
omniauth-atlassian-oauth2 (0.2.0) omniauth-atlassian-oauth2 (0.2.0)
omniauth (>= 1.1.1) omniauth (>= 1.1.1)
omniauth-oauth2 (>= 1.5) omniauth-oauth2 (>= 1.5)
...@@ -1570,6 +1572,7 @@ DEPENDENCIES ...@@ -1570,6 +1572,7 @@ DEPENDENCIES
ohai (~> 16.10) ohai (~> 16.10)
oj (~> 3.10.6) oj (~> 3.10.6)
omniauth (~> 1.8) omniauth (~> 1.8)
omniauth-alicloud (~> 1.0.1)
omniauth-atlassian-oauth2 (~> 0.2.0) omniauth-atlassian-oauth2 (~> 0.2.0)
omniauth-auth0 (~> 2.0.0) omniauth-auth0 (~> 2.0.0)
omniauth-authentiq (~> 0.3.3) omniauth-authentiq (~> 0.3.3)
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
module AuthHelper module AuthHelper
PROVIDERS_WITH_ICONS = %w( PROVIDERS_WITH_ICONS = %w(
alicloud
atlassian_oauth2 atlassian_oauth2
auth0 auth0
authentiq authentiq
......
...@@ -1035,6 +1035,9 @@ production: &base ...@@ -1035,6 +1035,9 @@ production: &base
# arguments, followed by optional 'args' which can be either a hash or an array. # arguments, followed by optional 'args' which can be either a hash or an array.
# Documentation for this is available at http://doc.gitlab.com/ce/integration/omniauth.html # Documentation for this is available at http://doc.gitlab.com/ce/integration/omniauth.html
providers: providers:
# - { name: 'alicloud',
# app_id: 'YOUR_APP_ID',
# app_secret: 'YOUR_APP_SECRET' }
# See omniauth-cas3 for more configuration details # See omniauth-cas3 for more configuration details
# - { name: 'cas3', # - { name: 'cas3',
# label: 'cas3', # label: 'cas3',
...@@ -1562,6 +1565,9 @@ test: ...@@ -1562,6 +1565,9 @@ test:
external_providers: [] external_providers: []
providers: providers:
- { name: 'alicloud',
app_id: 'YOUR_APP_ID',
app_secret: 'YOUR_APP_SECRET' }
- { name: 'cas3', - { name: 'cas3',
label: 'cas3', label: 'cas3',
args: { url: 'https://sso.example.com', args: { url: 'https://sso.example.com',
......
...@@ -5,6 +5,7 @@ module Gitlab ...@@ -5,6 +5,7 @@ module Gitlab
module OAuth module OAuth
class Provider class Provider
LABELS = { LABELS = {
"alicloud" => "AliCloud",
"dingtalk" => "DingTalk", "dingtalk" => "DingTalk",
"github" => "GitHub", "github" => "GitHub",
"gitlab" => "GitLab.com", "gitlab" => "GitLab.com",
......
...@@ -31,7 +31,7 @@ RSpec.describe Profiles::AccountsController do ...@@ -31,7 +31,7 @@ RSpec.describe Profiles::AccountsController do
end end
end end
[:twitter, :facebook, :google_oauth2, :gitlab, :github, :bitbucket, :crowd, :auth0, :authentiq, :dingtalk].each do |provider| [:twitter, :facebook, :google_oauth2, :gitlab, :github, :bitbucket, :crowd, :auth0, :authentiq, :dingtalk, :alicloud].each do |provider|
describe "#{provider} provider" do describe "#{provider} provider" do
let(:user) { create(:omniauth_user, provider: provider.to_s) } let(:user) { create(:omniauth_user, provider: provider.to_s) }
......
...@@ -16,7 +16,7 @@ RSpec.describe 'OAuth Login', :js, :allow_forgery_protection do ...@@ -16,7 +16,7 @@ RSpec.describe 'OAuth Login', :js, :allow_forgery_protection do
end end
providers = [:github, :twitter, :bitbucket, :gitlab, :google_oauth2, providers = [:github, :twitter, :bitbucket, :gitlab, :google_oauth2,
:facebook, :cas3, :auth0, :authentiq, :salesforce, :dingtalk] :facebook, :cas3, :auth0, :authentiq, :salesforce, :dingtalk, :alicloud]
around do |example| around do |example|
with_omniauth_full_host { example.run } with_omniauth_full_host { example.run }
......
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