summaryrefslogtreecommitdiff
path: root/lib/gitlab_net.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab_net.rb')
-rw-r--r--lib/gitlab_net.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb
index 71e113b..8b6d33b 100644
--- a/lib/gitlab_net.rb
+++ b/lib/gitlab_net.rb
@@ -56,6 +56,13 @@ class GitlabNet
get("#{host}/check", read_timeout: CHECK_TIMEOUT)
end
+ def authorized_key(key)
+ resp = get("#{host}/authorized_keys?key=#{URI.escape(key, '+/=')}")
+ JSON.parse(resp.body) if resp.code == "200"
+ rescue
+ nil
+ end
+
protected
def config