summaryrefslogtreecommitdiff
path: root/lib/gitlab_net.rb
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2018-07-26 18:58:39 +1000
committerAsh McKenzie <amckenzie@gitlab.com>2018-08-01 00:24:16 +1000
commit3087f411ee9f7716a400e80cf6f965265116dd8e (patch)
treefa5df2a85fd60cb373c42ad4a2274f47309f64d2 /lib/gitlab_net.rb
parent99a65d67df3b77a0ae3bc6abc758708fbcc4de2a (diff)
downloadgitlab-shell-3087f411ee9f7716a400e80cf6f965265116dd8e.tar.gz
actor is always key_id in GitlabNet
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 2f704df..de95d9d 100644
--- a/lib/gitlab_net.rb
+++ b/lib/gitlab_net.rb
@@ -15,24 +15,19 @@ class GitlabNet # rubocop:disable Metrics/ClassLength
CHECK_TIMEOUT = 5
GL_PROTOCOL = 'ssh'.freeze
- def check_access(cmd, gl_repository, repo, actor, changes, protocol, env: {})
+ def check_access(cmd, gl_repository, repo, key_id, changes, protocol, env: {})
changes = changes.join("\n") unless changes.is_a?(String)
params = {
action: cmd,
changes: changes,
gl_repository: gl_repository,
+ key_id: key_id.gsub('key-', ''),
project: sanitize_path(repo),
protocol: protocol,
env: env
}
- if actor =~ /\Akey\-\d+\Z/
- params[:key_id] = actor.gsub("key-", "")
- elsif actor =~ /\Auser\-\d+\Z/
- params[:user_id] = actor.gsub("user-", "")
- end
-
url = "#{internal_api_endpoint}/allowed"
resp = post(url, params)