diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2018-07-31 15:46:52 +1000 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2018-08-01 00:24:17 +1000 |
commit | e621b365f0097c164cf1bdbbc19b3141f03f741b (patch) | |
tree | 108a6c27645da7c340a01e4027de609b27ec459e /bin | |
parent | be5b38f5338a7a4fc48229990480b144a1499903 (diff) | |
download | gitlab-shell-e621b365f0097c164cf1bdbbc19b3141f03f741b.tar.gz |
Use full_key to highlight it's the full SSH key
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/authorized_keys | 10 | ||||
-rwxr-xr-x | bin/gitlab-keys | 2 | ||||
-rwxr-xr-x | bin/gitlab-shell-authorized-keys-check | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/bin/authorized_keys b/bin/authorized_keys index ca01646..24484f1 100755 --- a/bin/authorized_keys +++ b/bin/authorized_keys @@ -10,16 +10,16 @@ # command="/bin/gitlab-shell key-#",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAADAQA... # -key = ARGV[0] -abort "# No key provided" if key.nil? || key.empty? +full_key = ARGV[0] +abort "# No key provided" if full_key.nil? || full_key.empty? require_relative "../lib/gitlab_init" require_relative "../lib/gitlab_net" require_relative "../lib/gitlab_keys" -authorized_key = GitlabNet.new.authorized_key(key) +authorized_key = GitlabNet.new.authorized_key(full_key) if authorized_key.nil? - puts "# No key was found for #{key}" + puts "# No key was found for #{full_key}" else - puts GitlabKeys.key_line("key-#{authorized_key['id']}", authorized_key["key"]) + puts GitlabKeys.key_line("key-#{authorized_key['id']}", authorized_key['key']) end diff --git a/bin/gitlab-keys b/bin/gitlab-keys index 9eb1950..c0284e8 100755 --- a/bin/gitlab-keys +++ b/bin/gitlab-keys @@ -13,7 +13,7 @@ require_relative '../lib/gitlab_init' # /bin/gitlab-keys rm-key key-23 "ssh-rsa AAAAx321..." # # /bin/gitlab-keys list-keys -# +# # /bin/gitlab-keys clear # diff --git a/bin/gitlab-shell-authorized-keys-check b/bin/gitlab-shell-authorized-keys-check index 2ea1a74..a46495a 100755 --- a/bin/gitlab-shell-authorized-keys-check +++ b/bin/gitlab-shell-authorized-keys-check @@ -27,16 +27,16 @@ abort '# No username provided' if actual_username.nil? || actual_username == '' # Normally, these would both be 'git', but it can be configured by the user exit 0 unless expected_username == actual_username -key = ARGV[2] -abort "# No key provided" if key.nil? || key == '' +full_key = ARGV[2] +abort "# No key provided" if full_key.nil? || full_key == '' require_relative '../lib/gitlab_init' require_relative '../lib/gitlab_net' require_relative '../lib/gitlab_keys' -authorized_key = GitlabNet.new.authorized_key(key) +authorized_key = GitlabNet.new.authorized_key(full_key) if authorized_key.nil? - puts "# No key was found for #{key}" + puts "# No key was found for #{full_key}" else puts GitlabKeys.key_line("key-#{authorized_key['id']}", authorized_key['key']) end |