diff options
author | Jeffrey Armstrong <jeff@approximatrix.com> | 2022-04-11 16:28:43 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeff@approximatrix.com> | 2022-04-11 16:28:43 -0400 |
commit | 4392961dd95582b91e173f9ae40ac510b9afe7d4 (patch) | |
tree | 253e6d2b7ea70b21074575af94d194ed4ec48571 /player | |
parent | 26a936137f67843cb773bc9b9e8c360d5abff65f (diff) | |
download | levitating-4392961dd95582b91e173f9ae40ac510b9afe7d4.tar.gz levitating-4392961dd95582b91e173f9ae40ac510b9afe7d4.zip |
Added token validation to all api calls, esp. checkins. Changed status reports to use better query structure. Added query derived types to the request derived types directly. Requires testing of actual builds.
Diffstat (limited to 'player')
-rw-r--r-- | player/endpoints.f90 | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/player/endpoints.f90 b/player/endpoints.f90 index 09d3faa..8708592 100644 --- a/player/endpoints.f90 +++ b/player/endpoints.f90 @@ -57,6 +57,27 @@ contains end subroutine base_url + subroutine append_query_token(url) + use config, only: token + implicit none + + character(len=*), intent(inout)::url + character::prepend + + if(len_trim(token) > 0) then + + if(index(url, "?") > 0) then + prepend = "&" + else + prepend = "?" + end if + + url = trim(url)//prepend//"token="//trim(token) + + end if + + end subroutine append_query_token + subroutine get_check_in_url(res) use config use utilities, only: replace_field @@ -66,6 +87,7 @@ contains call base_url(captain, LOCATION_CHECK_IN, .false., res) call replace_field(res, "name", identity) + call append_query_token(res) end subroutine get_check_in_url @@ -92,9 +114,11 @@ contains call replace_field(url, "step", step) if(present(status)) then - url = trim(url)//"?"//trim(status_text(status)) + url = trim(url)//"?status="//trim(status_text(status)) end if - + + call append_query_token(url) + end subroutine get_status_url subroutine get_job_report_url(job, success, res) @@ -113,6 +137,8 @@ contains end if call replace_field(res, "name", identity) call replace_field(res, "jobid", job) + + call append_query_token(res) end subroutine get_job_report_url |