packages

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package packages registers the `safedep package` domain. Today it hosts on-demand package scanning (`package scan`) backed by the control-plane PackageScanService. The domain noun is deliberately generic: a package is any external software component in a supported ecosystem (OSS libraries, IDE/editor extensions, and more), not only OSS libraries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(root *cobra.Command, a *app.App)

Register wires the package command tree onto root.

Types

type FileEvidence

type FileEvidence struct {
	File       string
	Line       int32
	Title      string
	Behavior   string
	Details    string
	Confidence string
}

type Indicator added in v0.4.0

type Indicator struct {
	Type  string
	Value string
	Note  string
}

Indicator is a user-actionable indicator of compromise from the report.

type ListInput

type ListInput struct {
	// Target filters the listing to one package version. Nil means no filter.
	Target    *packagev1.PackageVersion
	PageSize  uint32
	PageToken string
}

type ListResult

type ListResult struct {
	Scans    []Scan
	NextPage string
}

type ProjectEvidence

type ProjectEvidence struct {
	Project    string
	URL        string
	Title      string
	Behavior   string
	Details    string
	Confidence string
}

type Report

type Report struct {
	Scan
	ReportID         string
	AnalyzedAt       time.Time
	Summary          string
	Details          string
	IsMalware        bool
	FileEvidences    []FileEvidence
	ProjectEvidences []ProjectEvidence
	Indicators       []Indicator
	Warnings         []string
}

Report is the full analysis of a completed scan. It embeds the headline so renderers get identity and verdict alongside the evidence.

type Scan

type Scan struct {
	ScanID      string
	Ecosystem   string
	Name        string
	Version     string
	Status      string
	Verdict     string
	Confidence  float64
	Failure     string
	FailureCode string
	CreatedAt   time.Time
	CompletedAt time.Time
}

Scan is the headline record shared by get, list and the run result. It carries no report; verdict is empty until the scan is completed.

type ScanGetter

type ScanGetter interface {
	Get(ctx context.Context, scanID string) (*Scan, error)
}

type ScanLister

type ScanLister interface {
	List(ctx context.Context, in ListInput) (*ListResult, error)
}

type ScanReportGetter

type ScanReportGetter interface {
	GetReport(ctx context.Context, scanID string) (*Report, error)
}

type ScanSubmitter

type ScanSubmitter interface {
	Submit(ctx context.Context, in SubmitInput) (*SubmitResult, error)
}

type Service

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

func NewService

func NewService(conn *grpc.ClientConn) *Service

func (*Service) Get

func (s *Service) Get(ctx context.Context, scanID string) (*Scan, error)

func (*Service) GetReport

func (s *Service) GetReport(ctx context.Context, scanID string) (*Report, error)

func (*Service) List

func (s *Service) List(ctx context.Context, in ListInput) (*ListResult, error)

func (*Service) Submit

func (s *Service) Submit(ctx context.Context, in SubmitInput) (*SubmitResult, error)

type SubmitInput

type SubmitInput struct {
	Target         *packagev1.PackageVersion
	IdempotencyKey string
}

type SubmitResult

type SubmitResult struct {
	ScanID string
	Status string
}

Jump to

Keyboard shortcuts

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