Skip to content

common/service: Add lookup_object function

Add an utility function for looking up an object in the archive by its type and id. Supported object types are: content, directory, release, revision and snapshot.

Its purpose is to factorize some code that will be needed in the upcoming swh badge endpoints implementation. Notably, it enables to check that an object exists in the archive in order to return adequate HTTP status code.

Related to #2090 (closed)

Test Plan

Nex tests have been added.


Migrated from D2309 (view on Phabricator)

Merge request reports