feat: Add API endpoint to look up versions by integrity hash#1659
Open
abhinavgautam01 wants to merge 1 commit into
Open
feat: Add API endpoint to look up versions by integrity hash#1659abhinavgautam01 wants to merge 1 commit into
abhinavgautam01 wants to merge 1 commit into
Conversation
Fixes ecosyste-ms#1631 - Adds concurrent B-tree index on versions.integrity - Adds GET /api/v1/versions/lookup endpoint - Supports exact matching and normalizes hex digests into SRI format - Adds standalone OpenAPI documentation and payload view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #1631
depends on #1630...
Description
this PR introduces a new endpoint to find versions by their artifact hash (
integrity). this is particularly useful for identifying a package from a tarball hash or cross-referencing the same artifact published across multiple registries...Changes Made
versions.integrity(WHERE integrity IS NOT NULL) to support performant lookups across the large table without locking it during migration...GET /api/v1/versions/lookupin theVersionsController. It handles exactintegrity(SRI format) matches and normalizes bare hex digests provided viasha256,sha1, andsha512query parameters.lookup.json.jbuilderto structure the JSON response cleanly, ensuring the parent package and registry details are nested so the response is usable standalone.openapi/api/v1/openapi.yamlto document the new/versions/lookupendpoint and its schema parameters.