Page MenuHomeSoftware Heritage

Make snapshot query parameter mandatory when browsing objects in an origin context
Closed, MigratedEdits Locked

Description

swh-web views for browsing objects from their sha1 identifiers (for instance /browse/directory/<sha1_git>/) can take an origin_url
query parameter enabling to add contextual information about the origin they were found.

Nevertheless, it is easy to generate a view with false information when playing with that parameter as currently we do not have a reliable and fast way
(until swh-graph or swh-provenance can be used with confidence in production) to check that an object can be found from that origin.
For instance, that directory view can be fakely attached to a totally unrelated origin by simply changing the value of the origin_url parameter.

As an improvement until swh-graph or swh-provenance can be used, we should make the snapshot query parameter mandatory
when the origin_url one is provided as this would enforce the validity of the origin browsing context.

This not a perfect solution but this would make the task of generating falsy views more tedious.