diff --git a/.github/workflows/_typos.toml b/.github/workflows/_typos.toml new file mode 100644 index 0000000..ca2f31a --- /dev/null +++ b/.github/workflows/_typos.toml @@ -0,0 +1,18 @@ +# Configuration for typos spell checker +# See: https://github.com/crate-ci/typos + +[default] +# Ensure we check binary file names +binary = false + + +[default.extend-words] +# Add custom dictionary entries here for intentional "misspellings" used in the codebase +# Common Go/Nexus specific terms that may be flagged as typos +cancelation = "cancelation" # Common alternate spelling of cancellation used in the spec + +[files] +extend-exclude = [ + "*.svg", +] + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed91b3c..cf36d5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,3 +16,11 @@ jobs: steps: - uses: actions/checkout@v3 - uses: dprint/check@v2.2 + + typos: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: crate-ci/typos@v1 + with: + config: ./.github/workflows/_typos.toml diff --git a/SPEC.md b/SPEC.md index 5f50096..8d8cacf 100644 --- a/SPEC.md +++ b/SPEC.md @@ -6,7 +6,7 @@ The Nexus protocol, as specified below, is a synchronous RPC protocol for system duration operations are modelled on top of a set of pre-defined synchronous RPCs. A Nexus **caller** calls a **handler**. The handler may respond inline (synchronous response) or return a token -referencing the ongoing operation (asynchronous response), which the the caller use to cancel the operation. In lieu of +referencing the ongoing operation (asynchronous response), which the caller may use to cancel the operation. In lieu of a higher level service contract, the caller cannot determine whether an operation is going to resolve synchronously or asynchronously, and should specify a callback URL, which the handler uses to deliver the result of an asynchronous operation when it is ready. @@ -111,6 +111,10 @@ Headers that start with the `Nexus-Callback-` prefix are expected to be attached 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. +If a callback query parameter is provided, the `Nexus-Callback-Token` header is **OPTIONAL**. It MAY contain a +caller-generated token that is used to recreate context when processing the callback. Handlers MUST include this +header’s value as a `Token` header when invoking Callback requests. + The `Operation-Timeout` header field can be added to inform the handler how long the caller is willing to wait for an operation to complete. This is distinct from the more general `Request-Timeout` header which is used to indicate the timeout for a single HTTP request. Format of this header value is number + unit, where unit can be `ms` for @@ -156,7 +160,7 @@ The body may contain arbitrary data. Headers should specify content type and enc ### Cancel Operation Request to cancel an operation. The operation may later complete as canceled or any other outcome. Handlers should -ignore multiple cancelations of the same operation and return successfully if cancelation was already requested. +ignore multiple cancellations of the same operation and return successfully if cancellation was already requested. **Path**: `/{service}/{operation}/cancel` @@ -197,7 +201,7 @@ Operation Error [`Failure`](#failure) representation is as follows: "cause": { /* */ }, "details": { "state": "canceled | failed", - // Aribtrary details may be added here as needed. + // Arbitrary details may be added here as needed. }, } ``` @@ -221,33 +225,33 @@ Handler Error [`Failure`](#failure) representation is as follows: "details": { "type": "