Skip to content

Commit 774c17f

Browse files
feat: incorporate Dataplane Signaling (#613)
* fix(build): use stable GW CRDs for Traefik * use standard channel * add dataplane for consumer * fix url paths in Bruno * patch DP registration * add registration to seed jobs * transfer process works * cleanup, remove Asset.dataAddress * add proxy to download data * improve e2e test * add simple token auth * remove unneeded modules * split deployment * add auth * fix tests * some source doc [skip ci] * update README
1 parent e6d9895 commit 774c17f

51 files changed

Lines changed: 1118 additions & 1412 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/run-e2e-tests.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,45 @@ jobs:
8181
# Wait for traefik to be ready
8282
kubectl rollout status deployment/traefik -n traefik --timeout=120s
8383
84+
# install Gateway API CRDs
85+
kubectl apply --server-side --force-conflicts -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.5.1/standard-install.yaml
86+
8487
# forward port 80 -> 8080
8588
kubectl -n traefik port-forward svc/traefik 8080:80 &
8689
87-
# install Gateway API CRDs
88-
kubectl apply --server-side --force-conflicts -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.4.1/experimental-install.yaml
90+
sleep 5 # to be safe
8991
90-
sleep 5 # to be safe`
92+
- name: "Deploy MVD common resources"
93+
run: |-
94+
kubectl apply -k k8s/common
95+
kubectl wait -A \
96+
--for=condition=ready pod \
97+
--selector=type=edc-infra \
98+
--timeout=120s || { kubectl get pods -A; exit 1; }
9199
92-
- name: "Deploy MVD"
100+
- name: "Deploy MVD issuer resources"
93101
run: |-
94-
kubectl apply -k k8s/
102+
kubectl apply -k k8s/issuer
103+
kubectl wait -A \
104+
--selector=type=edc-job \
105+
--for=condition=complete job --all \
106+
--timeout=240s || { kubectl get pods -A; exit 1; }
107+
108+
- name: "Deploy MVD consumer resources"
109+
run: |-
110+
kubectl apply -k k8s/consumer
111+
kubectl wait -A \
112+
--selector=type=edc-job \
113+
--for=condition=complete job --all \
114+
--timeout=240s || { kubectl get pods -A; exit 1; }
95115
96-
- name: "Wait for MVD to be ready"
116+
- name: "Deploy MVD provider resources"
97117
run: |-
118+
kubectl apply -k k8s/provider
98119
kubectl wait -A \
99120
--selector=type=edc-job \
100121
--for=condition=complete job --all \
101-
--timeout=300s || kubectl get pods -A
122+
--timeout=240s || { kubectl get pods -A; exit 1; }
102123
103124
104125
- name: "Run E2E Test"

README.md

Lines changed: 80 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
11
# Minimum Viable Dataspace Demo
22

33
<!-- TOC -->
4+
45
* [Minimum Viable Dataspace Demo](#minimum-viable-dataspace-demo)
5-
* [1. Introduction](#1-introduction)
6-
* [2. Purpose of this Demo](#2-purpose-of-this-demo)
7-
* [2.1 Version stability and backwards compatibility guarantees](#21-version-stability-and-backwards-compatibility-guarantees)
8-
* [2.2 Which version should I use?](#22-which-version-should-i-use)
9-
* [3. The Scenario](#3-the-scenario)
10-
* [3.1 Participants](#31-participants)
11-
* [3.2 Data setup](#32-data-setup)
12-
* [3.3 Access control](#33-access-control)
13-
* [3.4 DIDs, participant lists, and VerifiableCredentials](#34-dids-participant-lists-and-verifiablecredentials)
14-
* [4. Running the Demo (Kubernetes)](#4-running-the-demo-kubernetes)
15-
* [4.1 Create the K8S cluster](#41-create-the-k8s-cluster)
16-
* [4.2 Deploy the MVD components](#42-deploy-the-mvd-components)
17-
* [4.2.1 Using pre-built images](#421-using-pre-built-images)
18-
* [4.2.2 Building from source](#422-building-from-source)
19-
* [4.2.3 Deploy MVD components](#423-deploy-mvd-components)
20-
* [4.3 Seed the dataspace](#43-seed-the-dataspace)
21-
* [4.4 Debugging MVD in Kubernetes](#44-debugging-mvd-in-kubernetes)
22-
* [5. Executing REST requests using Bruno](#5-executing-rest-requests-using-bruno)
23-
* [5.1 Get the catalog](#51-get-the-catalog)
24-
* [5.2 Initiate the contract negotiation](#52-initiate-the-contract-negotiation)
25-
* [5.3 Query negotiation status](#53-query-negotiation-status)
26-
* [5.4 Initiate data transfer](#54-initiate-data-transfer)
27-
* [5.5 Query data transfers](#55-query-data-transfers)
28-
* [5.6 Get EndpointDataReference](#56-get-endpointdatareference)
29-
* [5.7 Get access token for EDR](#57-get-access-token-for-edr)
30-
* [5.8 Fetch data](#58-fetch-data)
31-
* [6. Custom extensions in MVD](#6-custom-extensions-in-mvd)
32-
* [7. Advanced topics](#7-advanced-topics)
33-
* [7.2 Regenerating key pairs](#72-regenerating-key-pairs)
34-
* [8. Other caveats, shortcuts, and workarounds](#8-other-caveats-shortcuts-and-workarounds)
35-
* [8.2 DID resolution for participants](#82-did-resolution-for-participants)
36-
* [8.3 Seed Jobs](#83-seed-jobs)
6+
* [1. Introduction](#1-introduction)
7+
* [2. Purpose of this Demo](#2-purpose-of-this-demo)
8+
* [2.1 Version stability and backwards compatibility guarantees](#21-version-stability-and-backwards-compatibility-guarantees)
9+
* [2.2 Which version should I use?](#22-which-version-should-i-use)
10+
* [3. The Scenario](#3-the-scenario)
11+
* [3.1 Participants](#31-participants)
12+
* [3.2 Data setup](#32-data-setup)
13+
* [3.3 Access control](#33-access-control)
14+
* [3.4 DIDs, participant lists, and VerifiableCredentials](#34-dids-participant-lists-and-verifiablecredentials)
15+
* [4. Running the Demo (Kubernetes)](#4-running-the-demo-kubernetes)
16+
* [4.1 Create the K8S cluster](#41-create-the-k8s-cluster)
17+
* [4.2 Deploy the MVD components](#42-deploy-the-mvd-components)
18+
* [4.2.1 Using pre-built images](#421-using-pre-built-images)
19+
* [4.2.2 Building from source](#422-building-from-source)
20+
* [4.2.3 Deploy MVD components](#423-deploy-mvd-components)
21+
* [4.3 Seed the dataspace](#43-seed-the-dataspace)
22+
* [4.4 Debugging MVD in Kubernetes](#44-debugging-mvd-in-kubernetes)
23+
* [5. Executing REST requests using Bruno](#5-executing-rest-requests-using-bruno)
24+
* [5.1 Get the catalog](#51-get-the-catalog)
25+
* [5.2 Initiate the contract negotiation](#52-initiate-the-contract-negotiation)
26+
* [5.3 Query negotiation status](#53-query-negotiation-status)
27+
* [5.4 Initiate data transfer](#54-initiate-data-transfer)
28+
* [5.5 Query data transfers](#55-query-data-transfers)
29+
* [5.6 Get EndpointDataReference](#56-get-endpointdatareference)
30+
* [5.7 Get access token for EDR](#57-get-access-token-for-edr)
31+
* [5.8 Fetch data](#58-fetch-data)
32+
* [6. Custom extensions in MVD](#6-custom-extensions-in-mvd)
33+
* [7. Advanced topics](#7-advanced-topics)
34+
* [7.2 Regenerating key pairs](#72-regenerating-key-pairs)
35+
* [8. Other caveats, shortcuts, and workarounds](#8-other-caveats-shortcuts-and-workarounds)
36+
* [8.2 DID resolution for participants](#82-did-resolution-for-participants)
37+
* [8.3 Seed Jobs](#83-seed-jobs)
38+
3739
<!-- TOC -->
3840

3941
## 1. Introduction
@@ -218,8 +220,10 @@ All commands are executed from the **repository's root folder** unless stated ot
218220
> Since this is not a production deployment, all applications are deployed _in the same cluster_ and in the same
219221
> namespace, plainly for the sake of simplicity.
220222
221-
This builds the runtime images and creates the following docker images: `ghcr.io/eclipse-edc/minimumviabledataspace/controlplane:latest`,
222-
`ghcr.io/eclipse-edc/minimumviabledataspace/dataplane:latest`, `ghcr.io/eclipse-edc/minimumviabledataspace/issuerservice:latest` and
223+
This builds the runtime images and creates the following docker images:
224+
`ghcr.io/eclipse-edc/minimumviabledataspace/controlplane:latest`,
225+
`ghcr.io/eclipse-edc/minimumviabledataspace/dataplane:latest`,
226+
`ghcr.io/eclipse-edc/minimumviabledataspace/issuerservice:latest` and
223227
`ghcr.io/eclipse-edc/minimumviabledataspace/identity-hub:latest` in the local docker image cache.
224228

225229
PostgreSQL and Hashicorp Vault obviously require additional configuration, which is handled by the Kubernetes manifests
@@ -238,11 +242,12 @@ kind create cluster -n mvd
238242

239243
### 4.2 Deploy the MVD components
240244

241-
The following commands deploy the MVD components to the cluster.
245+
The following commands deploy the MVD components to the cluster.
242246

243247
#### 4.2.1 Using pre-built images
244248

245-
If you are using the Docker images from the GitHub container registry, no further action is required. Process to step [4.2.3](#423-deploy-mvd-components)
249+
If you are using the Docker images from the GitHub container registry, no further action is required. Process to
250+
step [4.2.3](#423-deploy-mvd-components)
246251

247252
#### 4.2.2 Building from source
248253

@@ -331,7 +336,8 @@ Remote Debugging is possible, but Kubernetes port-forwards of port 1044 are nece
331336
332337
### 4.3 Seed the dataspace
333338

334-
Once all pods are up and running, and all seed jobs have completed, all necessary demo data is already in place, **no need
339+
Once all pods are up and running, and all seed jobs have completed, all necessary demo data is already in place, **no
340+
need
335341
to execute scripts or manually invoke the REST API**.
336342

337343
This includes:
@@ -495,49 +501,54 @@ response, we can move on.
495501

496502
The type of data transfer that we are using here (`HttpData-PULL`) means that we can fetch data from the provider
497503
dataplane's public endpoint, as we would query any other REST API. However, an access token is needed to authenticate
498-
the request. This access token is provided to the consumer in the form of an EndpointDataReference (EDR). We must thus
499-
query the consumer's EDR endpoint to obtain the token.
500-
501-
### 5.6 Get EndpointDataReference
502-
503-
Using the `ControlPlane Management/Get Cached EDRs` request, we fetch the EDR and note down the value of the `@id`
504-
field, for example `392d1767-e546-4b54-ab6e-6fb20a3dc12a`. This should be identical to the value of the
505-
`transferProcessId` field.
506-
507-
With that value, we can obtain the access token for this particular EDR.
504+
the request. This access token is provided to the consumer in the form of an EndpointProperty which we can obtain by
505+
using the`ControlPlane Management/Get Open Dataflows` request.
508506

509-
### 5.7 Get access token for EDR
507+
### 5.6 Get Open Dataflows
510508

511-
In the `ControlPlane Management/Get EDR DataAddress for TransferId` request we have to paste the `transferProcessId`
512-
value from the previous step in the URL path, for example:
509+
Using the `ControlPlane Management/Get Open Dataflows` request, we fetch the data flow and note down the value of the
510+
key entry in the map, for example `392d1767-e546-4b54-ab6e-6fb20a3dc12a`. This should be identical to the value of
511+
the `transferProcessId` field.
513512

514-
```
515-
{{HOST}}/api/management/v3/edrs/392d1767-e546-4b54-ab6e-6fb20a3dc12a/dataaddress
516-
```
517-
518-
Executing this request produces a response that contains both the endpoint where we can fetch the data, and the
519-
authorization token:
513+
The access token is conveyed in the `endpointProperties` field of the response, in particular the `"authorization"`
514+
field:
520515

521516
```json
522517
{
523-
//...
524-
"endpoint": "http://provider-qna-dataplane:11002/api/public",
525-
"authType": "bearer",
526-
"endpointType": "https://w3id.org/idsa/v4.1/HTTP",
527-
"authorization": "eyJra.....PbovoypJGtWJst30vD9zy5w"
528-
//...
518+
"f9f3ee24-6968-4603-867f-71cbf2bf9152": {
519+
"@type": "DataAddress",
520+
"endpointType": "http",
521+
"endpoint": "http://dataplane.provider.svc.cluster.local:11002/api/public/63423d1f-846c-4fa4-bfc6-e034f9ad6a85/data/source",
522+
"endpointProperties": [
523+
{
524+
"type": null,
525+
"name": "access_token",
526+
"value": "eyJraWQiOiJkYXRhcGxhbmUtcHVibGljIiwiYWxnIjoiRWQyNTUxOSJ9.eyJpc3MiOiJwcm92aWRlci1kYXRhcGxhbmUiLCJzdWIiOiI2MzQyM2QxZi04NDZjLTRmYTQtYmZjNi1lMDM0ZjlhZDZhODUiLCJhdWQiOiJwcm92aWRlci1kYXRhcGxhbmUiLCJzY29wZSI6ImRhdGFmbG93In0.gjmSsp5eROrvW98_a0G1QwfCSi7d6yy7Bcye4mT2vhRwWjXPXcJyX0I8T1SE7fh1i3Ab5hKcPAvrvdYkrSI8Cw"
527+
},
528+
{
529+
"type": null,
530+
"name": "https://w3id.org/edc/v0.0.1/ns/type",
531+
"value": "http"
532+
},
533+
{
534+
"type": null,
535+
"name": "https://w3id.org/edc/v0.0.1/ns/endpoint",
536+
"value": "http://dataplane.provider.svc.cluster.local:11002/api/public/63423d1f-846c-4fa4-bfc6-e034f9ad6a85/data/source"
537+
}
538+
]
539+
}
529540
}
530541
```
531542

532-
Note that the token was abbreviated for legibility.
533-
534-
### 5.8 Fetch data
543+
### 5.7 Download the data
535544

536-
Using the endpoint and the authorization token from the previous step, we can then download data using the `ControlPlane
537-
Management/Download Data from Public API` request. To do that, the token must be copied into the request's
538-
`Authorization` header.
545+
The data plane comes with a convenience API, that allows us to download data directly from the provider's public
546+
endpoint. Using that "proxy" API, we can simply invoke the `ControlPlane Management/Download Data from Public API`
547+
providing the dataflow ID in the path.
539548

540-
Important: do not prepend a `bearer` prefix!
549+
Thus, the request travels Bruno → Consumer Dataplane (Proxy API) → Provider Dataplane (Public API), and since the
550+
consumer dataplane maintains a list of ongoing dataflows plus auth tokens, all we need to do is provide the dataflow ID
551+
to the proxy API.
541552

542553
This will return some dummy JSON data.
543554

Requests/ControlPlane Management/Download Data from Public API.bru

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,13 @@ meta {
55
}
66

77
get {
8-
url: {{PROVIDER_PUBLIC_URL}}/api/public
8+
url: {{CONSUMER_DP}}/api/proxy/flows/{{flowId}}/data
99
body: none
1010
auth: none
1111
}
1212

1313
headers {
14-
Authorization: {{AUTHORIZATION}}
15-
}
16-
17-
script:pre-request {
18-
if(!(bru.getVar("AUTHORIZATION") !== undefined && bru.getVar("AUTHORIZATION") !== null)){
19-
throw new Error(' The authorization token is not yet available, please execute request "Get EDR DataAddress for TransferId" first!');
20-
}
14+
~Authorization: {{accessToken}}
2115
}
2216

2317
script:post-response {

Requests/ControlPlane Management/Get Assets.bru

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ meta {
55
}
66

77
post {
8-
url: {{CONSUMER_CP}}/api/mgmt/v4/assets/request
8+
url: {{PROVIDER_CP}}/api/mgmt/v4/assets/request
99
body: json
1010
auth: inherit
1111
}

Requests/ControlPlane Management/Get EDR DataAddress for TransferId.bru

Lines changed: 0 additions & 33 deletions
This file was deleted.

Requests/ControlPlane Management/Get cached EDRs.bru

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)