fix(cache): scan npm and PyPI packages named like Go metadata

IsMetadataEntry treated any name ending in .mod or .info as metadata. An npm or PyPI package with such a name skipped the vulnerability scan and was never blocked. The suffix rule now applies to the go registry only.
This commit is contained in:
2026-11-23 13:15:34 +00:00
parent 7192e4ff3e
commit f0b37ea719
8 changed files with 134 additions and 17 deletions
+1 -1
View File
@@ -197,7 +197,7 @@ func (m *memMetadata) ClearArtifactExpiry(context.Context) (int64, error) {
defer m.mu.Unlock()
var n int64
for _, p := range m.pkgs {
if p.ExpiresAt != nil && !metadata.IsMetadataEntry(p.Name, p.Version) {
if p.ExpiresAt != nil && !metadata.IsMetadataEntry(p.Registry, p.Name, p.Version) {
p.ExpiresAt = nil
n++
}