feat: make metadata/manifest API endpoint publicly accessible without auth #676
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The
/repos/{owner}/{repo}/metadata(and/manifest) GET endpoint currently requiresreqRepoReaderauthentication. It should be accessible anonymously for public repos, similar to how badges work.Motivation
Current Behavior
Anonymous GET to
/api/v1/repos/{owner}/{repo}/metadatareturns 403 even for public repos.Desired Behavior
/metadataand/manifest: No auth required for public repos (anonymous access)/metadataand/manifest: Still requires token + admin (unchanged)Implementation
In
routers/api/v1/api.go~line 1483, change fromComboto separate routes:This removes
reqRepoReaderfrom the GET path. The repo context resolution middleware still handles private vs public repo visibility at a higher level.