Page MenuHomeSoftware Heritage

Raise an exception when trying to resolve an origin pid input
ClosedPublic

Authored by anlambert on Jan 15 2020, 2:12 PM.

Details

Summary

Origin persistent identifiers are not publicly resolvable as they are not intrinsic.

So raise an exception to get a 400 error code in concerned endpoints.

Diff Detail

Repository
rDWAPPS Web applications
Branch
origin-pid-not-resolvable
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10133
Build 15028: Cypress tests for swh-web diffsJenkins
Build 15027: tox-on-jenkinsJenkins
Build 15026: arc lint + arc unit

Event Timeline

vlorentz added inline comments.
swh/web/common/utils.py
289–291

I think because they are not intrinsic is more confusing than not.

What about Origin PIDs (Persistent Identifiers) are for internal usage only?

swh/web/common/utils.py
289–291

Indeed, this is simpler to understand.

Update: Simplify exception message.

This revision is now accepted and ready to land.Jan 15 2020, 2:52 PM
This revision was landed with ongoing or failed builds.Jan 15 2020, 3:20 PM
This revision was automatically updated to reflect the committed changes.