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

anlambert created this revision.Jan 15 2020, 2:12 PM
vlorentz added inline comments.
swh/web/common/utils.py
290–292

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

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

anlambert added inline comments.Jan 15 2020, 2:38 PM
swh/web/common/utils.py
290–292

Indeed, this is simpler to understand.

anlambert updated this revision to Diff 9017.Jan 15 2020, 2:41 PM

Update: Simplify exception message.

vlorentz accepted this revision.Jan 15 2020, 2:52 PM
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.