From 3087f411ee9f7716a400e80cf6f965265116dd8e Mon Sep 17 00:00:00 2001 From: Ash McKenzie Date: Thu, 26 Jul 2018 18:58:39 +1000 Subject: actor is always key_id in GitlabNet --- lib/gitlab_net.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib/gitlab_net.rb') 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) -- cgit v1.2.1