FAIRDataPipeline / data-registry

The FAIR Data Registry is a Django website and REST API which is used by the FAIR Data Pipeline to store metadata about code runs and their inputs and outputs
BSD 2-Clause "Simplified" License
0 stars 1 forks source link

StorageRoot protocols #150

Open alahiff opened 2 years ago

alahiff commented 2 years ago

In the documentation it's mentioned that Storage Roots must contain a protocol, but this is not enforced. For local file storage in a local registry many users might not include file:// at the beginning, so we probably should enforce this.

alahiff commented 2 years ago

There are two options:

  1. Use a simple regex to allow anything of the appropriate form, e.g. superstore://.
  2. Have a predefined list of allowed protocols. If we go down this route, we should probably switch our custom URIField to Django's URLField but extend the allowed list of validators to at least include file:// (see https://docs.djangoproject.com/en/2.2/ref/validators/#urlvalidator)
richardreeve commented 2 years ago

I think this is a good idea, but something to implement after we submit along with the slight change to the schema (#124). We need to make sure that we can continue to make updated plots until Monday night :). And I'd go with 1 in the first instance and we can get clever later if we decide it's a good idea...