worker/api: remove token in favor of callback URLs

Instead of sending a `token` to workers, send back to URLs:

 1. "location": URL at which the job can be inspected (GET) and updated
    (PATCH).
 2. "artifact_location": URL at which artifacts should be uploaded to.

The actual URLs remain the same, but a client does not need to stitch
them together manually (except appending the artifact's name).

Unfortunately, the client code generated by `deepmap` does not lend
itself to this style of APIs. Use standard http.Client again, which is a
partial revert of 0962fbd30.
This commit is contained in:
Lars Karlitski 2020-09-08 17:00:18 +02:00 committed by Tom Gundersen
parent 901d724622
commit b03e1254e9
8 changed files with 166 additions and 813 deletions

View file

@ -68,7 +68,7 @@ func TestCreate(t *testing.T) {
require.NoError(t, err)
test.TestRoute(t, server, false, "POST", "/jobs", `{}`, http.StatusCreated,
`{"manifest":{"sources":{},"pipeline":{}}}`, "token", "created")
`{"manifest":{"sources":{},"pipeline":{}}}`, "location", "artifact_location", "created")
}
func TestCancel(t *testing.T) {