supplychain

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package supplychain implements the package-age supply-chain filter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allowlist

type Allowlist struct {
	// contains filtered or unexported fields
}

Allowlist holds explicitly approved packages that bypass the age check. Entry format: "ecosystem/name" (all versions) or "ecosystem/name@version" (specific).

func LoadAllowlist

func LoadAllowlist(path string) (*Allowlist, error)

LoadAllowlist reads an allowlist file and returns an *Allowlist. Each non-blank, non-comment line is one entry: "ecosystem/name" or "ecosystem/name@version". Lines beginning with '#' and blank lines are ignored; entries are whitespace-trimmed.

func NewAllowlist

func NewAllowlist(entries []string) *Allowlist

NewAllowlist creates an Allowlist from a slice of entry strings.

func (*Allowlist) Contains

func (a *Allowlist) Contains(ref *gate.PackageRef) bool

Contains reports whether ref is covered by the allowlist.

func (*Allowlist) Entries

func (a *Allowlist) Entries() []string

Entries returns a sorted copy of the allowlist entries, for merging with runtime-added entries. Nil-safe.

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

Filter implements the supply chain package age check.

func NewFilter

func NewFilter(cfg config.SupplyChainConfig, allowlist *Allowlist) *Filter

NewFilter creates a Filter with the given configuration and allowlist.

func (*Filter) Check

Check applies the supply chain filter. The caller must provide pre-fetched PackageMetadata. No network calls are made inside Check.

type FilterResult

type FilterResult = gate.FilterResult

FilterResult is an alias for gate.FilterResult kept here for backward compatibility. New code should use gate.FilterResult directly.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL