Commit a019db92 authored by Isabella Almeida da Silva's avatar Isabella Almeida da Silva
Browse files

[SOMA-2553][SOMA-2623] Exportar o token como uma variável de ambiente para o...

[SOMA-2553][SOMA-2623] Exportar o token como uma variável de ambiente para o comando a ser executado
- Exportando um token fake diretamente na linha de comando a ser
executada pelo SGA
parent c67ca49b
......@@ -223,7 +223,11 @@ function server.new(config, logger, client, driver)
self.logger:info("Received job: "..job_request.cmd_string.." "..job_request.cmd_id.." "..dkjson.encode(job_request.parameters))
local job = self.joblist:new_job(job_request.cmd_id, job_request.cmd_string, job_request.parameters)
local pok, ok, err = pcall(self.driver.execute_command, self.driver, job, job_request.cmd_string)
--TODO: Usar o valor do token obtido do header do request
local job_cmd = "CSBASE_USER_TOKEN=MEU_TOKEN "..job_request.cmd_string
local pok, ok, err = pcall(self.driver.execute_command, self.driver, job, job_cmd)
self.joblist:accept_job(job, pok and ok)
if not pok then
fail(ok, 500)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment