Versions in this module Expand all Collapse all v0 v0.0.1 May 15, 2024 Changes in this version + const OSVSchema + var ErrNoPackageSecurityData = errors.New("no package security data found") + var ErrorPackageCollision = errors.New("found multiple advisory documents for the same package") + func BuildSecurityDatabase(ctx context.Context, opts BuildSecurityDatabaseOptions) ([]byte, error) + func Create(ctx context.Context, req Request, opts CreateOptions) error + func Discover(ctx context.Context, opts DiscoverOptions) error + func DiscoverAliases(ctx context.Context, opts DiscoverAliasesOptions) error + func ExportCSV(opts ExportOptions) (io.Reader, error) + func ExportOSV(opts ExportOptions, output string) error + func ExportYAML(opts ExportOptions) (io.Reader, error) + func ImporAdvisoriesYAML(inputData []byte) (tempDir string, documents *configs.Index[v2.Document], err error) + func Update(ctx context.Context, req Request, opts UpdateOptions) error + func Validate(ctx context.Context, opts ValidateOptions) error + type AliasFinder interface + CVEForGHSA func(ctx context.Context, ghsaID string) (string, error) + GHSAsForCVE func(ctx context.Context, cveID string) ([]string, error) + type BuildSecurityDatabaseOptions struct + AdvisoryDocIndices []*configs.Index[v2.Document] + Archs []string + Repo string + URLPrefix string + type CreateOptions struct + AdvisoryDocs *configs.Index[v2.Document] + type DataSession struct + func NewDataSession(ctx context.Context, opts DataSessionOptions) (*DataSession, error) + func (ds *DataSession) Append(ctx context.Context, req Request) error + func (ds *DataSession) Create(ctx context.Context, req Request) error + func (ds *DataSession) Update(ctx context.Context, req Request) error + func (ds DataSession) Close() error + func (ds DataSession) Dir() string + func (ds DataSession) Index() *configs.Index[v2.Document] + func (ds DataSession) Modified() bool + func (ds DataSession) OpenPullRequest(ctx context.Context) (*PullRequest, error) + func (ds DataSession) Push(ctx context.Context) error + type DataSessionOptions struct + Distro distro.Distro + GitHubClient *github.Client + type DiffResult struct + Added v2.Advisory + AddedEvents []v2.Event + ID string + Removed v2.Advisory + RemovedEvents []v2.Event + func (r DiffResult) IsZero() bool + type DiscoverAliasesOptions struct + AdvisoryDocs *configs.Index[v2.Document] + AliasFinder AliasFinder + SelectedPackages map[string]struct{} + type DiscoverOptions struct + AdvisoryDocs *configs.Index[v2.Document] + Arches []string + BuildCfgs *configs.Index[config.Configuration] + PackageRepositoryURL string + SelectedPackages []string + VulnEvents chan<- interface{} + VulnerabilityDetector vuln.Detector + type DocumentDiffResult struct + Added v2.Advisories + Modified []DiffResult + Name string + Removed v2.Advisories + func (r DocumentDiffResult) IsZero() bool + type DuplicateAdvisoryIDError struct + AdvisoryID string + Package string + func (e DuplicateAdvisoryIDError) Error() string + type EventDiffResult struct + Added v2.Event + ID string + Removed v2.Event + type ExportOptions struct + AdvisoryDocIndices []*configs.Index[v2.Document] + Ecosystem models.Ecosystem + type HTTPAliasFinder struct + func NewHTTPAliasFinder(client *http.Client) *HTTPAliasFinder + func NewHTTPAliasFinderWithToken(client *http.Client, ghToken string) *HTTPAliasFinder + func (f *HTTPAliasFinder) CVEForGHSA(ctx context.Context, ghsaID string) (string, error) + func (f *HTTPAliasFinder) GHSAsForCVE(ctx context.Context, cveID string) ([]string, error) + type IndexDiffResult struct + Added []v2.Document + Modified []DocumentDiffResult + Removed []v2.Document + func IndexDiff(a, b *configs.Index[v2.Document]) IndexDiffResult + func (r IndexDiffResult) IsZero() bool + type PullRequest struct + URL string + type Request struct + Aliases []string + Event v2.Event + Package string + VulnerabilityID string + func (req Request) ResolveAliases(ctx context.Context, af AliasFinder) (*Request, error) + func (req Request) Validate() error + type UpdateOptions struct + AdvisoryDocs *configs.Index[v2.Document] + type ValidateOptions struct + APKIndex *apk.APKIndex + AdvisoryDocs *configs.Index[v2.Document] + AliasFinder AliasFinder + BaseAdvisoryDocs *configs.Index[v2.Document] + Now time.Time + PackageConfigurations *configs.Index[config.Configuration] + SelectedPackages map[string]struct{}