Skip to content

All client.aget calls should use use_http_response

Problem to solve

Duo workflow executor sends a string response to Duo Workflow Service. This is problematic when the http response is non-sucess or there was another error preventing executor to make the http request.

Proposal

Executors now also provide a structured response. This is enabled when use_http_response flag is passed to ExecutorGitLabHttpClient, and has the following fields

headers: _containers.ScalarMap[str, str]
statusCode: int
body: str
error: str

For all calls to client.aget

  1. pass use_http_response
  2. In the caller, catch if an error is raised (the error is raised when error field is non-empty string indicating http request could not be completed
  3. In the caller, assert/handle status code.

Further details

Links / references

Edited by Halil Coban