Skip to content

Commit

Permalink
Document callback headers (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
bergundy authored Mar 20, 2024
1 parent 21e6966 commit a1ef391
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ The response of the operation may be delivered synchronously (inline), or asynch
- `callback`: Optional. If the operation is asynchronous, the handler should invoke this URL once the operation's
result is available.

#### Request Headers

A client may attach arbitrary headers to the request.

Headers that start with the `Nexus-Callback-` prefix are expected to be attached to the callback request when invoked by
the handler. The callback request must strip away the `Nexus-Callback-` prefix. E.g if a Start Operation request
includes a `Nexus-Callback-Token: some-token` header, the callback request would include a `Token: some-token` header.

#### Request Body

The body may contain arbitrary data. Headers should specify content type and encoding.
Expand Down Expand Up @@ -275,6 +283,8 @@ Callers should ensure URLs contain sufficient information to correlate completio
For invoking a callback URL:

- Issue a POST request to the caller-provided URL.
- Include any callback headers supplied in the originating StartOperation request, stripping away the `Nexus-Callback-`
prefix.
- Include the `Nexus-Operation-State` header.
- If state is `succeeded`, deliver non-empty results in the body with corresponding `Content-*` headers.
- If state is `failed` or `canceled`, content type should be `application/json` and the body must have a serialized
Expand Down

0 comments on commit a1ef391

Please sign in to comment.