aboutsummaryrefslogtreecommitdiff
path: root/captain/api.f90
diff options
context:
space:
mode:
Diffstat (limited to 'captain/api.f90')
-rw-r--r--captain/api.f9026
1 files changed, 16 insertions, 10 deletions
diff --git a/captain/api.f90 b/captain/api.f90
index 4d9545e..7b99ec7 100644
--- a/captain/api.f90
+++ b/captain/api.f90
@@ -182,6 +182,7 @@ contains
use server_response
use special_filenames
use logging
+ use security, only: validate_token => validate_titan_token
implicit none
type(titan_request), intent(in)::req
@@ -200,20 +201,25 @@ contains
! Task - "/api/player/{name}/job/{jobid}/task/{task num}"
if(trim(req%component(2)) == "player" .and. &
trim(req%component(4)) == "job" .and. &
- trim(req%component(6)) == "task") then
+ trim(req%component(6)) == "task") &
+ then
- job_id = req%path_component_int(5)
+ if(validate_token(req%token, req%component(3))) then
+
+ job_id = req%path_component_int(5)
- task_num = req%path_component_int(7)
+ task_num = req%path_component_int(7)
- write(job_text, '(I6)') job_id
- write(task_text, '(I6)') task_num
-
- call write_log("Handling a task update for job "//trim(job_text)//" task "//trim(task_text), LOG_INFO)
- call handle_task_request(req)
+ write(job_text, '(I6)') job_id
+ write(task_text, '(I6)') task_num
+
+ call write_log("Handling a task update for job "//trim(job_text)//" task "//trim(task_text), LOG_INFO)
+ call handle_task_request(req)
+
+ fullpath => get_task_result_static_filename(job_id, task_num)
+
+ end if
- fullpath => get_task_result_static_filename(job_id, task_num)
-
end if
if(associated(fullpath)) then