gitlab-org--gitlab-foss/lib/gitlab/github_import/client.rb
2015-02-05 12:50:34 -08:00

29 lines
627 B
Ruby

module Gitlab
module GithubImport
class Client
attr_reader :client
def initialize
@client = ::OAuth2::Client.new(
config.app_id,
config.app_secret,
github_options
)
end
private
def config
Gitlab.config.omniauth.providers.select{|provider| provider.name == "github"}.first
end
def github_options
{
site: 'https://api.github.com',
authorize_url: 'https://github.com/login/oauth/authorize',
token_url: 'https://github.com/login/oauth/access_token'
}
end
end
end
end