From d58a9ff0bec98d48825ed98325d45d316e17c834 Mon Sep 17 00:00:00 2001 From: Michael Steinert <133106264+MichaelSteinert@users.noreply.github.com> Date: Wed, 28 Jun 2023 09:44:01 +0200 Subject: [PATCH] Add termiantion endpoint for consumer and improve text (#112) * feat: added termination endpoint for consumer * fix: semantic separation of http codes * fix: add line break * Update contract.negotiation.binding.https.md Revert changes --- .../contract.negotiation.binding.https.md | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/negotiation/contract.negotiation.binding.https.md b/negotiation/contract.negotiation.binding.https.md index da872029..4a409d3a 100644 --- a/negotiation/contract.negotiation.binding.https.md +++ b/negotiation/contract.negotiation.binding.https.md @@ -17,7 +17,7 @@ The OpenAPI definitions for this specification can be accessed [here](TBD). ### 2.2 Contract Negotiation Error -In the event of a client request error, the connector must return an appropriate HTTP 4xxx client error code. If an error body is returned it must be +In the event of a client request error, the connector must return an appropriate HTTP 4xx client error code. If an error body is returned it must be a [ContractNegotiationError](./message/contract-negotiation-error.json) with the following properties: | Field | Type | Description | @@ -52,7 +52,7 @@ the [ContractNegotiation](./message/contract-negotiation.json): ``` { - "@context": "https://w3id.org/dspace/v0.8/context.json", + "@context": "https://w3id.org/dspace/v0.8/context.json", "@type": "dspace:ContractNegotiation" "@id": "urn:uuid:dcbf434c-eacf-4582-9a02-f8dd50120fd3", "dspace:state" :"REQUESTED" @@ -76,12 +76,12 @@ POST https://connector.provider.com/negotiations/request Authorization: ... { - "@context": "https://w3id.org/dspace/v0.8/context.json", + "@context": "https://w3id.org/dspace/v0.8/context.json", "@type": "dspace:ContractRequest" "@id": "urn:uuid:dcbf434c-eacf-4582-9a02-f8dd50120fd3", "dspace:dataSet": "urn:uuid:3dd1add8-4d2d-569e-d634-8394a8836a88", "dspace:offerId": "urn:uuid:2828282:3dd1add8-4d2d-569e-d634-8394a8836a88", - "dspace:callbackAddress": "https://......" + "dspace:callbackAddress": "https://..." } ``` @@ -100,7 +100,7 @@ the [ContractNegotiation](./message/contract-negotiation.json) message: Location: /negotiations/urn:uuid:dcbf434c-eacf-4582-9a02-f8dd50120fd3 { - "@context": "https://w3id.org/dspace/v0.8/context.json", + "@context": "https://w3id.org/dspace/v0.8/context.json", "@type": "dspace:ContractNegotiation" "@id": "urn:uuid:dcbf434c-eacf-4582-9a02-f8dd50120fd3", "dspace:state" :"REQUESTED" @@ -121,7 +121,7 @@ POST https://connector.provider.com/negotiations/urn:uuid:dcbf434c-eacf-4582-9a0 Authorization: ... { - "@context": "https://w3id.org/dspace/v0.8/context.jsonn", + "@context": "https://w3id.org/dspace/v0.8/context.jsonn", "@type": "dspace:ContractRequestMessage", "dspace:processId": "urn:uuid:dcbf434c-eacf-4582-9a02-f8dd50120fd3", "dspace:offer": { @@ -160,12 +160,12 @@ POST https://connector.provider.com/negotiations/urn:uuid:a343fcbf-99fc-4ce8-8e9 Authorization: ... { - "@context": "https://w3id.org/dspace/v0.8/context.json", + "@context": "https://w3id.org/dspace/v0.8/context.json", "@type": "dspace:ContractAgreementVerificationMessage", "dspace:processId": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab", "dspace:consumerSignature": { "timestamp": 121212, - "hash": "....", + "hash": "...", "signature": "" } } @@ -199,7 +199,7 @@ POST https://connector.consumer.com/callback/negotiations/urn:uuid:dcbf434c-eacf Authorization: ... { - "@context": "https://w3id.org/dspace/v0.8/context.json", + "@context": "https://w3id.org/dspace/v0.8/context.json", "@type": "dspace:ContractOfferMessage", "dspace:processId": "urn:uuid:dcbf434c-eacf-4582-9a02-f8dd50120fd3", "dspace:offer": { @@ -226,7 +226,7 @@ POST https://connector.consumer.com/negotiations/urn:uuid:a343fcbf-99fc-4ce8-8e9 Authorization: ... { - "@context": "https://w3id.org/dspace/v0.8/context.json", + "@context": "https://w3id.org/dspace/v0.8/context.json", "@type": "dspace:ContractAgreementMessage", "dspace:processId": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab", "dspace:agreement": { @@ -244,7 +244,12 @@ Authorization: ... #### 3.4.1 POST A provider can POST a [ContractNegotiationEventMessage](./message/contract-negotiation-event-message.json) to the `negotiations/:id/events` callback with an `eventType` -of `finalized` to finalize a contract agreement. If the negotiation state is successfully transitioned, the consumer must return HTTP code 200 (OK). The response body is not +of `FINALIZED` to finalize a contract agreement. If the negotiation state is successfully transitioned, the consumer must return HTTP code 200 (OK). The response body is not specified and clients are not required to process it. +### 3.5 The consumer `negotiations/:id/termination` resource +#### 3.5.1 POST + +The provider connector can POST a [ContractNegotiationTerminationMessage](./message/contract-negotiation-termination-message.json) to terminate a negotiation. If the negotiation +state is successfully transitioned, the consumer must return HTTP code 200 (OK). The response body is not specified and clients are not required to process it.