| 1 | # Transfer Process |
| 2 | |
| 3 | ## Data Flows Supported by the EDC |
| 4 | |
| 5 | - Consumer pull |
| 6 | - Provider push |
| 7 | |
| 8 | ### Consumer pull |
| 9 | |
| 10 |  |
| 11 | |
| 12 | 1. Provider and consumer agree to a contract (not displayed in the diagram) |
| 13 | 2. Consumer initiates the transfer process by sending a `DataRequest` with destination type `HttpProxy` |
| 14 | 3. Provider Data Plane Selector is queried to find a suitable instance |
| 15 | 4. Provider Control Plane build a `DataAddress` which type `EDR`, whose: |
| 16 | - endpoint corresponds to the public API of the selected Data Plane |
| 17 | - auth key is `Authorization` |
| 18 | - auth code is a signed token generated by the Control Plane with claims: |
| 19 | - `dad` containing the encrypted `DataAddress` of the actual data source (provider ecosystem) |
| 20 | - `cid` claim containing the contract id |
| 21 | 5. This `DataAddress` is sent to the consumer Control Plane through DSP protocol |
| 22 | 6. Consumer Control Plane converts the `DataAddress` into a `EndpointDataReference` object and dispatch it through the `EndpointDataReferenceReceiverRegistry` |
| 23 | |
| 24 | Once this process is completed, the consumer backend applications can use the received `EndpointDataReference` in order |
| 25 | to query data from the provider Data Plane, by simply providing the provided token in the request header. |
| 26 | |
| 27 | > **_NOTE:_** For a Data Plane instance to be eligible for the Consumer Pull transfer, it must: |
| 28 | > - contains `HttpProxy` in the `allowedDestTypes` |
| 29 | > - contain a `property` which key `publicApiUrl`, which contains the actual URL of the Data Plane public API. |
| 30 | |
| 31 | ### Provider push |
| 32 | |
| 33 |  |
| 34 | |
| 35 | 1. Provider and consumer agree to a contract (not displayed in the diagram) |
| 36 | 2. Consumer initiates the transfer process, i.e. sends `DataRequest` with any destination type other than `HttpProxy` |
| 37 | 3. Provider Control Plane retrieves the `DataAddress` of the actual data source and creates a `DataFlowRequest` based on the received `DataRequest` and this data address |
| 38 | 4. Provider Control Plane asks the selector which Data Plane instance can be used for this data transfer |
| 39 | 5. Selector returns an eligible Data Plane instance (if any) |
| 40 | 6. Provider Control Plane sends the `DataFlowRequest` to the selected Data Plane instance through its control API (see `DataPlaneControlApi`) |
| 41 | 7. Provider Data Plane validates the incoming request |
| 42 | 8. If request is valid, Provider Data Plane returns acknowledgement |
| 43 | 9. `DataPlaneManager` of the Provider Data Plane processes the request: it creates a `DataSource`/`DataSink` pair based on the source/destination data addresses |
| 44 | 10. Provider Data Plane fetches data from the actual data source (see `DataSource`) |
| 45 | 11. Provider Data Plane pushes data to the consumer services (see `DataSink`) |
| 46 | |
| 47 | ## Transfer Process State Machine |
| 48 | |
| 49 | ### Consumer |
| 50 |  |
| 51 | |
| 52 | ### Provider |
| 53 |  |