Documentation
¶
Overview ¶
Package enrichment adapts github.com/git-pkgs/enrichment to the proxy's enrichment API. It builds package URLs from the proxy's ecosystem names, normalizes licenses for display and treats retracted versions as yanked.
Index ¶
- type EnrichmentResult
- type PackageInfo
- type Service
- func (s *Service) BulkEnrichPackages(ctx context.Context, packages []struct{ ... }) map[string]*PackageInfo
- func (s *Service) CheckVulnerabilities(ctx context.Context, ecosystem, name, version string) ([]VulnInfo, error)
- func (s *Service) EnrichFull(ctx context.Context, ecosystem, name, version string) (*EnrichmentResult, error)
- func (s *Service) EnrichPackage(ctx context.Context, ecosystem, name string) (*PackageInfo, error)
- func (s *Service) EnrichVersion(ctx context.Context, ecosystem, name, version string) (*VersionInfo, error)
- func (s *Service) GetLatestVersion(ctx context.Context, ecosystem, name string) (string, error)
- type VersionInfo
- type VulnInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnrichmentResult ¶
type EnrichmentResult struct {
Package *PackageInfo
Version *VersionInfo
Vulnerabilities []VulnInfo
IsOutdated bool
LicenseCategory shared.LicenseCategory
}
EnrichmentResult contains all enrichment data for a package version.
type PackageInfo ¶
type PackageInfo = shared.PackageInfo
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service looks up package, version and vulnerability data.
func (*Service) BulkEnrichPackages ¶
func (s *Service) BulkEnrichPackages(ctx context.Context, packages []struct{ Ecosystem, Name string }) map[string]*PackageInfo
BulkEnrichPackages fetches metadata for multiple packages in parallel, keyed by PURL. Packages that can't be fetched are left out.
func (*Service) CheckVulnerabilities ¶
func (s *Service) CheckVulnerabilities(ctx context.Context, ecosystem, name, version string) ([]VulnInfo, error)
CheckVulnerabilities queries for vulnerabilities affecting a package version.
func (*Service) EnrichFull ¶
func (s *Service) EnrichFull(ctx context.Context, ecosystem, name, version string) (*EnrichmentResult, error)
EnrichFull fetches package, version and vulnerability data for a package version concurrently. Unsupported vulnerability identities return an error; other failed lookups are logged and left empty.
func (*Service) EnrichPackage ¶
EnrichPackage fetches metadata for a package from its registry. It returns nil without an error when the registry doesn't have the package or the name can't be expressed as a PURL.
func (*Service) EnrichVersion ¶
func (s *Service) EnrichVersion(ctx context.Context, ecosystem, name, version string) (*VersionInfo, error)
EnrichVersion fetches metadata for a specific package version.
type VersionInfo ¶
type VersionInfo = shared.VersionInfo