mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-11-26 06:37:07 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user