class Proxy::RemoteExecution::Ssh::Runners::EffectiveUserMethod

Attributes

effective_user[R]
effective_user_password[R]
password_sent[R]
ssh_user[R]

Public Class Methods

new(effective_user, ssh_user, effective_user_password) click to toggle source
# File lib/smart_proxy_remote_execution_ssh/runners/script_runner.rb, line 9
def initialize(effective_user, ssh_user, effective_user_password)
  @effective_user = effective_user
  @ssh_user = ssh_user
  @effective_user_password = effective_user_password.to_s
  @password_sent = false
end

Public Instance Methods

cli_command_prefix() click to toggle source
# File lib/smart_proxy_remote_execution_ssh/runners/script_runner.rb, line 35
def cli_command_prefix; end
filter_password?(received_data) click to toggle source
# File lib/smart_proxy_remote_execution_ssh/runners/script_runner.rb, line 23
def filter_password?(received_data)
  !@effective_user_password.empty? && @password_sent && received_data.match(Regexp.escape(@effective_user_password))
end
login_prompt() click to toggle source
# File lib/smart_proxy_remote_execution_ssh/runners/script_runner.rb, line 37
def login_prompt; end
on_data(received_data, io_buffer) click to toggle source
# File lib/smart_proxy_remote_execution_ssh/runners/script_runner.rb, line 16
def on_data(received_data, io_buffer)
  if received_data.match(login_prompt)
    io_buffer.add_data(effective_user_password + "\n")
    @password_sent = true
  end
end
reset() click to toggle source
# File lib/smart_proxy_remote_execution_ssh/runners/script_runner.rb, line 31
def reset
  @password_sent = false
end
sent_all_data?() click to toggle source
# File lib/smart_proxy_remote_execution_ssh/runners/script_runner.rb, line 27
def sent_all_data?
  effective_user_password.empty? || password_sent
end