Open-EO / openeo-api

The openEO API specification
http://api.openeo.org
Apache License 2.0
91 stars 11 forks source link

First STAC document for results not easy to retrieve #397

Closed m-mohr closed 3 years ago

m-mohr commented 3 years ago

In the Map Viewer proposal we identified that it's not easy to share results as the "initial" STAC document returned by GET /jobs/:id/results is only returned for authenticated users. This way it's not easy to share that file although all children and data are already signed URLs anyway.

We should also expose the response of GET /jobs/:id/results as a signed URL. The idea is to simply add a Link header, which points to the file itself as a signed URL.

For example the response for GET /jobs/:id/results could look like:

Content-Type: application/json
Link: <https://example.openeo.org/api/jobs/2584892312376463251497856398476123746/collection.json>; rel="canonical"

{
  "$comment": "Spit out the content of the link above as a response",
  "stac_version": "1.0.0",
  "assets": {...}
}

Rel types for consideration: alternate, duplicate, collection/item, canonical

m-mohr commented 3 years ago

Alternatively, the "self" link (or "canonical") in the document could point to a signed URL. That's better integrated with STAC compared to the Link in the header.

Example:

{
  "stac_version": "1.0.0",
  "assets": {...},
  "links": [
    {
      "href": "https://example.openeo.org/api/jobs/2584892312376463251497856398476123746/collection.json",
      "rel": "canonical"
    }
  ]
}

Anyway, it would be good if the results could be retrieved purely via a signed URL. I doubt that this will be hard to implement as the signed URL code is available for the other files anyway.

m-mohr commented 3 years ago

Added PR https://github.com/Open-EO/openeo-api/pull/400 with a proposal.

m-mohr commented 3 years ago

Merged, will be part of openEO API v1.2.0 (or v2.0.0).