Elffuss BraidHub

kikocis/EDC public

main · 4.3 KiBRenderedRawPermalink
1# Detailed technical aspects of mapping transfer formats onto data planes
2
3## The transfer format
4
5The transfer format is a descriptor of how certain `Assets` are available for transfer. This means, the same physical
6Asset could be available via multiple formats, e.g. HTTP, S3, Azure Blob, etc. In DCAT terms there is one `Distribution`
7per format.
8
9Practically, the format conforms to the following schema:
10
11```ebnf
12format ::= DESTTYPE DASH FLOWTYPE ;
13DESTTYPE ::= [a-zA-Z0-9] ;
14DASH ::= "-";
15FLOWTYPE ::= "PUSH" | "PULL" ;
16```
17
18The first section, the `DESTTYPE`, is arbitrary, and could be any character sequence. For example one could
19define `SuperFastQuantumTransfer-PUSH`, so long as there is a data plane that can fulfil super-fast quantum transfers.
20It should be noted that the _format_ is a concept that is immanent only to the control plane.
21
22When registering data planes with the `DataPlaneSelector`, there must be a link between the (arbitrary) format and the
23transmission technology utilized in the data plane. The `DataPlaneSelectorService` must be able to dispatch an
24incoming `DataRequest` to an appropriate data plane. Consequently, the format must be _mapped_ onto a data plane
25descriptor.
26
27_Alternate names: catalog format, distribution format, catalog type, transfer type_
28
29## Mapping the format
30
31The data plane does not know anything about DCAT or `Assets`, thus the _format_ does not exist there as a concept. A
32data plane only knows about data sources, data destinations and flow directions. (The source type is not relevant for
33this document).
34
35The _format_ is mapped onto a tuple consisting of the `destType`, which is a String, and the `flowType`, which is
36an `Enum`. This tuple is called a `DataPlaneDescriptor` as it identifies a specific data plane:
37
38```java
39public record DataPlaneDescriptor(String destinationType, FlowType direction) {
40}
41```
42
43This mapping is done in
44the control plane, and it must be extensible, for example some data planes might map
45
46```
47Http-PUSH -> destType=Http, flowType=PUSH
48```
49
50but others might have a different format representation, that maps to the same technical transmission stack:
51
52```
53SuperFastQuantumTransfer-PUSH -> destType=Http, flowType=PUSH
54```
55
56from that it follows that there must be a configurable/extensible way of performing the mapping:
57
58```java
59var tokens = format.split("-");
60var destType = mappingRegistry.getOrDefault(token[0], tokens[0]);
61var flowType = FlowType.parse(tokens[1]);
62```
63
64This implies, that the mapping from format to `DataPlaneDescriptor` must be unambiguous. Ambiguity may be countered by
65random selection.
66
67## Impact on Authorization
68
69Authorization is only possible when the flow type is `PULL`, because only then does the provider data plane retain
70access control. (In PUSH scenarios, the consumer data plane may use authorization, however).
71
72Further, token creation is dispatched based on the _destination type_, as the format does not exist as a concept in the
73data plane. If multiple formats are are mapped to the same destination type (and thus: transmission stack), but should
74have different auth token schemes and authorization mechanisms, _separate data planes are needed_.
75
76The `FlowType` will replace the `transferType` field on the `DataFlowStartMessage`. If the `flowType==PUSH` the
77authorization is bypassed.
78
79## Examples of mapped formats
80
81* `Http-PULL` -> `destType = Http`, just connects the streams
82* `Http-PUSH` -> `destType = Http`, connects the streams _and_ starts the transfer
83* `HttpAas-PUSH` -> `destType = Http`
84* `HttpAas-PULL` -> `destType = Http`
85* `AmazonS3-PULL` -> `destType = AmazonS3`, EDR contains bucket data plus temporary access token. Dataplane may transfer
86 data into a staging bucket.
87* `AmazonS3-PUSH` -> `destType = AmazonS3`
88
89## Data plane registration
90
91Several different _format_ strings could map to the same combination of `destType` and `flowType`. For example there
92could be scenarios where the following mapping is implemented:
93
94```
95Http-PULL -> destType=Http, flowType=PUSH //only performs basic authentication
96HttpSecure-PULL -> destType=Http, flowType=PUSH //adds some highly secure authorization scheme
97```
98
99When registering those data planes, the format is needed as additional parameter, to be able to distinguish between
100them. In other words, dispatching solely based on the `DataPlaneDescriptor` may produce ambiguous results.