summaryrefslogtreecommitdiff
path: root/lib/gitlab_net.rb
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2018-07-26 19:01:27 +1000
committerAsh McKenzie <amckenzie@gitlab.com>2018-08-01 00:24:16 +1000
commitc4d63ab07f83c93b5e80a81db5a6bb926b6930c7 (patch)
treeacfe226da249066ff307e850163c2de71946f892 /lib/gitlab_net.rb
parent3087f411ee9f7716a400e80cf6f965265116dd8e (diff)
downloadgitlab-shell-c4d63ab07f83c93b5e80a81db5a6bb926b6930c7.tar.gz
Tidy up GitlabNet
* Remove HTTP related requires * Make protocol = GL_PROTOCOL the default
Diffstat (limited to 'lib/gitlab_net.rb')
-rw-r--r--lib/gitlab_net.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb
index de95d9d..191ecf5 100644
--- a/lib/gitlab_net.rb
+++ b/lib/gitlab_net.rb
@@ -1,12 +1,8 @@
-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)