Class: GitWit::AuthorizedKeys::Key

Inherits:
AuthorizedKeys::Key
  • Object
show all
Defined in:
lib/git_wit/authorized_keys/key.rb

Constant Summary collapse

SHELL_OPTIONS =
%w(no-port-forwarding no-X11-forwarding 
no-agent-forwarding no-pty)

Class Method Summary collapse

Class Method Details

.shell_key_for_username(username, key, debug = false) ⇒ Object



7
8
9
10
11
12
# File 'lib/git_wit/authorized_keys/key.rb', line 7

def self.shell_key_for_username(username, key, debug = false)
  key = self.new key if key.is_a? String
  cmd = debug ? "debug" : "git-shell #{username}"
  key.options = [%(command="git_wit #{cmd}"), *SHELL_OPTIONS]
  key
end