class Proxy::RemoteExecution::Ssh::Dispatcher::Command

command comming from action

Attributes

effective_user[R]
host[R]
host_public_key[R]
id[R]
script[R]
ssh_user[R]
suspended_action[R]

Public Class Methods

new(data) click to toggle source
# File lib/smart_proxy_remote_execution_ssh/dispatcher.rb, line 12
def initialize(data)
  validate!(data)

  @id               = data[:id]
  @host             = data[:host]
  @ssh_user         = data[:ssh_user]
  @effective_user   = data[:effective_user]
  @script           = data[:script]
  @host_public_key  = data[:host_public_key]
  @suspended_action = data[:suspended_action]
end

Public Instance Methods

validate!(data) click to toggle source
# File lib/smart_proxy_remote_execution_ssh/dispatcher.rb, line 24
def validate!(data)
  required_fields = [:id, :host, :ssh_user, :script, :suspended_action]
  missing_fields = required_fields.find_all { |f| !data[f] }
  raise ArgumentError, "Missing fields: #{missing_fields}" unless missing_fields.empty?
end