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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

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.