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
@@ -203,7 +203,7 @@ func (s *Store) ClearArtifactExpiry(ctx context.Context) (int64, error) {
}
var cleared int64
for _, p := range all {
if p.Registry == "" || p.Name == "" || p.ExpiresAt == nil || metadata.IsMetadataEntry(p.Name, p.Version) {
if p.Registry == "" || p.Name == "" || p.ExpiresAt == nil || metadata.IsMetadataEntry(p.Registry, p.Name, p.Version) {
continue
}
p.ExpiresAt = nil