class Proxy::RemoteExecution::Ssh::Api

Private Instance Methods

authorized_job(uuid) click to toggle source
# File lib/smart_proxy_remote_execution_ssh/api.rb, line 86
def authorized_job(uuid)
  job_record = Proxy::RemoteExecution::Ssh.job_storage.find_job(uuid) || {}
  return job_record if authorize_with_token(clear: false, task_id: job_record[:execution_plan_uuid]) ||
                       job_record[:hostname] == https_cert_cn
end
notify_job(job_record, event) click to toggle source
# File lib/smart_proxy_remote_execution_ssh/api.rb, line 74
def notify_job(job_record, event)
  world.event(job_record[:execution_plan_uuid], job_record[:run_step_id], event)
end
with_authorized_job(uuid) { |job| ... } click to toggle source
# File lib/smart_proxy_remote_execution_ssh/api.rb, line 78
def with_authorized_job(uuid)
  if (job = authorized_job(uuid))
    yield job
  else
    halt 404
  end
end