Multi-DSP version support has issues due to use of .well-known and the way, the DID document is specified #143
Replies: 5 comments 11 replies
-
Hi @arnoweiss I have added my thoughts on the versioning issue here, feel free to add the content we created during our discussion earlier. |
Beta Was this translation helpful? Give feedback.
-
Please let me know if this fits your understanding of the situation. Current state of the specsequenceDiagram
participant PC as Provider DSP-Server
participant PW as Provider .well-known
participant PD as Provider Did Doc
participant CC as Consumer DSP-Server
autonumber
CC ->> PD: get
PD -->> CC: DSP-endpoint holding <root>/path/catalog
CC ->> CC: isolate <root>
CC ->> PW: get <root>/.well-known/dspace-version
PW -->> CC: HTTP 200 with path-segs & version
CC ->> CC: strip URL-segments,<br/>choose endpoint
CC ->> PC: POST <root>/path-segs/catalog/request
Your suggestionsequenceDiagram
participant PC as Provider DSP-server
participant PD as Provider Did Doc
participant CC as Consumer DSP-server
autonumber
CC ->> PD: get
PD -->> CC: did doc with service<br/>"DspMetadata" holding<br/> <root>/path/metadata
CC ->> PC: get <root>/path/metadata
PC -->> CC: HTTP 200 with path-segs and versions
CC ->> CC: choose endpoint
CC ->> PC: POST <root>/path-segs/catalog/request
|
Beta Was this translation helpful? Give feedback.
-
This can be handled very simply by: https://root.provider.com/connector Also, assume a single case: https://provider.com/connectors It is trivial to deploy a forwarding entry in a load balancer (e.g. NGINX) for: https://provider.com/.well-known/... to the backing connector or serve a static file. There is a reason why well-known is based on the root path; otherwise, discoverability is not possible given indeterminate path segments. On a related note, I don't think the "connector" address should be in the DID service entry as it is the catalog server, not the connector, that is the entry-point for discovering contract negotiation endpoints (which may be different). |
Beta Was this translation helpful? Give feedback.
-
IMHO we must:
my team and I propose:
|
Beta Was this translation helpful? Give feedback.
-
As this discussion is a little hard to stay on-top-of, I've tried to compile a tl;dr [1]. Let's focus on what's possible or not possible technologically there. [1] #144 |
Beta Was this translation helpful? Give feedback.
-
The issue I want to discuss here is, that in section 4.3.2 the HTTPS Binding for the exposure of supported version that are provided by a connector is specified, which makes use of the Well-Known Uniform Resource Identifier defined in RFC8615 (https://www.rfc-editor.org/rfc/rfc8615). The surprising fact of this feature is, that the RFC specifies that the /.well-known/ endpoint must at the top of the path hierarchy. What does this mean, the endpoint is only in special cases part of the connector service, in general it is an own resource that needs to be managed separately.
The DSP specifies in section 4.3.2 the endpoint “/.well-known/dspace-version”, which returns according to section 4.3.1 an array of mapping information between a “version” and a subpath beginning from the top of the endpoint hierarchy to the base path of the connector in that version, i.e., if a connector supports two versions 2014-1 and 2015-1 the array would contain two completely independent entries with key 2014-1 mapping to the path where all DSP endpoints according to that version are provided and with key 2015-1 the same for that version.
Let’s assume, a provider operates multiple connectors, but under the same domain, e.g.,
This would require an endpoint https://provider.com/.well-known/dspace-version which returns an array, that contains redundant keys for each version supported by any of the connectors, e.g., “2014-1” and a path like https://provider.com/connectors/pcf/api/2024-1/ and the same in future for version “2015-1” with a path like https://provider.com/connectors/pcf/api/2025-1/.
A big disadvantage is, that the supported version information cannot be managed by the connector service runtime itself, although it would be simple to do so. Instead, the operator of the connectors has to manage all version paths separately and provide a mechanism to offer the https://provider.com/.well-known/dspace-version endpoint as additional service.
The even bigger issue comes with section 5.4.5 of the DSP spec handling the Discovery of Catalog Services. In this section, it is specified, that a catalog service endpoint of a provider can be discovered by providing the information in the DID document of the provider in the service section as service of type “CatalogService”. There it is specified, that the reference would point to something like in the example above: https://provider.com/connectors/root/api/2015-1/catalog.
The problem now is that it is not clear, which version this catalog request is implementing. What a consumer has to do is, that he has to navigate to https://provider.com/.well-known/dspace-version, retrieve the version information and compare the truncated path “/connectors/root/api/2015-1/catalog” to the provided path “/connectors/root/api/2015-1” to identify the version by the key of the matching subpath.
If only the 2015-1 version is added in the DID document, the detection of “CatalogService” endpoint of, e.g., version 2014-1 is in general impossible. That is because starting from the information from the DID document namely the URI https://provider.com/connectors/root/api/2015-1/catalog. Based on that, the https://provider.com/.well-known/dspace-version has to be navigated to and based on the version information given from this endpoint, the search now is to find the entry in the array, with the right version key, in this case “2014-1” which has the largest intersection with the catalog endpoint found in the DID document. In the example we would have the following entries:
a. 2014-1 : https://provider.com/connectors/root/api/2014-1
b. 2014-1 : https://provider.com/connectors/pcf/api/2014-1
c. 2014-1 : https://provider.com/connectors/dcm/api/2014-1
The algorithm would find based on https://provider.com/connectors/root/api/2015-1/catalog that the largest intersection is with option a, so “hopefully” the root catalog information for version 2014-1 can be retrieved from https://provider.com/connectors/root/api/2014-1/catalog. If, in the above example a and b are not there, only connector c supports version 2014-1, the algorithm would detect option c as the 2014-1 version of the root catalog, which would be wrong. The issue is, that semantically, there is nothing that allows a consumer to distinguish between a part segment that is used for routing towards the connector from a path segment, that is part of the service endpoint hierarchy.
Actually, in my opinion, the two mechanisms do not interact well and therefore I propose the following changes for further discussion.
Using the .well-known RFC is actually not adding value to the DSP spec, as the versions supported by a connector is service-local, not a general property of the domain in which the connector is operated. Therefore, in section 4.3.2, there should be a mechanism that allows to get the version information relative to the base path of the connector. E.g., from the examples above, this could be something like "https://provider.com/connectors/root/api/metadata". This would be much easier to handle for an operator without any disadvantage.
The DID Document spec in section 5.4.5 should not give the path to the catalog endpoint, but should provide the base path of the overall connector. This change has two advantages:
Navigating upwards always has the issue, that it is not clear, when the navigation leaves the context of the current service and gets into path segments that are used to manage the service in a domain.
It is then an additional discussion whether in this case the DID document should contain a CatalogService object or something different, e.g., a "Connector".
Beta Was this translation helpful? Give feedback.
All reactions