Artifact Registry ADR-009: refine API design after follow-up decisions
Why is this change being made?
Work item gitlab-org/gitlab#590367 tracks post-merge refinements to ADR-009 (API Design) for the Artifact Registry. This MR addresses the four open follow-up tasks plus one wording-alignment refinement uncovered while investigating them.
What changed
Each task is a separate commit so the history stays narrative:
-
Drop the OCI
/v2/401 challenge from the routing note — The OCI 401 +WWW-Authenticateredirect challenge is non-viable for the Artifact Registry because AR cannot store or expose customer GitLab instance URLs (see gitlab-org/gitlab#595150). -
Add the three missing npm unpublish routes — Spec S11 (note 3298683845) documents the full
npm unpublishflow perlibnpmpublish/lib/unpublish.js. -
Correct npm audit/advisory paths and methods — Per the same spec S11 review: the npm CLI calls
/-/npm/v1/security/...(not/-/v1/security/...), andaudits/quickisPOST(notGET). -
Polymorphic artifact responses for remote cache state (A.2) — ADR-007's hierarchical remote tables (commit
bb6a356aa5) mirror local. The same artifact endpoints now serve both kinds; onkind=remote, a nestedcachesub-object surfacesupstream_checked_at/upstream_etagfor the rows that track freshness (tags, package files, metadata files).DELETEevicts the cached row on remote, soft/hard-deletes the authored artifact on local. Two commits — the second (A.2) supersedes the first wording-only attempt; the trail is kept in history for context.
Tasks closed on the work item
- Update that
/v2/challenge response is no longer necessary - Update the ADR given that local cache entries are no longer in scope
- NPM missing routes
- NPM audit route
Test plan
- CI doc-lint pipeline green (markdownlint, vale, lychee)
- Reviewers verify the npm route additions/corrections against
libnpmpublish/lib/unpublish.jsand the npm CLI's audit endpoints - Reviewers confirm the wording change on
advisories/bulk(dropped the remote/virtual restriction) is intentional - Reviewers confirm the A.2 polymorphism (nested
cachesub-object on remote artifact responses,DELETE= evict on remote) is the right shape; the alternative was a parallel/cache/...sub-tree