@twin.org/dataspace-control-plane-service 0.0.3-next.15 → 0.0.3-next.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/changelog.md +14 -0
- package/package.json +2 -2
- package/docs/API.md +0 -341
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.16](https://github.com/twinfoundation/dataspace/compare/dataspace-control-plane-service-v0.0.3-next.15...dataspace-control-plane-service-v0.0.3-next.16) (2026-03-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* docs and component init ([8557233](https://github.com/twinfoundation/dataspace/commit/8557233fb3b8273c5c9a5b580fb43061f8efe47c))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/dataspace-models bumped from 0.0.3-next.15 to 0.0.3-next.16
|
|
16
|
+
|
|
3
17
|
## [0.0.3-next.15](https://github.com/twinfoundation/dataspace/compare/dataspace-control-plane-service-v0.0.3-next.14...dataspace-control-plane-service-v0.0.3-next.15) (2026-03-02)
|
|
4
18
|
|
|
5
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/dataspace-control-plane-service",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.16",
|
|
4
4
|
"description": "Dataspace Control Plane service implementation for Eclipse Dataspace Protocol Transfer Process Protocol",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@twin.org/api-models": "next",
|
|
18
18
|
"@twin.org/context": "next",
|
|
19
19
|
"@twin.org/core": "next",
|
|
20
|
-
"@twin.org/dataspace-models": "0.0.3-next.
|
|
20
|
+
"@twin.org/dataspace-models": "0.0.3-next.16",
|
|
21
21
|
"@twin.org/entity": "next",
|
|
22
22
|
"@twin.org/entity-storage-models": "next",
|
|
23
23
|
"@twin.org/federated-catalogue-models": "next",
|
package/docs/API.md
DELETED
|
@@ -1,341 +0,0 @@
|
|
|
1
|
-
# Dataspace Control Plane API Documentation
|
|
2
|
-
|
|
3
|
-
REST API endpoints for the Eclipse Dataspace Protocol (DSP) Contract Negotiation and Transfer Process protocols.
|
|
4
|
-
|
|
5
|
-
## Table of Contents
|
|
6
|
-
|
|
7
|
-
- [Authentication](#authentication)
|
|
8
|
-
- [Contract Negotiation Protocol](#contract-negotiation-protocol)
|
|
9
|
-
- [POST /negotiations](#post-negotiations)
|
|
10
|
-
- [GET /negotiations/:negotiationId](#get-negotiationsnegotiationid)
|
|
11
|
-
- [Transfer Process Protocol](#transfer-process-protocol)
|
|
12
|
-
- [POST /transfers/request](#post-transfersrequest)
|
|
13
|
-
- [GET /transfers/:pid](#get-transferspid)
|
|
14
|
-
- [POST /transfers/:pid/start](#post-transferspidstart)
|
|
15
|
-
- [POST /transfers/:pid/complete](#post-transferspidcomplete)
|
|
16
|
-
- [POST /transfers/:pid/suspend](#post-transferspidsuspend)
|
|
17
|
-
- [POST /transfers/:pid/terminate](#post-transferspidterminate)
|
|
18
|
-
- [Error Handling](#error-handling)
|
|
19
|
-
|
|
20
|
-
## Authentication
|
|
21
|
-
|
|
22
|
-
All API endpoints require authentication via Bearer token in the `Authorization` header:
|
|
23
|
-
|
|
24
|
-
```http
|
|
25
|
-
Authorization: Bearer <trust-token>
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Contract Negotiation Protocol
|
|
29
|
-
|
|
30
|
-
Implements the DSP Contract Negotiation Protocol for negotiating agreements with data providers.
|
|
31
|
-
|
|
32
|
-
**Base Path:** `/control-plane/negotiations`
|
|
33
|
-
|
|
34
|
-
**Specification:** [Eclipse DSP 2025-1 - Contract Negotiation](https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/2025-1/#negotiation-protocol)
|
|
35
|
-
|
|
36
|
-
### POST /negotiations
|
|
37
|
-
|
|
38
|
-
Initiate a contract negotiation with a provider.
|
|
39
|
-
|
|
40
|
-
**Request:**
|
|
41
|
-
|
|
42
|
-
```http
|
|
43
|
-
POST /control-plane/negotiations
|
|
44
|
-
Authorization: Bearer <trust-token>
|
|
45
|
-
Content-Type: application/json
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
"offerId": "offer-123",
|
|
49
|
-
"providerEndpoint": "https://provider.example.com/negotiations",
|
|
50
|
-
"publicOrigin": "https://consumer.example.com" // Optional
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
**Request Body:**
|
|
55
|
-
|
|
56
|
-
| Field | Type | Required | Description |
|
|
57
|
-
| ------------------ | ------ | -------- | ----------------------------------------------------------------------------------- |
|
|
58
|
-
| `offerId` | string | Yes | The offer ID from the provider's catalog |
|
|
59
|
-
| `providerEndpoint` | string | Yes | The provider's contract negotiation endpoint URL |
|
|
60
|
-
| `publicOrigin` | string | No | The public origin URL for callbacks (defaults to hosting component's public origin) |
|
|
61
|
-
|
|
62
|
-
**Response (200 OK):**
|
|
63
|
-
|
|
64
|
-
```json
|
|
65
|
-
{
|
|
66
|
-
"agreement": {
|
|
67
|
-
"@context": "http://www.w3.org/ns/odrl.jsonld",
|
|
68
|
-
"@type": "Agreement",
|
|
69
|
-
"uid": "agreement-456",
|
|
70
|
-
"assigner": "did:iota:provider-xyz",
|
|
71
|
-
"assignee": "did:iota:consumer-abc",
|
|
72
|
-
"target": "urn:uuid:dataset-789",
|
|
73
|
-
"permission": [{ "action": "read" }]
|
|
74
|
-
},
|
|
75
|
-
"agreementId": "agreement-456",
|
|
76
|
-
"negotiationId": "negotiation-123",
|
|
77
|
-
"consumerPid": "consumer-pid-123",
|
|
78
|
-
"providerPid": "provider-pid-456"
|
|
79
|
-
}
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
**Response Body:**
|
|
83
|
-
|
|
84
|
-
| Field | Type | Description |
|
|
85
|
-
| --------------- | ----------- | ---------------------------------------- |
|
|
86
|
-
| `agreement` | IOdrlPolicy | The negotiated ODRL agreement |
|
|
87
|
-
| `agreementId` | string | The unique identifier of the agreement |
|
|
88
|
-
| `negotiationId` | string | The unique identifier of the negotiation |
|
|
89
|
-
| `consumerPid` | string | The consumer process ID |
|
|
90
|
-
| `providerPid` | string | The provider process ID |
|
|
91
|
-
|
|
92
|
-
**Error Responses:**
|
|
93
|
-
|
|
94
|
-
| Status Code | Description |
|
|
95
|
-
| ----------- | --------------------------------------------- |
|
|
96
|
-
| 400 | Invalid request (missing required fields) |
|
|
97
|
-
| 401 | Unauthorized (invalid or missing trust token) |
|
|
98
|
-
| 404 | Offer not found |
|
|
99
|
-
| 500 | Internal server error during negotiation |
|
|
100
|
-
| 504 | Negotiation timeout |
|
|
101
|
-
|
|
102
|
-
**Example:**
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
curl -X POST https://consumer.example.com/control-plane/negotiations \
|
|
106
|
-
-H "Authorization: Bearer ${TOKEN}" \
|
|
107
|
-
-H "Content-Type: application/json" \
|
|
108
|
-
-d '{
|
|
109
|
-
"offerId": "offer-from-catalog",
|
|
110
|
-
"providerEndpoint": "https://provider.example.com/negotiations"
|
|
111
|
-
}'
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### GET /negotiations/:negotiationId {#get-negotiationsnegotiationid}
|
|
115
|
-
|
|
116
|
-
Get the current state of a contract negotiation.
|
|
117
|
-
|
|
118
|
-
**Request:**
|
|
119
|
-
|
|
120
|
-
```http
|
|
121
|
-
GET /control-plane/negotiations/{negotiationId}
|
|
122
|
-
Authorization: Bearer <trust-token>
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
**Path Parameters:**
|
|
126
|
-
|
|
127
|
-
| Parameter | Type | Description |
|
|
128
|
-
| --------------- | ------ | ---------------------------------------- |
|
|
129
|
-
| `negotiationId` | string | The unique identifier of the negotiation |
|
|
130
|
-
|
|
131
|
-
**Response (200 OK):**
|
|
132
|
-
|
|
133
|
-
```json
|
|
134
|
-
{
|
|
135
|
-
"negotiationId": "negotiation-123",
|
|
136
|
-
"state": "FINALIZED",
|
|
137
|
-
"consumerPid": "consumer-pid-123",
|
|
138
|
-
"providerPid": "provider-pid-456",
|
|
139
|
-
"agreementId": "agreement-456"
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
**Response Body:**
|
|
144
|
-
|
|
145
|
-
| Field | Type | Description |
|
|
146
|
-
| --------------- | ------ | --------------------------------------------------------------------------------------- |
|
|
147
|
-
| `negotiationId` | string | The unique identifier of the negotiation |
|
|
148
|
-
| `state` | string | Current negotiation state (REQUESTED, OFFERED, AGREED, VERIFIED, FINALIZED, TERMINATED) |
|
|
149
|
-
| `consumerPid` | string | The consumer process ID |
|
|
150
|
-
| `providerPid` | string | The provider process ID |
|
|
151
|
-
| `agreementId` | string | The agreement ID (only present if state is FINALIZED) |
|
|
152
|
-
| `errorDetail` | string | Error details (only present if state is TERMINATED) |
|
|
153
|
-
|
|
154
|
-
**Negotiation States:**
|
|
155
|
-
|
|
156
|
-
| State | Description |
|
|
157
|
-
| ------------ | --------------------------------------------- |
|
|
158
|
-
| `REQUESTED` | Initial request sent to provider |
|
|
159
|
-
| `OFFERED` | Provider sent counter-offer |
|
|
160
|
-
| `AGREED` | Agreement reached |
|
|
161
|
-
| `VERIFIED` | Agreement verified |
|
|
162
|
-
| `FINALIZED` | Negotiation complete, agreement ready for use |
|
|
163
|
-
| `TERMINATED` | Negotiation failed or was cancelled |
|
|
164
|
-
|
|
165
|
-
**Error Responses:**
|
|
166
|
-
|
|
167
|
-
| Status Code | Description |
|
|
168
|
-
| ----------- | --------------------------------------------- |
|
|
169
|
-
| 401 | Unauthorized (invalid or missing trust token) |
|
|
170
|
-
| 404 | Negotiation not found |
|
|
171
|
-
| 500 | Internal server error |
|
|
172
|
-
|
|
173
|
-
**Example:**
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
curl -X GET https://consumer.example.com/control-plane/negotiations/negotiation-123 \
|
|
177
|
-
-H "Authorization: Bearer ${TOKEN}"
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
## Transfer Process Protocol
|
|
181
|
-
|
|
182
|
-
Implements the DSP Transfer Process Protocol for managing data transfers.
|
|
183
|
-
|
|
184
|
-
**Base Path:** `/control-plane/transfers`
|
|
185
|
-
|
|
186
|
-
**Specification:** [Eclipse DSP 2025-1 - Transfer Process](https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/2025-1/#transfer-process-protocol)
|
|
187
|
-
|
|
188
|
-
### POST /transfers/request
|
|
189
|
-
|
|
190
|
-
Initiate a transfer request using a previously negotiated agreement.
|
|
191
|
-
|
|
192
|
-
**Request:**
|
|
193
|
-
|
|
194
|
-
```http
|
|
195
|
-
POST /control-plane/transfers/request
|
|
196
|
-
Authorization: Bearer <trust-token>
|
|
197
|
-
Content-Type: application/json
|
|
198
|
-
|
|
199
|
-
{
|
|
200
|
-
"@context": ["https://w3id.org/dspace/2025/1/context.jsonld"],
|
|
201
|
-
"@type": "TransferRequestMessage",
|
|
202
|
-
"consumerPid": "consumer-pid-123",
|
|
203
|
-
"agreementId": "agreement-456",
|
|
204
|
-
"callbackAddress": "https://consumer.example.com/callbacks",
|
|
205
|
-
"format": "application/json"
|
|
206
|
-
}
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
_See [Eclipse DSP Transfer Request specification](https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/2025-1/#transfer-process-protocol) for complete request schema._
|
|
210
|
-
|
|
211
|
-
### GET /transfers/:pid {#get-transferspid}
|
|
212
|
-
|
|
213
|
-
Get the current state of a transfer process.
|
|
214
|
-
|
|
215
|
-
**Request:**
|
|
216
|
-
|
|
217
|
-
```http
|
|
218
|
-
GET /control-plane/transfers/{pid}
|
|
219
|
-
Authorization: Bearer <trust-token>
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
_Returns the DSP TransferProcess object with current state and metadata._
|
|
223
|
-
|
|
224
|
-
### POST /transfers/:pid/start {#post-transferspidstart}
|
|
225
|
-
|
|
226
|
-
Start an approved transfer.
|
|
227
|
-
|
|
228
|
-
### POST /transfers/:pid/complete {#post-transferspidcomplete}
|
|
229
|
-
|
|
230
|
-
Mark a transfer as complete.
|
|
231
|
-
|
|
232
|
-
### POST /transfers/:pid/suspend {#post-transferspidsuspend}
|
|
233
|
-
|
|
234
|
-
Suspend a running transfer.
|
|
235
|
-
|
|
236
|
-
### POST /transfers/:pid/terminate {#post-transferspidterminate}
|
|
237
|
-
|
|
238
|
-
Terminate a transfer.
|
|
239
|
-
|
|
240
|
-
_See the main [README.md](../README.md) and [DSP specification](https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/2025-1/) for detailed Transfer Process Protocol documentation._
|
|
241
|
-
|
|
242
|
-
## Error Handling
|
|
243
|
-
|
|
244
|
-
All endpoints return errors in the DSP error format when applicable:
|
|
245
|
-
|
|
246
|
-
**Contract Negotiation Error:**
|
|
247
|
-
|
|
248
|
-
```json
|
|
249
|
-
{
|
|
250
|
-
"@context": ["https://w3id.org/dspace/2025/1/context.jsonld"],
|
|
251
|
-
"@type": "dspace:ContractNegotiationError",
|
|
252
|
-
"providerPid": "provider-pid-456",
|
|
253
|
-
"consumerPid": "consumer-pid-123",
|
|
254
|
-
"code": "ErrorCode:description",
|
|
255
|
-
"reason": [{ "message": "Human-readable error message", "language": "en" }]
|
|
256
|
-
}
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
**Transfer Process Error:**
|
|
260
|
-
|
|
261
|
-
```json
|
|
262
|
-
{
|
|
263
|
-
"@context": ["https://w3id.org/dspace/2025/1/context.jsonld"],
|
|
264
|
-
"@type": "dspace:TransferError",
|
|
265
|
-
"providerPid": "provider-pid-456",
|
|
266
|
-
"consumerPid": "consumer-pid-123",
|
|
267
|
-
"code": "ErrorCode:description",
|
|
268
|
-
"reason": [{ "message": "Human-readable error message", "language": "en" }]
|
|
269
|
-
}
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
**HTTP Status Codes:**
|
|
273
|
-
|
|
274
|
-
| Status Code | Description |
|
|
275
|
-
| ----------- | ------------------------------------------------ |
|
|
276
|
-
| 200 | Success |
|
|
277
|
-
| 400 | Bad Request (invalid input) |
|
|
278
|
-
| 401 | Unauthorized (missing or invalid authentication) |
|
|
279
|
-
| 404 | Not Found (resource doesn't exist) |
|
|
280
|
-
| 409 | Conflict (invalid state transition) |
|
|
281
|
-
| 500 | Internal Server Error |
|
|
282
|
-
| 504 | Gateway Timeout (negotiation timeout) |
|
|
283
|
-
|
|
284
|
-
## Full Example Workflow
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
#!/bin/bash
|
|
288
|
-
|
|
289
|
-
# 1. Query provider catalog (not part of Control Plane API)
|
|
290
|
-
CATALOG_RESPONSE=$(curl -X GET https://provider.example.com/catalog \
|
|
291
|
-
-H "Authorization: Bearer ${TOKEN}")
|
|
292
|
-
OFFER_ID=$(echo $CATALOG_RESPONSE | jq -r '.offers[0].uid')
|
|
293
|
-
|
|
294
|
-
# 2. Initiate contract negotiation
|
|
295
|
-
NEGOTIATION_RESPONSE=$(curl -X POST https://consumer.example.com/control-plane/negotiations \
|
|
296
|
-
-H "Authorization: Bearer ${TOKEN}" \
|
|
297
|
-
-H "Content-Type: application/json" \
|
|
298
|
-
-d "{
|
|
299
|
-
\"offerId\": \"${OFFER_ID}\",
|
|
300
|
-
\"providerEndpoint\": \"https://provider.example.com/negotiations\"
|
|
301
|
-
}")
|
|
302
|
-
|
|
303
|
-
AGREEMENT_ID=$(echo $NEGOTIATION_RESPONSE | jq -r '.agreementId')
|
|
304
|
-
NEGOTIATION_ID=$(echo $NEGOTIATION_RESPONSE | jq -r '.negotiationId')
|
|
305
|
-
|
|
306
|
-
echo "Agreement ID: ${AGREEMENT_ID}"
|
|
307
|
-
echo "Negotiation ID: ${NEGOTIATION_ID}"
|
|
308
|
-
|
|
309
|
-
# 3. (Optional) Check negotiation status
|
|
310
|
-
NEGOTIATION_STATUS=$(curl -X GET \
|
|
311
|
-
"https://consumer.example.com/control-plane/negotiations/${NEGOTIATION_ID}" \
|
|
312
|
-
-H "Authorization: Bearer ${TOKEN}")
|
|
313
|
-
|
|
314
|
-
echo "Negotiation Status: $(echo $NEGOTIATION_STATUS | jq -r '.state')"
|
|
315
|
-
|
|
316
|
-
# 4. Request transfer using the agreement
|
|
317
|
-
TRANSFER_RESPONSE=$(curl -X POST https://consumer.example.com/control-plane/transfers/request \
|
|
318
|
-
-H "Authorization: Bearer ${TOKEN}" \
|
|
319
|
-
-H "Content-Type: application/json" \
|
|
320
|
-
-d "{
|
|
321
|
-
\"@context\": [\"https://w3id.org/dspace/2025/1/context.jsonld\"],
|
|
322
|
-
\"@type\": \"TransferRequestMessage\",
|
|
323
|
-
\"consumerPid\": \"my-consumer-pid-001\",
|
|
324
|
-
\"agreementId\": \"${AGREEMENT_ID}\",
|
|
325
|
-
\"callbackAddress\": \"https://consumer.example.com/callbacks\",
|
|
326
|
-
\"format\": \"application/json\"
|
|
327
|
-
}")
|
|
328
|
-
|
|
329
|
-
CONSUMER_PID=$(echo $TRANSFER_RESPONSE | jq -r '.consumerPid')
|
|
330
|
-
echo "Transfer Process ID: ${CONSUMER_PID}"
|
|
331
|
-
|
|
332
|
-
# 5. Get transfer status
|
|
333
|
-
curl -X GET "https://consumer.example.com/control-plane/transfers/${CONSUMER_PID}" \
|
|
334
|
-
-H "Authorization: Bearer ${TOKEN}"
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
## See Also
|
|
338
|
-
|
|
339
|
-
- [Eclipse Dataspace Protocol Specification](https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/2025-1/)
|
|
340
|
-
- [ODRL (Open Digital Rights Language)](https://www.w3.org/TR/odrl-model/)
|
|
341
|
-
- [Rights Management Contract Negotiation Documentation](../../../../.cursor/docs/dataspace-connector/contract-negotiation/README.md)
|