chanzuckerberg / single-cell-data-portal

The data portal supporting the submission, exploration, and management of projects and datasets to cellxgene.
MIT License
63 stars 12 forks source link

Use Lambda@Edge for dataset downloads #5009

Closed ebezzi closed 5 months ago

ebezzi commented 1 year ago

Motivation

When datasets are withdrawn by submitters, we need the ability to signal that the dataset is "gone" (HTTP 410) rather than not found (HTTP 404).

Approach

We can leverage Lambda@Edge to customize the dataset download experience that is currently being handled by Cloudfront. For example, trying to download a withdrawn datasets will now always return a 404 due to the artifacts being removed. With Lambda@Edge we could query our REST API (the datasets endpoint) and return a 410.

metakuni commented 5 months ago

Closing this for now.

Note, returning a 410 HTTP response code for withdrawn datasets is still desired, but we will revisit when we address this: