Commit c4d63ab0 authored by Ash McKenzie's avatar Ash McKenzie

Tidy up GitlabNet

* Remove HTTP related requires
* Make protocol = GL_PROTOCOL the default
parent 3087f411
require 'net/http'
require 'openssl'
require 'json'
require_relative 'gitlab_config'
require_relative 'gitlab_logger'
require_relative 'gitlab_access'
require_relative 'gitlab_lfs_authentication'
require_relative 'httpunix'
require_relative 'http_helper'
class GitlabNet # rubocop:disable Metrics/ClassLength
......@@ -15,7 +11,7 @@ class GitlabNet # rubocop:disable Metrics/ClassLength
CHECK_TIMEOUT = 5
GL_PROTOCOL = 'ssh'.freeze
def check_access(cmd, gl_repository, repo, key_id, changes, protocol, env: {})
def check_access(cmd, gl_repository, repo, key_id, changes, protocol = GL_PROTOCOL, env: {})
changes = changes.join("\n") unless changes.is_a?(String)
params = {
......@@ -28,8 +24,7 @@ class GitlabNet # rubocop:disable Metrics/ClassLength
env: env
}
url = "#{internal_api_endpoint}/allowed"
resp = post(url, params)
resp = post("#{internal_api_endpoint}/allowed", params)
if resp.code == '200'
GitAccessStatus.create_from_json(resp.body)
......
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