diff options
author | Nick Thomas <nick@gitlab.com> | 2018-08-14 00:22:46 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-08-14 00:22:46 +0100 |
commit | c8bf2e7d47c3b8f34cb79847edcd5dd50b8f280e (patch) | |
tree | cc22dc6c91f58ccaadd97fdd816159de6ec8a135 /bin | |
parent | 764f6f47fa6a8698ae033532ae49875a87030518 (diff) | |
download | gitlab-shell-c8bf2e7d47c3b8f34cb79847edcd5dd50b8f280e.tar.gz |
Revert "Merge branch 'ash.mckenzie/srp-refactor' into 'master'"
This reverts commit 3aaf4751e09262c53544a1987f59b1308af9b6c1, reversing
changes made to c6577e0d75f51b017f2f332838b97c3ca5b497c0.
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 | 10 | ||||
-rwxr-xr-x | bin/gitlab-shell-authorized-principals-check | 8 |
4 files changed, 15 insertions, 15 deletions
diff --git a/bin/authorized_keys b/bin/authorized_keys index 24484f1..ca01646 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... # -full_key = ARGV[0] -abort "# No key provided" if full_key.nil? || full_key.empty? +key = ARGV[0] +abort "# No key provided" if key.nil? || key.empty? require_relative "../lib/gitlab_init" require_relative "../lib/gitlab_net" require_relative "../lib/gitlab_keys" -authorized_key = GitlabNet.new.authorized_key(full_key) +authorized_key = GitlabNet.new.authorized_key(key) if authorized_key.nil? - puts "# No key was found for #{full_key}" + puts "# No key was found for #{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 c0284e8..9eb1950 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 b2cd24c..2ea1a74 100755 --- a/bin/gitlab-shell-authorized-keys-check +++ b/bin/gitlab-shell-authorized-keys-check @@ -5,7 +5,7 @@ # command for a given ssh key fingerprint # # Ex. -# bin/gitlab-shell-authorized-keys-check <expected-username> <actual-username> <public-key> +# bin/gitlab-shell-authorized-keys-check <username> <public-key> # # Returns # command="/bin/gitlab-shell key-#",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAA... @@ -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 -full_key = ARGV[2] -abort "# No key provided" if full_key.nil? || full_key == '' +key = ARGV[2] +abort "# No key provided" if key.nil? || key == '' require_relative '../lib/gitlab_init' require_relative '../lib/gitlab_net' require_relative '../lib/gitlab_keys' -authorized_key = GitlabNet.new.authorized_key(full_key) +authorized_key = GitlabNet.new.authorized_key(key) if authorized_key.nil? - puts "# No key was found for #{full_key}" + puts "# No key was found for #{key}" else puts GitlabKeys.key_line("key-#{authorized_key['id']}", authorized_key['key']) end diff --git a/bin/gitlab-shell-authorized-principals-check b/bin/gitlab-shell-authorized-principals-check index 4b39cac..aa6d427 100755 --- a/bin/gitlab-shell-authorized-principals-check +++ b/bin/gitlab-shell-authorized-principals-check @@ -6,7 +6,7 @@ # the right options. # # Ex. -# bin/gitlab-shell-authorized-principals-check <key-id> <principal1> [<principal2>...] +# bin/gitlab-shell-authorized-keys-check <key-id> <principal1> [<principal2>...] # # Returns one line per principal passed in, e.g.: # command="/bin/gitlab-shell username-{KEY_ID}",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty {PRINCIPAL} @@ -23,9 +23,9 @@ key_id = ARGV[0] abort '# No key_id provided' if key_id.nil? || key_id == '' principals = ARGV[1..-1] -principals.each do |principal| - abort '# An invalid principal was provided' if principal.nil? || principal == '' -end +principals.each { |principal| + abort '# An invalid principal was provided' if principal.nil? || principal == '' +} require_relative '../lib/gitlab_init' require_relative '../lib/gitlab_net' |