kikocis/EonaX-Shared-Resources public
Changesets · Branches · Tags · Compare
| Changeset | 523c3129357e0eb3216f7eb09ab323928fbfd17c87bb7db95d9b29fd151f941f |
|---|---|
| Author | Benjamin Scholtes <88310985+bscholtes1A@users.noreply.github.com> · 2024-10-17 10:18 +02:00 |
| Committer | Benjamin SCHOLTES <benjamin.scholtes@amadeus.com> · 2024-10-17 10:20 +02:00 |
| Parents | 2ccb16e36050, 5d200b22617d |
2 files changed
added docs/user-manual/platform_overview.png +0 −0
Binary content is not shown. View the file.
added docs/user-manual/readme.md +704 −0
| @@ -0,0 +1,704 @@ | ||
| 1 | +# Eona-X Connector - User Manual | |
| 2 | + | |
| 3 | +## Eona-X platform overview | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | +## Prerequisites | |
| 8 | + | |
| 9 | +In order to complete this guide, you will need few infos that will be provided by Amadeus: | |
| 10 | + | |
| 11 | +- the base url for targeting your respective connector, referred as `<CONNECTOR_URL>` hereafter, | |
| 12 | +- the base url for targeting the federated catalog, referred as `<CATALOG_URL>` hereafter, | |
| 13 | +- a token for authenticating to your respective connector APIs | |
| 14 | +- a token for authenticating to the dataspace federated catalog | |
| 15 | + | |
| 16 | +## Steps for a participant to create a new dataset | |
| 17 | + | |
| 18 | +All queries detailed in this section are based on the Swagger specification of the Management API of the EDC connector. | |
| 19 | + | |
| 20 | +They require a `x-api-key` header in input containing the token provided by Amadeus to interact with your connector. | |
| 21 | + | |
| 22 | +### Create dataset | |
| 23 | + | |
| 24 | +#### Url | |
| 25 | + | |
| 26 | +```bash | |
| 27 | +<CONNECTOR_URL>/cp/mgmt/v3/assets (POST) | |
| 28 | +``` | |
| 29 | + | |
| 30 | +#### Request body for a REST API with an API key stored in the connector Vault: | |
| 31 | + | |
| 32 | +```json | |
| 33 | +{ | |
| 34 | + "@context": { | |
| 35 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/" | |
| 36 | + }, | |
| 37 | + "@id": "my-asset-id", | |
| 38 | + "properties": { | |
| 39 | + "name": "Test Asset", | |
| 40 | + "description": "A fancy test asset", | |
| 41 | + "contenttype": "application/json", | |
| 42 | + "version": "1.0" | |
| 43 | + }, | |
| 44 | + "dataAddress": { | |
| 45 | + "type": "HttpData", | |
| 46 | + "baseUrl": "https://your-api-url.com", | |
| 47 | + "authKey": "Authorization", | |
| 48 | + // alias of the Vault entry containing the access token | |
| 49 | + "secretName": "my-secret" | |
| 50 | + } | |
| 51 | +} | |
| 52 | +``` | |
| 53 | + | |
| 54 | +#### Request body for a REST API with API passed as query parameter: | |
| 55 | + | |
| 56 | +```json | |
| 57 | +{ | |
| 58 | + "@context": { | |
| 59 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/" | |
| 60 | + }, | |
| 61 | + "@id": "my-asset-id", | |
| 62 | + "properties": { | |
| 63 | + "name": "Test Asset", | |
| 64 | + "description": "A fancy test asset", | |
| 65 | + "contenttype": "application/json", | |
| 66 | + "version": "1.0" | |
| 67 | + }, | |
| 68 | + "dataAddress": { | |
| 69 | + "type": "HttpData", | |
| 70 | + "baseUrl": "https://your-api-url.com", | |
| 71 | + "queryParams": "projectId=my-project-id&authKey=my-token" | |
| 72 | + } | |
| 73 | +} | |
| 74 | +``` | |
| 75 | + | |
| 76 | +#### Request body for a REST API with an Oauth2 authentication and private key stored in the connector Vault: | |
| 77 | + | |
| 78 | +```json | |
| 79 | +{ | |
| 80 | + "@context": { | |
| 81 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/" | |
| 82 | + }, | |
| 83 | + "@id": "my-asset-id", | |
| 84 | + "properties": { | |
| 85 | + "name": "Test Asset", | |
| 86 | + "description": "A fancy test asset", | |
| 87 | + "contenttype": "application/json", | |
| 88 | + "version": "1.0" | |
| 89 | + }, | |
| 90 | + "dataAddress": { | |
| 91 | + "type": "HttpData", | |
| 92 | + "baseUrl": "https://your-api-url.com", | |
| 93 | + "oauth2:clientId": "your-client-id", | |
| 94 | + "oauth2:tokenUrl": "http://your-oauth2-server/token", | |
| 95 | + "oauth2:privateKeyName": "private-key-alias" | |
| 96 | + } | |
| 97 | +} | |
| 98 | +``` | |
| 99 | + | |
| 100 | +It is worth mentioning that the structure of the request to create a new dataset is composed of two sections: | |
| 101 | + | |
| 102 | +- the properties which are the public metadata of the dataset and are displayed in the catalog | |
| 103 | +- the dataAddress which contains the information (e.g. url, token…) used by the provider connector to fetch the data | |
| 104 | + from the data source → the data address is private and thus is not readable by the other participants! | |
| 105 | + | |
| 106 | +#### Response | |
| 107 | + | |
| 108 | +If the request is successful, then a code 200 will be returned along with a body containing the id of the dataset: | |
| 109 | + | |
| 110 | +```json | |
| 111 | +{ | |
| 112 | + "@type": "IdResponse", | |
| 113 | + "@id": "hello-eonax", | |
| 114 | + "createdAt": 1703167675052, | |
| 115 | + "@context": { | |
| 116 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/", | |
| 117 | + "edc": "https://w3id.org/edc/v0.0.1/ns/", | |
| 118 | + "eonax": "https://w3id.org/eonax/v0.0.1/ns/", | |
| 119 | + "odrl": "http://www.w3.org/ns/odrl/2/" | |
| 120 | + } | |
| 121 | +} | |
| 122 | +``` | |
| 123 | + | |
| 124 | +### Create secret | |
| 125 | + | |
| 126 | +If the dataset defined at the previous steps includes a secret within its data address (see secretName and oauth2: | |
| 127 | +privateKeyName in the examples above), then you need to add the corresponding secret within the connector Vault. | |
| 128 | + | |
| 129 | +#### Url | |
| 130 | + | |
| 131 | +```bash | |
| 132 | +<CONNECTOR_URL>/cp/mgmt/v3/secrets (POST) | |
| 133 | +``` | |
| 134 | + | |
| 135 | +#### Request body | |
| 136 | + | |
| 137 | +```json | |
| 138 | +{ | |
| 139 | + "@context": { | |
| 140 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/" | |
| 141 | + }, | |
| 142 | + "@type": "Secret", | |
| 143 | + "@id": "my-secret", | |
| 144 | + "value": "e47bc29c-4839-40e7-967f-46968f83c36d" | |
| 145 | +} | |
| 146 | +``` | |
| 147 | + | |
| 148 | +#### Response | |
| 149 | + | |
| 150 | +If the request is successful, then a code 200 will be returned along with a body containing the id of the secret: | |
| 151 | + | |
| 152 | +```json | |
| 153 | +{ | |
| 154 | + "@type": "IdResponse", | |
| 155 | + "@id": "my-secret", | |
| 156 | + "createdAt": 1703167675052, | |
| 157 | + "@context": { | |
| 158 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/", | |
| 159 | + "edc": "https://w3id.org/edc/v0.0.1/ns/", | |
| 160 | + "eonax": "https://w3id.org/eonax/v0.0.1/ns/", | |
| 161 | + "odrl": "http://www.w3.org/ns/odrl/2/" | |
| 162 | + } | |
| 163 | +} | |
| 164 | +``` | |
| 165 | + | |
| 166 | +### Create policy | |
| 167 | + | |
| 168 | +#### Url | |
| 169 | + | |
| 170 | +```bash | |
| 171 | +<CONNECTOR_URL>/cp/mgmt/v3/policydefinitions (POST) | |
| 172 | +``` | |
| 173 | + | |
| 174 | +#### Request body for policy limiting access to Eona-X participants (i.e. all entities having a `MembershipCredential`) | |
| 175 | + | |
| 176 | +```json | |
| 177 | +{ | |
| 178 | + "@context": { | |
| 179 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/" | |
| 180 | + }, | |
| 181 | + "@id": "eonax-members-only", | |
| 182 | + "@type": "PolicyDefinitionDto", | |
| 183 | + "policy": { | |
| 184 | + "@context": "http://www.w3.org/ns/odrl.jsonld", | |
| 185 | + "@type": "http://www.w3.org/ns/odrl/2/Set", | |
| 186 | + "permission": [ | |
| 187 | + { | |
| 188 | + "action": "use", | |
| 189 | + "constraint": { | |
| 190 | + "@type": "Constraint", | |
| 191 | + "leftOperand": "MembershipCredential", | |
| 192 | + "operator": "odrl:eq", | |
| 193 | + "rightOperand": "active" | |
| 194 | + } | |
| 195 | + } | |
| 196 | + ] | |
| 197 | + } | |
| 198 | +} | |
| 199 | +``` | |
| 200 | + | |
| 201 | +#### Request body for policy limiting access to Eona-X participants and for a period of 365 days after contract signature | |
| 202 | + | |
| 203 | +```json | |
| 204 | +{ | |
| 205 | + "@context": { | |
| 206 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/" | |
| 207 | + }, | |
| 208 | + "@id": "eonax-members-only-365d", | |
| 209 | + "@type": "PolicyDefinitionDto", | |
| 210 | + "policy": { | |
| 211 | + "@context": "http://www.w3.org/ns/odrl.jsonld", | |
| 212 | + "@type": "http://www.w3.org/ns/odrl/2/Set", | |
| 213 | + "permission": [ | |
| 214 | + { | |
| 215 | + "action": "use", | |
| 216 | + "constraint": { | |
| 217 | + "@type": "Constraint", | |
| 218 | + "leftOperand": "MembershipCredential", | |
| 219 | + "operator": "odrl:eq", | |
| 220 | + "rightOperand": "active" | |
| 221 | + } | |
| 222 | + }, | |
| 223 | + { | |
| 224 | + "action": "use", | |
| 225 | + "constraint": { | |
| 226 | + "@type": "Constraint", | |
| 227 | + "leftOperand": "https://w3id.org/edc/v0.0.1/ns/inForceDate", | |
| 228 | + "operator": "lteq", | |
| 229 | + "rightOperand": "contractAgreement+365d" | |
| 230 | + } | |
| 231 | + } | |
| 232 | + ] | |
| 233 | + } | |
| 234 | +} | |
| 235 | +``` | |
| 236 | + | |
| 237 | +Note that the contract validity duration can be expressed in days `d`, hours `h`, minutes `m` or seconds `s`. | |
| 238 | + | |
| 239 | +#### Request body for policy limiting access to participant with id `eonaxtest` and before the 25 déc. 2024. | |
| 240 | + | |
| 241 | +```json | |
| 242 | +{ | |
| 243 | + "@context": { | |
| 244 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/" | |
| 245 | + }, | |
| 246 | + "@id": "eonax-members-only-365d", | |
| 247 | + "@type": "PolicyDefinitionDto", | |
| 248 | + "policy": { | |
| 249 | + "@context": "http://www.w3.org/ns/odrl.jsonld", | |
| 250 | + "@type": "http://www.w3.org/ns/odrl/2/Set", | |
| 251 | + "permission": [ | |
| 252 | + { | |
| 253 | + "action": "use", | |
| 254 | + "constraint": { | |
| 255 | + "@type": "Constraint", | |
| 256 | + "leftOperand": "MembershipCredential", | |
| 257 | + "operator": "odrl:eq", | |
| 258 | + "rightOperand": "active" | |
| 259 | + } | |
| 260 | + }, | |
| 261 | + { | |
| 262 | + "action": "use", | |
| 263 | + "constraint": { | |
| 264 | + "@type": "Constraint", | |
| 265 | + "leftOperand": "https://w3id.org/edc/v0.0.1/ns/inForceDate", | |
| 266 | + "operator": "lteq", | |
| 267 | + "rightOperand": "2024-12-25T00:00:01Z" | |
| 268 | + } | |
| 269 | + }, | |
| 270 | + { | |
| 271 | + "action": "use", | |
| 272 | + "constraint": { | |
| 273 | + "@type": "Constraint", | |
| 274 | + "leftOperand": "GenericClaim.$.name", | |
| 275 | + "operator": "eq", | |
| 276 | + "rightOperand": "eonaxtest" | |
| 277 | + } | |
| 278 | + } | |
| 279 | + ] | |
| 280 | + } | |
| 281 | +} | |
| 282 | +``` | |
| 283 | + | |
| 284 | +The limit contract validity date is expressed in ISO-8061 UTC. Please refer to the appendix section for the known | |
| 285 | +participant ids | |
| 286 | + | |
| 287 | +#### Response | |
| 288 | + | |
| 289 | +If the request is successful, then a code 200 will be returned along with a body containing the id of the policy: | |
| 290 | + | |
| 291 | +```json | |
| 292 | +{ | |
| 293 | + "@type": "IdResponse", | |
| 294 | + "@id": "eonax-members-only", | |
| 295 | + "createdAt": 1703167855896, | |
| 296 | + "@context": { | |
| 297 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/", | |
| 298 | + "edc": "https://w3id.org/edc/v0.0.1/ns/", | |
| 299 | + "eonax": "https://w3id.org/eonax/v0.0.1/ns/", | |
| 300 | + "odrl": "http://www.w3.org/ns/odrl/2/" | |
| 301 | + } | |
| 302 | +} | |
| 303 | +``` | |
| 304 | + | |
| 305 | +### Create contract definition | |
| 306 | + | |
| 307 | +#### Url | |
| 308 | + | |
| 309 | +```bash | |
| 310 | +<CONNECTOR_URL>/cp/mgmt/v3/contractdefinitions (POST) | |
| 311 | +``` | |
| 312 | + | |
| 313 | +#### Request body | |
| 314 | + | |
| 315 | +```json | |
| 316 | +{ | |
| 317 | + "@context": { | |
| 318 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/" | |
| 319 | + }, | |
| 320 | + "@type": "https://w3id.org/edc/v0.0.1/ns/ContractDefinition", | |
| 321 | + "accessPolicyId": "eonax-members-only", | |
| 322 | + "contractPolicyId": "eonax-members-only", | |
| 323 | + "assetsSelector": [ | |
| 324 | + { | |
| 325 | + "@type": "Criterion", | |
| 326 | + "operandLeft": "https://w3id.org/edc/v0.0.1/ns/id", | |
| 327 | + "operator": "=", | |
| 328 | + "operandRight": "my-asset-id" | |
| 329 | + } | |
| 330 | + ] | |
| 331 | +} | |
| 332 | +``` | |
| 333 | + | |
| 334 | +#### Response | |
| 335 | + | |
| 336 | +If the request is successful, then a code 200 will be returned along with a body containing the id of the contract | |
| 337 | +definition: | |
| 338 | + | |
| 339 | +```json | |
| 340 | +{ | |
| 341 | + "@type": "IdResponse", | |
| 342 | + "@id": "1c6e191e-84bf-4640-b41b-f9ba717e9712", | |
| 343 | + "createdAt": 1703167892881, | |
| 344 | + "@context": { | |
| 345 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/", | |
| 346 | + "edc": "https://w3id.org/edc/v0.0.1/ns/", | |
| 347 | + "eonax": "https://w3id.org/eonax/v0.0.1/ns/", | |
| 348 | + "odrl": "http://www.w3.org/ns/odrl/2/" | |
| 349 | + } | |
| 350 | +} | |
| 351 | +``` | |
| 352 | + | |
| 353 | +## Discovery, negotiation and usage of a dataset | |
| 354 | + | |
| 355 | +This section is not correlated with the first one, i.e. we are not using the dataset created in the first section. | |
| 356 | +All APIs from this section requires a x-api-key header in input containing the token provided by Amadeus to interact | |
| 357 | +with the dataspace federated catalog. | |
| 358 | + | |
| 359 | +### Federated catalog | |
| 360 | + | |
| 361 | +#### Url | |
| 362 | + | |
| 363 | +```bash | |
| 364 | +<CATALOG_URL>/catalog/mgmt/v1alpha/catalog/query (POST) | |
| 365 | +``` | |
| 366 | + | |
| 367 | +No request body is required. | |
| 368 | + | |
| 369 | +#### Response | |
| 370 | + | |
| 371 | +The response is a list of catalog (one catalog per Eona-X participant). A test participant called `eonaxtest` whose | |
| 372 | +respective catalog is depicted below. | |
| 373 | + | |
| 374 | +```json | |
| 375 | +{ | |
| 376 | + "@id": "bea94ccf-b582-4c0c-8369-e2787990df86", | |
| 377 | + "@type": "http://www.w3.org/ns/dcat#Catalog", | |
| 378 | + "https://w3id.org/dspace/v0.8/participantId": "did:web:eonaxtest-identityhub%3A8383:api:did", | |
| 379 | + "http://www.w3.org/ns/dcat#dataset": { | |
| 380 | + "@id": "hello-eonax", | |
| 381 | + "@type": "http://www.w3.org/ns/dcat#Dataset", | |
| 382 | + "odrl:hasPolicy": { | |
| 383 | + "@id": "YTM1MjcyOWUtYmY3Ny00MDkxLWFkZGUtZWE2YmJkZDFlMTNj:aGVsbG8tZW9uYXg=:MWVjMjJjY2MtMGEyMi00OTU4LTliZDctNDU4NWFjYmE5ZDgz", | |
| 384 | + "@type": "odrl:Offer", | |
| 385 | + "odrl:permission": { | |
| 386 | + "odrl:action": { | |
| 387 | + "odrl:type": "http://www.w3.org/ns/odrl/2/use" | |
| 388 | + }, | |
| 389 | + "odrl:constraint": { | |
| 390 | + "odrl:leftOperand": "https://w3id.org/edc/v0.0.1/ns/MembershipCredential", | |
| 391 | + "odrl:operator": { | |
| 392 | + "@id": "odrl:eq" | |
| 393 | + }, | |
| 394 | + "odrl:rightOperand": "active" | |
| 395 | + } | |
| 396 | + }, | |
| 397 | + "odrl:prohibition": [], | |
| 398 | + "odrl:obligation": [] | |
| 399 | + }, | |
| 400 | + "http://www.w3.org/ns/dcat#distribution": { | |
| 401 | + "@type": "http://www.w3.org/ns/dcat#Distribution", | |
| 402 | + "http://purl.org/dc/terms/format": { | |
| 403 | + "@id": "HttpData-PULL" | |
| 404 | + }, | |
| 405 | + "http://www.w3.org/ns/dcat#accessService": { | |
| 406 | + "@id": "76c141c1-6f2f-4704-bfa1-fcf734652b25", | |
| 407 | + "@type": "http://www.w3.org/ns/dcat#DataService" | |
| 408 | + } | |
| 409 | + }, | |
| 410 | + "version": "1.0", | |
| 411 | + "name": "Hello Eona-X", | |
| 412 | + "description": "An API that says hello to Eona-X", | |
| 413 | + "id": "hello-eonax", | |
| 414 | + "contenttype": "application/json" | |
| 415 | + }, | |
| 416 | + "http://www.w3.org/ns/dcat#service": { | |
| 417 | + "@id": "76c141c1-6f2f-4704-bfa1-fcf734652b25", | |
| 418 | + "@type": "http://www.w3.org/ns/dcat#DataService", | |
| 419 | + "http://www.w3.org/ns/dcat#endpointDescription": "dspace:connector", | |
| 420 | + "http://www.w3.org/ns/dcat#endpointUrl": "http://eonaxtest-controlplane:8282/api/dsp", | |
| 421 | + "http://purl.org/dc/terms/terms": "dspace:connector", | |
| 422 | + "http://purl.org/dc/terms/endpointUrl": "http://eonaxtest-controlplane:8282/api/dsp" | |
| 423 | + }, | |
| 424 | + "originator": "http://eonaxtest-controlplane:8282/api/dsp", | |
| 425 | + "participantId": "did:web:eonaxtest-identityhub%3A8383:api:did", | |
| 426 | + "@context": { | |
| 427 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/", | |
| 428 | + "edc": "https://w3id.org/edc/v0.0.1/ns/", | |
| 429 | + "odrl": "http://www.w3.org/ns/odrl/2/" | |
| 430 | + } | |
| 431 | +} | |
| 432 | +``` | |
| 433 | + | |
| 434 | +This catalog contains a `dataset` field that contains the list of datasets exposed by this | |
| 435 | +provider. For the `eonaxtest` participant, there is one dataset in this list whose id is `hello-eonax`. | |
| 436 | +In the following section, we will demonstrate how to request the access to this dataset using the connector APIs, and | |
| 437 | +finally how to consume the data represented by this dataset. | |
| 438 | + | |
| 439 | +## Contract negotiation and data transfer | |
| 440 | + | |
| 441 | +This section is not correlated with the first one, i.e. we are not using the dataset created in the first section. | |
| 442 | +All queries detailed in this section are based on the Swagger specification of the Management API of the EDC connector. | |
| 443 | +All APIs from this section requires a `x-api-key` header in input containing the token provided by Amadeus to interact | |
| 444 | +with your connector. | |
| 445 | + | |
| 446 | +### Contract negotiation | |
| 447 | + | |
| 448 | +In order to request access to this dataset, we first need to perform a JSON-LD compaction of the catalog response. The | |
| 449 | +compacted structure can be obtained simply by copying the content of the catalog into the JSON-LD playground. Then | |
| 450 | +extract the content of the `hasPolicy` field for the `hello-eonax` dataset in the compacted | |
| 451 | +structure, which should look similar to: | |
| 452 | + | |
| 453 | +```json | |
| 454 | +{ | |
| 455 | + "@id": "YTM1MjcyOWUtYmY3Ny00MDkxLWFkZGUtZWE2YmJkZDFlMTNj:aGVsbG8tZW9uYXg=:MWVjMjJjY2MtMGEyMi00OTU4LTliZDctNDU4NWFjYmE5ZDgz", | |
| 456 | + "@type": "http://www.w3.org/ns/odrl/2/Offer", | |
| 457 | + "http://www.w3.org/ns/odrl/2/obligation": [], | |
| 458 | + "http://www.w3.org/ns/odrl/2/permission": { | |
| 459 | + "http://www.w3.org/ns/odrl/2/action": { | |
| 460 | + "http://www.w3.org/ns/odrl/2/type": "http://www.w3.org/ns/odrl/2/use" | |
| 461 | + }, | |
| 462 | + "http://www.w3.org/ns/odrl/2/constraint": { | |
| 463 | + "http://www.w3.org/ns/odrl/2/leftOperand": "https://w3id.org/edc/v0.0.1/ns/MembershipCredential", | |
| 464 | + "http://www.w3.org/ns/odrl/2/operator": { | |
| 465 | + "@id": "http://www.w3.org/ns/odrl/2/eq" | |
| 466 | + }, | |
| 467 | + "http://www.w3.org/ns/odrl/2/rightOperand": "active" | |
| 468 | + } | |
| 469 | + }, | |
| 470 | + "http://www.w3.org/ns/odrl/2/prohibition": [] | |
| 471 | +} | |
| 472 | +``` | |
| 473 | + | |
| 474 | +Then add the `target` and `assigner` fields in the resulting structure as follows: | |
| 475 | + | |
| 476 | +```json | |
| 477 | +{ | |
| 478 | + "@id": "YTM1MjcyOWUtYmY3Ny00MDkxLWFkZGUtZWE2YmJkZDFlMTNj:aGVsbG8tZW9uYXg=:MWVjMjJjY2MtMGEyMi00OTU4LTliZDctNDU4NWFjYmE5ZDgz", | |
| 479 | + "@type": "http://www.w3.org/ns/odrl/2/Offer", | |
| 480 | + "http://www.w3.org/ns/odrl/2/obligation": [], | |
| 481 | + "http://www.w3.org/ns/odrl/2/permission": { | |
| 482 | + "http://www.w3.org/ns/odrl/2/action": { | |
| 483 | + "http://www.w3.org/ns/odrl/2/type": "http://www.w3.org/ns/odrl/2/use" | |
| 484 | + }, | |
| 485 | + "http://www.w3.org/ns/odrl/2/constraint": { | |
| 486 | + "http://www.w3.org/ns/odrl/2/leftOperand": "https://w3id.org/edc/v0.0.1/ns/MembershipCredential", | |
| 487 | + "http://www.w3.org/ns/odrl/2/operator": { | |
| 488 | + "@id": "http://www.w3.org/ns/odrl/2/eq" | |
| 489 | + }, | |
| 490 | + "http://www.w3.org/ns/odrl/2/rightOperand": "active" | |
| 491 | + } | |
| 492 | + }, | |
| 493 | + "http://www.w3.org/ns/odrl/2/prohibition": [], | |
| 494 | + "http://www.w3.org/ns/odrl/2/target": { | |
| 495 | + "@id": "hello-eonax" | |
| 496 | + }, | |
| 497 | + "http://www.w3.org/ns/odrl/2/assigner": { | |
| 498 | + "@id": "did:web:eonaxtest-identityhub%3A8383:api:did" | |
| 499 | + } | |
| 500 | +} | |
| 501 | +``` | |
| 502 | + | |
| 503 | +Keep note of this resulting json structure, as it will be required to initiate the contract negotiation. | |
| 504 | + | |
| 505 | +### Initiate Contract Negotiation request | |
| 506 | + | |
| 507 | +#### Url | |
| 508 | + | |
| 509 | +```bash | |
| 510 | +<CONNECTOR_URL>/cp/mgmt/v3/contractnegotiations (POST) | |
| 511 | +``` | |
| 512 | + | |
| 513 | +#### Request body | |
| 514 | + | |
| 515 | +Paste the json structure obtained in the previous section into the policy field of the “Initiate Contract“ request, as | |
| 516 | +such: | |
| 517 | + | |
| 518 | +```json | |
| 519 | +{ | |
| 520 | + "@context": { | |
| 521 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/" | |
| 522 | + }, | |
| 523 | + "@type": "ContractRequestDto", | |
| 524 | + "counterPartyAddress": "http://eonaxtest-controlplane:8282/api/dsp", | |
| 525 | + "protocol": "dataspace-protocol-http", | |
| 526 | + "policy": { | |
| 527 | + "@id": "YTM1MjcyOWUtYmY3Ny00MDkxLWFkZGUtZWE2YmJkZDFlMTNj:aGVsbG8tZW9uYXg=:MWVjMjJjY2MtMGEyMi00OTU4LTliZDctNDU4NWFjYmE5ZDgz", | |
| 528 | + "@type": "http://www.w3.org/ns/odrl/2/Offer", | |
| 529 | + "http://www.w3.org/ns/odrl/2/obligation": [], | |
| 530 | + "http://www.w3.org/ns/odrl/2/permission": { | |
| 531 | + "http://www.w3.org/ns/odrl/2/action": { | |
| 532 | + "http://www.w3.org/ns/odrl/2/type": "http://www.w3.org/ns/odrl/2/use" | |
| 533 | + }, | |
| 534 | + "http://www.w3.org/ns/odrl/2/constraint": { | |
| 535 | + "http://www.w3.org/ns/odrl/2/leftOperand": "https://w3id.org/edc/v0.0.1/ns/MembershipCredential", | |
| 536 | + "http://www.w3.org/ns/odrl/2/operator": { | |
| 537 | + "@id": "http://www.w3.org/ns/odrl/2/eq" | |
| 538 | + }, | |
| 539 | + "http://www.w3.org/ns/odrl/2/rightOperand": "active" | |
| 540 | + } | |
| 541 | + }, | |
| 542 | + "http://www.w3.org/ns/odrl/2/prohibition": [], | |
| 543 | + "http://www.w3.org/ns/odrl/2/target": { | |
| 544 | + "@id": "hello-eonax" | |
| 545 | + }, | |
| 546 | + "http://www.w3.org/ns/odrl/2/assigner": { | |
| 547 | + "@id": "did:web:eonaxtest-identityhub%3A8383:api:did" | |
| 548 | + } | |
| 549 | + } | |
| 550 | +} | |
| 551 | +``` | |
| 552 | + | |
| 553 | +If the request validation is successful, a 200 OK status will be returned along with a response body containing the id | |
| 554 | +of the contract negotiation. Note this id for the next step. We will now check the status of the contract negotiation. | |
| 555 | + | |
| 556 | +### Get Contract Negotiation by ID | |
| 557 | + | |
| 558 | +#### Url | |
| 559 | + | |
| 560 | +```bash | |
| 561 | +<CONNECTOR_URL>/cp/mgmt/v3/contractnegotiations/<id> (GET) | |
| 562 | +``` | |
| 563 | + | |
| 564 | +If the id provided in the request is correct, the system returns the associated contract negotiation object, which looks | |
| 565 | +like the following: | |
| 566 | + | |
| 567 | +#### Request body | |
| 568 | + | |
| 569 | +```json | |
| 570 | +{ | |
| 571 | + "@type": "ContractNegotiation", | |
| 572 | + "@id": "ae13ba51-9151-4f83-9894-0c28ad8ee6fb", | |
| 573 | + "type": "CONSUMER", | |
| 574 | + "protocol": "dataspace-protocol-http", | |
| 575 | + "state": "FINALIZED", | |
| 576 | + "counterPartyId": "did:web:eonaxtest-identityhub%3A8383:api:did", | |
| 577 | + "counterPartyAddress": "http://eonaxtest-controlplane:8282/api/dsp", | |
| 578 | + "callbackAddresses": [], | |
| 579 | + "createdAt": 1703171822146, | |
| 580 | + "contractAgreementId": "af005be5-7e8a-4d4a-8c0c-605eae3de50e", | |
| 581 | + "@context": { | |
| 582 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/", | |
| 583 | + "edc": "https://w3id.org/edc/v0.0.1/ns/", | |
| 584 | + "eonax": "https://w3id.org/eonax/v0.0.1/ns/", | |
| 585 | + "odrl": "http://www.w3.org/ns/odrl/2/" | |
| 586 | + } | |
| 587 | +} | |
| 588 | +``` | |
| 589 | + | |
| 590 | +Ensure that the contract negotiation is in state `FINALIZED` before continuing to the next section. Please also take | |
| 591 | +note of the contract agreement id. | |
| 592 | + | |
| 593 | +### Initiate transfer | |
| 594 | + | |
| 595 | +Now that a contract agreed with the provider, we can start the transfer process. | |
| 596 | + | |
| 597 | +#### Url | |
| 598 | + | |
| 599 | +```bash | |
| 600 | +<CONNECTOR_URL>/cp/mgmt/v3/transferprocesses (POST) | |
| 601 | +``` | |
| 602 | + | |
| 603 | +#### Request | |
| 604 | + | |
| 605 | +```json | |
| 606 | +{ | |
| 607 | + "@context": { | |
| 608 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/" | |
| 609 | + }, | |
| 610 | + "@type": "TransferRequest", | |
| 611 | + "counterPartyAddress": "http://eonaxtest-controlplane:8282/api/dsp", | |
| 612 | + "protocol": "dataspace-protocol-http", | |
| 613 | + "connectorId": "did:web:eonaxtest-identityhub%3A8383:api:did", | |
| 614 | + "contractId": "<contract agreement id>", | |
| 615 | + "privateProperties": {}, | |
| 616 | + "transferType": "HttpData-PULL" | |
| 617 | +} | |
| 618 | +``` | |
| 619 | + | |
| 620 | +If the request is successfully validated by the system, a 200 OK status code will be returned along with the id of the | |
| 621 | +transfer process. Let’s now check the status of the transfer process. | |
| 622 | + | |
| 623 | +### Get Transfer Process by ID | |
| 624 | + | |
| 625 | +#### Url | |
| 626 | + | |
| 627 | +```bash | |
| 628 | +<CONNECTOR_URL>/cp/mgmt/v3/transferprocesses/<id> (GET) | |
| 629 | +``` | |
| 630 | + | |
| 631 | +#### Response | |
| 632 | + | |
| 633 | +If the id provided in the request is correct, the system returns the associated transfer process object, which looks | |
| 634 | +like the following: | |
| 635 | + | |
| 636 | +```json | |
| 637 | +{ | |
| 638 | + "@id": "921cac8f-d123-4a4c-b399-b4d5fdfd1e8b", | |
| 639 | + "@type": "TransferProcess", | |
| 640 | + "correlationId": "921cac8f-d123-4a4c-b399-b4d5fdfd1e8b", | |
| 641 | + "state": "STARTED", | |
| 642 | + "stateTimestamp": 1703172827067, | |
| 643 | + "type": "CONSUMER", | |
| 644 | + "assetId": "hello-eonax", | |
| 645 | + "contractId": "d6ce2252-af49-4c2f-bc38-921995d996a4", | |
| 646 | + "callbackAddresses": [], | |
| 647 | + "transferType": "HttpData-PULL", | |
| 648 | + "connectorId": "did:web:eonaxtest-identityhub%3A8383:api:did", | |
| 649 | + "@context": { | |
| 650 | + "@vocab": "https://w3id.org/edc/v0.0.1/ns/", | |
| 651 | + "edc": "https://w3id.org/edc/v0.0.1/ns/", | |
| 652 | + "eonax": "https://w3id.org/eonax/v0.0.1/ns/", | |
| 653 | + "odrl": "http://www.w3.org/ns/odrl/2/" | |
| 654 | + } | |
| 655 | +} | |
| 656 | +``` | |
| 657 | + | |
| 658 | +Ensure that the transfer process is in state `STARTED` before continuing to the next section. | |
| 659 | + | |
| 660 | +## Data consumption (Consumer) | |
| 661 | + | |
| 662 | +### Data querying | |
| 663 | + | |
| 664 | +Once a contract has been successfully negotiated with a provider and a transfer process has been started for this | |
| 665 | +contract, the consumer can now use its connector to fetch the provider’s data. | |
| 666 | + | |
| 667 | +This is achieved by targeting a proxy API of the consumer Data Plane, that enables to pass query/path parameters in the | |
| 668 | +request. These query/path parameters are then forwarded to the provider Data Plane, which finally send them to the | |
| 669 | +actual data source. | |
| 670 | + | |
| 671 | +All APIs from this section requires a `x-api-key` header in input containing the token provided by Amadeus to interact | |
| 672 | +with your connector. You must also provide the contract id obtained in the previous section in the `Contract-Id` header. | |
| 673 | + | |
| 674 | +#### Url | |
| 675 | + | |
| 676 | +```bash | |
| 677 | +<CONNECTOR_URL>/dp/data | |
| 678 | +``` | |
| 679 | + | |
| 680 | +#### Response | |
| 681 | + | |
| 682 | +```json | |
| 683 | +{ | |
| 684 | + "message": "Hello Eona-X" | |
| 685 | +} | |
| 686 | +``` | |
| 687 | + | |
| 688 | +As mentioned above, you can pass any query/path parameters in the request url (assuming the provider has enabled the | |
| 689 | +proxying of query/path parameters for this dataset), e.g. `<CONNECTOR_URL>/dp/data?name=world` | |
| 690 | + | |
| 691 | +## Appendix | |
| 692 | + | |
| 693 | +### Eona-X participants ids as of 17 OCT 2024 | |
| 694 | + | |
| 695 | +| Participant name | ID | | |
| 696 | +|---------------------------------------------------------------------|---------------------------| | |
| 697 | +| Aeroport de Paris | aeroportdeparis | | |
| 698 | +| Apidae | apidae | | |
| 699 | +| Amadeus | amadeus | | |
| 700 | +| Direction de la transformation numerique (ministere de l’interieur) | dnum | | |
| 701 | +| Eonax test participant | eonaxtest | | |
| 702 | +| Renault | renault | | |
| 703 | +| SNCF | sncf | | |
| 704 | +| Aeroport Marseille Provence | aeroportmarseilleprovence | | |
| No newline at the end of the file |