Documentation
¶
Index ¶
- func HasQuarantineCacheEntry(cacheDir, ecosystem, name string) bool
- func IsNPMSecurityVersion(ecosystem, version string) bool
- func IsQuarantinedCached(cacheDir, ecosystem, name string) bool
- func NPMRegistryBaseForTest() string
- func PackagePageURL(ecosystem, name string) string
- func QuarantineCachePath(cacheDir string) string
- func RefreshNPMQuarantineCache(ctx context.Context, cacheDir, userAgent string, timeout time.Duration, ...)
- func SetNPMRegistryBaseForTest(base string)
- func SetQuarantined(cacheDir, ecosystem, name string, quarantined bool) error
- type Client
- func (c *Client) Exists(ctx context.Context, ecosystem, name, version string) (bool, error)
- func (c *Client) FindInEcosystems(ctx context.Context, name, version string, ecosystems []string) []string
- func (c *Client) IsNPMSecurityHolding(ctx context.Context, name string) (bool, error)
- func (c *Client) ShouldSkipPlaceholder(ctx context.Context, ecosystem, name, version string) (bool, error)
- func (c *Client) Status(ctx context.Context, pkg ref.PackageRef) (*Status, error)
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasQuarantineCacheEntry ¶
HasQuarantineCacheEntry reports whether npm holding status was checked before.
func IsNPMSecurityVersion ¶
IsNPMSecurityVersion reports whether version is npm's *-security stub suffix.
func IsQuarantinedCached ¶
IsQuarantinedCached reports whether npm package name is known quarantined on disk.
func NPMRegistryBaseForTest ¶
func NPMRegistryBaseForTest() string
NPMRegistryBaseForTest returns the npm registry base URL.
func PackagePageURL ¶
PackagePageURL returns a human-facing registry page for a package, if known.
func QuarantineCachePath ¶
func RefreshNPMQuarantineCache ¶
func RefreshNPMQuarantineCache(ctx context.Context, cacheDir, userAgent string, timeout time.Duration, names []string)
RefreshNPMQuarantineCache checks npm holding status for names and persists results.
func SetNPMRegistryBaseForTest ¶
func SetNPMRegistryBaseForTest(base string)
SetNPMRegistryBaseForTest overrides the npm registry base URL in tests.
func SetQuarantined ¶
SetQuarantined persists quarantine status for an npm package.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Exists ¶
Exists reports whether a package name is published in the given ecosystem registry.
func (*Client) FindInEcosystems ¶
func (c *Client) FindInEcosystems(ctx context.Context, name, version string, ecosystems []string) []string
FindInEcosystems returns ecosystems where the package name exists in the registry.
func (*Client) IsNPMSecurityHolding ¶
IsNPMSecurityHolding reports whether npm registry publishes only *-security placeholder version(s) for name (takedown holding package).