summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPablo Carranza <pcarranza@gmail.com>2016-03-07 12:43:19 +0000
committerPablo Carranza <pcarranza@gmail.com>2016-03-24 20:48:27 +0000
commit1f2bef765d8aa03b76f991178cfa7513833b4c3b (patch)
tree4f8653ace8b2290687d3b02dec9910923a1f6f3f /lib
parentf63e1bfcf508d9ed3c0e60399960f1c1cf21d899 (diff)
downloadgitlab-shell-1f2bef765d8aa03b76f991178cfa7513833b4c3b.tar.gz
Add ssh-key resource get to gitlab_net
This provides the integration point to the internal API to get the ssh key from the internal API.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab_net.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb
index 71e113b..ddf2a06 100644
--- a/lib/gitlab_net.rb
+++ b/lib/gitlab_net.rb
@@ -56,6 +56,11 @@ class GitlabNet
get("#{host}/check", read_timeout: CHECK_TIMEOUT)
end
+ def ssh_key(fingerprint)
+ resp = get("#{host}/ssh-key?fingerprint=#{fingerprint}")
+ JSON.parse(resp.body) rescue nil
+ end
+
protected
def config