Skip to content

Add new endpoints to generate swh badges

Add endpoints /badge/(object_type)/(object_id)/ and /badge/(object_pid)/ to generate Github style like SVG badges for linking to the archive in a README file.

Those new endpoints add CORS header to the HTTP responses in order to be used from a different domain than *.softwareheritage.org ones.

Below is a preview of the generated badges according to swh object type:

  • origin: origin_badge
  • content: content_badge
  • directory: directory_badge
  • release: release_badge
  • revision: revision_badge
  • snapshot: snapshot_badge

Colors and texts might still be improved.

Related to #2090 (closed)

Test Plan

Tests checking the badges are well-formed but also checking HTTP status codes when an error occurs have been added.


Migrated from D2310 (view on Phabricator)

Merge request reports