diff options
author | Nick Thomas <nick@gitlab.com> | 2019-10-14 16:00:48 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-10-15 07:44:13 +0100 |
commit | 18096b5440e0818605add32538751c6be38e8343 (patch) | |
tree | b4aebac9d7f752156ee4ec3d44ee990021a1b295 /lib/gitlab_keys.rb | |
parent | 8db304b4919519bca60a5b18ffe9b88dcde845af (diff) | |
download | gitlab-shell-18096b5440e0818605add32538751c6be38e8343.tar.gz |
Remove dead Ruby code
Diffstat (limited to 'lib/gitlab_keys.rb')
-rw-r--r-- | lib/gitlab_keys.rb | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/lib/gitlab_keys.rb b/lib/gitlab_keys.rb deleted file mode 100644 index 4742c45..0000000 --- a/lib/gitlab_keys.rb +++ /dev/null @@ -1,39 +0,0 @@ -module GitlabKeys - class KeyError < StandardError; end - - def self.command(whatever) - "#{ROOT_PATH}/bin/gitlab-shell #{whatever}" - end - - def self.command_key(key_id) - unless /\A[a-z0-9-]+\z/ =~ key_id - raise KeyError, "Invalid key_id: #{key_id.inspect}" - end - - command(key_id) - end - - def self.whatever_line(command, trailer) - "command=\"#{command}\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty #{trailer}" - end - - def self.key_line(key_id, public_key) - public_key.chomp! - - if public_key.include?("\n") - raise KeyError, "Invalid public_key: #{public_key.inspect}" - end - - whatever_line(command_key(key_id), public_key) - end - - def self.principal_line(username_key_id, principal) - principal.chomp! - - if principal.include?("\n") - raise KeyError, "Invalid principal: #{principal.inspect}" - end - - whatever_line(command_key(username_key_id), principal) - end -end |