datastore

package
v0.0.0-...-310a971 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package datastore contains definitions of Datastore entities for OSV.dev.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AffectedCommits

type AffectedCommits struct {
	VulnID  string   `datastore:"bug_id"`
	Commits [][]byte `datastore:"commits"`
	Public  bool     `datastore:"public"`
	Page    int      `datastore:"page,noindex"`
}

type AffectedEvent

type AffectedEvent struct {
	Type  string `datastore:"type"`
	Value string `datastore:"value"`
}

type AffectedVersions

type AffectedVersions struct {
	VulnID    string          `datastore:"vuln_id"`
	Ecosystem string          `datastore:"ecosystem"`
	Name      string          `datastore:"name"`
	Versions  []string        `datastore:"versions,noindex"`
	Events    []AffectedEvent `datastore:"events"`
	CoarseMin string          `datastore:"coarse_min"`
	CoarseMax string          `datastore:"coarse_max"`
}

type AliasAllowListEntry

type AliasAllowListEntry struct {
	VulnID string `datastore:"bug_id"`
}

type AliasDenyListEntry

type AliasDenyListEntry struct {
	VulnID string `datastore:"bug_id"`
}

type AliasGroup

type AliasGroup struct {
	VulnIDs  []string  `datastore:"bug_ids"`
	Modified time.Time `datastore:"last_modified"`
}

type ImportFinding

type ImportFinding struct {
	Key         *datastore.Key          `datastore:"__key__"`
	BugID       string                  `datastore:"bug_id"`
	Source      string                  `datastore:"source"`
	Findings    []models.ImportFindings `datastore:"findings"`
	FirstSeen   time.Time               `datastore:"first_seen"`
	LastAttempt time.Time               `datastore:"last_attempt"`
}

type ImportFindingsStore

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

func NewImportFindingsStore

func NewImportFindingsStore(dsClient *datastore.Client, storageClient *storage.Client, bucketName, prefix string) *ImportFindingsStore

func (*ImportFindingsStore) Clear

func (s *ImportFindingsStore) Clear(ctx context.Context, id string) error

func (*ImportFindingsStore) DeleteMulti

func (s *ImportFindingsStore) DeleteMulti(ctx context.Context, bugIDs []string) error

func (*ImportFindingsStore) DeleteResult

func (s *ImportFindingsStore) DeleteResult(ctx context.Context, path string) error

func (*ImportFindingsStore) GetMulti

func (s *ImportFindingsStore) GetMulti(ctx context.Context, bugIDs []string) ([]*models.ImportFinding, error)

func (*ImportFindingsStore) ListIDs

func (s *ImportFindingsStore) ListIDs(ctx context.Context) ([]string, error)

func (*ImportFindingsStore) ListResultSources

func (s *ImportFindingsStore) ListResultSources(ctx context.Context) ([]string, error)

func (*ImportFindingsStore) PutMulti

func (s *ImportFindingsStore) PutMulti(ctx context.Context, findings []*models.ImportFinding) error

func (*ImportFindingsStore) UploadResult

func (s *ImportFindingsStore) UploadResult(ctx context.Context, source string, data []byte) error

type ListedVulnerability

type ListedVulnerability struct {
	Key              *datastore.Key `datastore:"__key__"`
	Published        time.Time      `datastore:"published"`
	Ecosystems       []string       `datastore:"ecosystems"`
	Packages         []string       `datastore:"packages,noindex"`
	Summary          string         `datastore:"summary,noindex"`
	IsFixed          bool           `datastore:"is_fixed,noindex"`
	Severities       []Severity     `datastore:"severities"`
	AutocompleteTags []string       `datastore:"autocomplete_tags"`
	SearchIndices    []string       `datastore:"search_indices"`
}

func NewListedVulnerabilityFromProto

func NewListedVulnerabilityFromProto(vuln *osvschema.Vulnerability) *ListedVulnerability

type RelatedGroup

type RelatedGroup struct {
	Key        *datastore.Key `datastore:"__key__"`
	RelatedIDs []string       `datastore:"related_ids"`
	Modified   time.Time      `datastore:"modified"`
}

type RelationsStore

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

func NewRelationsStore

func NewRelationsStore(client *datastore.Client) *RelationsStore

func (*RelationsStore) GetAliases

func (s *RelationsStore) GetAliases(ctx context.Context, id string) (*models.GetAliasResult, error)

func (*RelationsStore) GetRelated

func (s *RelationsStore) GetRelated(ctx context.Context, id string) (*models.GetRelatedResult, error)

func (*RelationsStore) GetUpstream

func (s *RelationsStore) GetUpstream(ctx context.Context, id string) (*models.GetUpstreamResult, error)

type Severity

type Severity struct {
	Type  string `datastore:"type"`
	Score string `datastore:"score"`
}

type SourceRepository

type SourceRepository struct {
	Type                    models.SourceRepositoryType `datastore:"type"`
	Name                    string                      `datastore:"name"`
	RepoURL                 string                      `datastore:"repo_url"`
	RepoUsername            string                      `datastore:"repo_username"`
	RepoBranch              string                      `datastore:"repo_branch"`
	RESTAPIURL              string                      `datastore:"rest_api_url"`
	Bucket                  string                      `datastore:"bucket"`
	DirectoryPath           string                      `datastore:"directory_path"`
	LastSyncedHash          string                      `datastore:"last_synced_hash"`
	LastUpdateDate          *time.Time                  `datastore:"last_update_date"`
	IgnorePatterns          []string                    `datastore:"ignore_patterns"`
	Editable                bool                        `datastore:"editable"`
	Extension               string                      `datastore:"extension"`
	KeyPath                 string                      `datastore:"key_path"`
	AcceptedEcosystems      []string                    `datastore:"accepted_ecosystems"`
	IgnoreGit               bool                        `datastore:"ignore_git"`
	DetectCherrypicks       bool                        `datastore:"detect_cherrypicks"`
	ConsiderAllBranches     bool                        `datastore:"consider_all_branches"`
	VersionsFromRepo        bool                        `datastore:"versions_from_repo"`
	IgnoreLastImportTime    bool                        `datastore:"ignore_last_import_time"`
	IgnoreDeletionThreshold bool                        `datastore:"ignore_deletion_threshold"`
	Link                    string                      `datastore:"link"`
	HumanLink               string                      `datastore:"human_link"`
	DBPrefix                []string                    `datastore:"db_prefix"`
	StrictValidation        bool                        `datastore:"strict_validation"`
	WorkPool                string                      `datastore:"work_pool"`
}

type SourceRepositoryStore

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

func NewSourceRepositoryStore

func NewSourceRepositoryStore(client *datastore.Client) *SourceRepositoryStore

func (*SourceRepositoryStore) All

func (*SourceRepositoryStore) Get

func (*SourceRepositoryStore) Update

type UpstreamGroup

type UpstreamGroup struct {
	Key               *datastore.Key `datastore:"__key__"`
	VulnID            string         `datastore:"db_id"`
	UpstreamIDs       []string       `datastore:"upstream_ids"`
	Modified          time.Time      `datastore:"last_modified"`
	UpstreamHierarchy []byte         `datastore:"upstream_hierarchy,noindex"`
}

type VulnStoreConfig

type VulnStoreConfig struct {
	Client               *datastore.Client
	GCS                  clients.CloudStorage
	FailedWritePublisher clients.Publisher
}

type Vulnerability

type Vulnerability struct {
	Key         *datastore.Key `datastore:"__key__"`
	SourceID    string         `datastore:"source_id"`
	Modified    time.Time      `datastore:"modified"`
	IsWithdrawn bool           `datastore:"is_withdrawn"`
	ModifiedRaw time.Time      `datastore:"modified_raw"`
	AliasRaw    []string       `datastore:"alias_raw"`
	RelatedRaw  []string       `datastore:"related_raw"`
	UpstreamRaw []string       `datastore:"upstream_raw"`
}

type VulnerabilityStore

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

func NewVulnerabilityStore

func NewVulnerabilityStore(cfg VulnStoreConfig) *VulnerabilityStore

func (*VulnerabilityStore) Get

func (*VulnerabilityStore) GetSourceModified

func (s *VulnerabilityStore) GetSourceModified(ctx context.Context, id string) (time.Time, error)

func (*VulnerabilityStore) GetWithMetadata

func (*VulnerabilityStore) ListBySource

func (s *VulnerabilityStore) ListBySource(ctx context.Context, source string, skipWithdrawn bool) iter.Seq2[*models.VulnSourceRef, error]

func (*VulnerabilityStore) Write

Directories

Path Synopsis
internal
validate command
Package main reads datastore records that were created by the validate.py python script.
Package main reads datastore records that were created by the validate.py python script.

Jump to

Keyboard shortcuts

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