Skip to content
Snippets Groups Projects
Commit 33f80629 authored by Robert Speicher's avatar Robert Speicher Committed by Valery Sizov
Browse files

Merge branch 'fix-ghe-import' into 'master'

Fix importing projects from GitHub Enterprise Edition.

Addresses #333.

See merge request !473
parent 3b8e7502
No related branches found
No related tags found
No related merge requests found
v 7.14
- Disable adding, updating and removing members from a group that is synced with LDAP
- Don't send "Added to group" notifications when group is LDAP synched
- Fix importing projects from GitHub Enterprise Edition.
- Automatic approver suggestions (based on an authority of the code)
v7.13.3
- Merge community edition changes for version 7.13.3
- Improved validation for an approver
Loading
Loading
Loading
Loading
@@ -102,7 +102,7 @@ def verify_constant(modul, current, default)
# Fill out omniauth-gitlab settings. It is needed for easy set up GHE or GH by just specifying url.
 
github_default_url = "https://github.com"
github_settings = Settings.omniauth['providers'].find{|provider| provider["name"] == "github"}
github_settings = Settings.omniauth['providers'].find { |provider| provider["name"] == "github"}
 
if github_settings
# For compatibility with old config files (before 7.8)
Loading
Loading
@@ -112,11 +112,7 @@ def verify_constant(modul, current, default)
end
 
if github_settings["url"].include?(github_default_url)
github_settings["args"]["client_options"] = {
"site" => 'https://api.github.com/',
"authorize_url" => 'https://github.com/login/oauth/authorize',
"token_url" => 'https://github.com/login/oauth/access_token'
}
github_settings["args"]["client_options"] = OmniAuth::Strategies::GitHub.default_options[:client_options]
else
github_settings["args"]["client_options"] = {
"site" => File.join(github_settings["url"], "api/v3"),
Loading
Loading
Loading
Loading
@@ -42,11 +42,11 @@ def respond_to?(method)
private
 
def config
Gitlab.config.omniauth.providers.find{|provider| provider.name == "github"}
Gitlab.config.omniauth.providers.find { |provider| provider.name == "github"}
end
 
def github_options
OmniAuth::Strategies::GitHub.default_options[:client_options].symbolize_keys
config["args"]["client_options"].deep_symbolize_keys
end
end
end
Loading
Loading
Loading
Loading
@@ -5,7 +5,8 @@
let(:client) { Gitlab::GithubImport::Client.new(token) }
 
before do
Gitlab.config.omniauth.providers << OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "github")
github_provider = OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "github", args: { "client_options" => {} })
allow(Gitlab.config.omniauth).to receive(:providers).and_return([github_provider])
end
 
it 'all OAuth2 client options are symbols' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment