-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some kind of "document type" field to "/" (capabilities) #289
Comments
Why do you need to know that? Shouldn't that be clear from context? The requested URL contains /.well-known/openeo => well-known document (or invalid response) |
that's indeed the only thing we can currently do But IMHO the presence of a field e.g. when one tries to connect to |
Yes. The intended behavior is:
In this case there should be no issues and no such "document type" field be required. If that workflow doesn't work because a user directly used a versioned url (e.g. earthengine.openeo.org/v1.0; but should never happen) then the Client should ask for the well-known document there, see that it doesn't exist (404) and then expect that the URL leads to a Capabilities document. If it can't be read, the URL should be rejected. |
I understand the high level flow, but there are some details that make things shaky
what does this mean in practice? that the url has numbers in it? that the url has a non empty For example: the EURAC backend currently has this {"versions": [
{
"production": false,
"api_version": "0.4.2",
"url": "https://openeo.eurac.edu"
},
{
"production": false,
"api_version": "0.3.1",
"url": "http://saocompute.eurac.edu/openEO_0_3_0/openeo/"
}
]} Note that both have So a client that uses the flow you describe won't be able to connect to https://openeo.eurac.edu because there is no production ready version in |
No, "versioned url" is maybe a bit misleading, but it means you can't access a well-known document for the given url (or the client is already aware of it being a versioned url as it's listed in the well-known document).
Not a problem. You connect to ex.com/.well-known/openeo and that lists ex.com/ as versioned url and then you can read the Capabilities there.
Then use the most recent non-production version. I really thought that's part of the openAPI description, but it's not. I'll fix that.
It is a versioned url. Versioned URL, as described above, is a bit misleading here. It just means there's an openEO API compliant to a specific version behind it. |
hmm I'm still confused by these recursive/circular definitions e.g. the Also, see Open-EO/openeo-python-driver#40: e.g. we want the VITO backend to support API roots urls that are not exposed in the well-known document (e.g. for legacy/custom use cases that require a pinned down version). How do you detect that a url is "versioned" if it is not described in the well-known document? If there would be something like a "doctype" field in the capabilities response, then there is a explicit claim to check that we are working with a capabilities response, no need to brittle heuristics. |
Okay, forget my definitions above, it seems they were not 100% spot on. Let's go through two examples here: Each back-end has a URL that is used to connect to the back-end. Depending on the implementation it may be "virtual" and not return any openEO API specific response. In this example we use: Clients can use both of these URLs through the (always unversioned!) well-known discovery mechanism: Those URLs comply to all API versions (except 0.3 as the mechanism was introduced later). From the well-known discovery you get to know the versioned URLs that return responses compliant to a specific openEO API version, for example:
All these are versioned URLs as they return a document from the openEO API, which is specific to a version. So there are basically three types of URLs:
So yes, https://openeo.eurac.edu is (due to historical reasons) used for multiple things (unfortunately). These URL types are not necessarily exclusive.
Let's say your non-exposed instance is running at
Doesn't work as your legacy back-end doesn't implement doctype. We can't add that field to an old API release. I hope this makes it clear, otherwise I'd suggest hoping on a quick call later. |
Maybe this issue is related to the Python implementation. I just had a look at Open-EO/openeo-python-client@a126571 and it seems you are doing the connect process the other way round. It first checks for capabilities and then for well-known discovery, but it should make it the other way round. First check the well-known discovery, then call capabilities. |
That was only the first commit :-), I fixed it right after that: |
Fixed that in 83af45d |
Ah, this might also contribute to my confusion: my understanding of RFC 5785 (well-known URIs) is that the path component in these urls must start with This property is also explicitly stressed in the openeo docs https://openeo.org/documentation/1.0/developers/api/reference.html#operation/connect . Is it then intended that a client should blindly do request to non-standard .well-known url?
(also note that the openeo docs use wrong RFC number in the text: |
Yes, https://openeo.vito.be/openeo/2.0/.well-known/openeo should be an invalid URL and should return 404, which is in-line with RFC 5785, I think. Although I can't prevent providers from not using root for well-known if there are reasons for it (e.g. not having access to a domain directly, see below).
I blindly ask to request it, yes. (JS client)
Not sure. That really depends whether all API implementations can support this, e.g. for us as university it's always a stretch to get new domains and usually are hosted in sub-directories. I don't have a strong opinion here, there are pros and cons for both sides. I fixed the RFC number. |
FYI: eodc backend currently doesn't fail on this apparently:
|
I'm aware of that, but that's a back-end issue to be fixed by EODC. @lforesta |
@m-mohr I missed that, we'll fix it soon, thanks. |
Another data point: Microsoft Identity platform (used by EURAC atm) uses well-known urls outside of domain root for the OIDC discovery doc, e.g. for EURAC: https://login.microsoftonline.com/92513267-03e3-401a-80d4-c58ed6674e3b/v2.0/.well-known/openid-configuration |
Yeah, that's logical as they host multiple instances and you can't have that in a single location. So I could imaging that you could hide that with a subdomain in the settings or so, but on the other hand it doesn't really matter whether it's root or not. Same for openEO. If all clients follow the same procedure, it shouldn't be an issue. By the way, is this issue now resolved and can be closed? |
yes it's fine |
@jdries fixed Open-EO/openeo-python-client#142 ( .well-known/openeo discovery), but I was wondering some more about it: couldn't we add a required field (e.g. "doctype") with fixed value (e.g. "openeo-capabilities") to the capabilities document? Then a client can easily detect without heuristics that a given url is root of the API. Now there is not really an explicit way to detect whether a returned document is the capabilities document, a well-known document, something else, ....
The text was updated successfully, but these errors were encountered: