Skip to content

Commit 9c092c5

Browse files
authored
feat: add GET negotiations/:consumerPid endpoint to negotiation binding (#105)
* feat: add GET negotiations/:consumerPid endpoint to negotiation binding * chore: address review comments * chore: address review comments
1 parent 5e193b5 commit 9c092c5

File tree

1 file changed

+41
-10
lines changed

1 file changed

+41
-10
lines changed

specifications/negotiation/contract.negotiation.binding.https.md

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ authorization.
4343

4444
| Endpoint | Method | Description |
4545
|:----------------------------------------------------------------------|:-------|:------------------------------------------------------------|
46-
| https://provider.com/negotiations/:providerPid | `GET` | [[[#negotiations-get]]] |
46+
| https://provider.com/negotiations/:providerPid | `GET` | [[[#negotiations-get-provider]]] |
4747
| https://provider.com/negotiations/request | `POST` | [[[#negotiations-request-post]]] |
4848
| https://provider.com/negotiations/:providerPid/request | `POST` | [[[#negotiations-providerpid-request-post]]] |
4949
| https://provider.com/negotiations/:providerPid/events | `POST` | [[[#negotiations-providerpid-events-post]]] |
@@ -52,11 +52,11 @@ authorization.
5252

5353
### The `negotiations` Endpoint _(Provider-side)_
5454

55-
#### GET {#negotiations-get}
55+
#### GET {#negotiations-get-provider}
5656

5757
##### Request
5858

59-
A CN can be accessed by a [=Consumer=] or [=Provider=] sending a GET request to `negotiations/:providerPid`:
59+
A CN can be accessed by a [=Consumer=] sending a GET request to `negotiations/:providerPid`:
6060

6161
<aside class="example" title="Get Negotiation Request">
6262
<pre class="http">GET https://provider.com/negotiations/:providerPid
@@ -208,13 +208,14 @@ not specified and clients are not required to process it.
208208

209209
## Consumer Callback Path Bindings
210210

211-
| Endpoint | Method | Description |
212-
|:---------------------------------------------------------------------|:-------|:-----------------------------------------------|
213-
| https://consumer.com/negotiations/offers | `POST` | [[[#negotiations-offers-post]]] |
214-
| https://consumer.com/:callback/negotiations/:consumerPid/offers | `POST` | [[[#negotiations-consumerpid-offers-post]]] |
215-
| https://consumer.com/:callback/negotiations/:consumerPid/agreement | `POST` | [[[#negotiations-consumerpid-agreement-post]]] |
216-
| https://consumer.com/:callback/negotiations/:consumerPid/events | `POST` | [[[#negotiations-consumerpid-events-post]]] |
217-
| https://consumer.com/:callback/negotiations/:consumerPid/termination | `POST` | [[[#negotiations-consumerpid-termination-post]]] |
211+
| Endpoint | Method | Description |
212+
|:---------------------------------------------------------------------|:-------|:-------------------------------------------------|
213+
| https://consumer.com/negotiations/offers | `POST` | [[[#negotiations-offers-post]]] |
214+
| https://consumer.com/:callback/negotiations/:consumerPid | `GET` | [[[#negotiations-get-consumer]]] |
215+
| https://consumer.com/:callback/negotiations/:consumerPid/offers | `POST` | [[[#negotiations-consumerpid-offers-post]]] |
216+
| https://consumer.com/:callback/negotiations/:consumerPid/agreement | `POST` | [[[#negotiations-consumerpid-agreement-post]]] |
217+
| https://consumer.com/:callback/negotiations/:consumerPid/events | `POST` | [[[#negotiations-consumerpid-events-post]]] |
218+
| https://consumer.com/:callback/negotiations/:consumerPid/termination | `POST` | [[[#negotiations-consumerpid-termination-post]]] |
218219

219220
**_Note:_** The `:callback` can be chosen freely by the implementations.
220221

@@ -225,6 +226,36 @@ the [Contract Request Message](#contract-request-message) that initiated a CN. F
225226
specified as `https://consumer.com/callback` and a callback path binding is `negotiations/:consumerPid/offers`, the
226227
resolved URL will be `https://consumer.com/callback/negotiations/:consumerPid/offers`.
227228

229+
### The `negotiations` Endpoint _(Consumer-side)_
230+
231+
#### GET {#negotiations-get-consumer}
232+
233+
##### Request
234+
235+
A CN can be accessed by a [=Provider=] sending a GET request to the `negotiations/:consumerPid` callback:
236+
237+
<aside class="example" title="Get Negotiation Request">
238+
<pre class="http">GET https://consumer.com/:callback/negotiations/:consumerPid
239+
Authorization: ...</pre>
240+
241+
</aside>
242+
243+
244+
##### Response
245+
246+
If the CN is found and the client is authorized, the [=Consumer=] must return an HTTP 200 (OK) response and a body
247+
containing the [Contract Negotiation](#ack-contract-negotiation):
248+
249+
<aside class="example" title="Contract Negotiation Response">
250+
<pre class="json" data-include="message/example/contract-negotiation.json">
251+
</pre>
252+
</aside>
253+
254+
255+
256+
Predefined states are: `REQUESTED`, `OFFERED`, `ACCEPTED`, `AGREED`, `VERIFIED`, `FINALIZED`, and `TERMINATED` (
257+
see [[[#contract-negotiation-states]]]).
258+
228259
### The `negotiations/offers` Endpoint _(Consumer-side)_
229260

230261
#### POST {#negotiations-offers-post}

0 commit comments

Comments
 (0)