Module: API::Helpers::ImportGithubHelpers

Defined in:
lib/api/helpers/import_github_helpers.rb

Instance Method Summary collapse

Instance Method Details

#access_paramsObject



11
12
13
14
15
# File 'lib/api/helpers/import_github_helpers.rb', line 11

def access_params
  {
    github_access_token: params[:personal_access_token]
  }
end

#clientObject



6
7
8
9
# File 'lib/api/helpers/import_github_helpers.rb', line 6

def client
  @client ||= Gitlab::GithubImport::Client.new(params[:personal_access_token], host: params[:github_hostname],
    per_page: params[:pagination_limit])
end

#providerObject



17
18
19
# File 'lib/api/helpers/import_github_helpers.rb', line 17

def provider
  :github
end

#provider_unauthorizedObject



21
22
23
# File 'lib/api/helpers/import_github_helpers.rb', line 21

def provider_unauthorized
  error!("Wrong credentials", 401)
end

#too_many_requestsObject



25
26
27
# File 'lib/api/helpers/import_github_helpers.rb', line 25

def too_many_requests
  error!('Too Many Requests', 429)
end