harbor

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	Repository string `json:"repository"`
	Digest     string `json:"digest"`
	MimeType   string `json:"mime_type,omitempty"`
}

type CVSSInfo added in v0.14.0

type CVSSInfo struct {
	V2Vector string  `json:"v2_vector,omitempty"`
	V3Vector string  `json:"v3_vector,omitempty"`
	V2Score  float32 `json:"v2_score,omitempty"`
	V3Score  float32 `json:"v3_score,omitempty"`
}

type Capability

type Capability struct {
	ConsumesMIMETypes []string `json:"consumes_mime_types"`
	ProducesMIMETypes []string `json:"produces_mime_types"`
}

type Error

type Error struct {
	HTTPCode int    `json:"-"`
	Message  string `json:"message"`
}

Error holds the information about an error, including metadata about its JSON structure.

type Layer added in v0.9.0

type Layer struct {
	Digest string `json:"digest,omitempty"`
	DiffID string `json:"diff_id,omitempty"`
}

type Registry

type Registry struct {
	URL           string `json:"url"`
	Authorization string `json:"authorization"`
}

type ScanReport

type ScanReport struct {
	GeneratedAt     time.Time           `json:"generated_at"`
	Artifact        Artifact            `json:"artifact"`
	Scanner         Scanner             `json:"scanner"`
	Severity        Severity            `json:"severity"`
	Vulnerabilities []VulnerabilityItem `json:"vulnerabilities"`
}

type ScanRequest

type ScanRequest struct {
	Registry Registry `json:"registry"`
	Artifact Artifact `json:"artifact"`
}

func (ScanRequest) GetImageRef

func (c ScanRequest) GetImageRef() (imageRef string, insecureRegistry bool, err error)

GetImageRef returns Docker image reference for this ScanRequest. Example: core.harbor.domain/scanners/mysql@sha256:3b00a364fb74246ca119d16111eb62f7302b2ff66d51e373c2bb209f8a1f3b9e

type ScanResponse

type ScanResponse struct {
	ID string `json:"id"`
}

type Scanner

type Scanner struct {
	Name    string `json:"name"`
	Vendor  string `json:"vendor"`
	Version string `json:"version"`
}

type ScannerAdapterMetadata

type ScannerAdapterMetadata struct {
	Scanner      Scanner           `json:"scanner"`
	Capabilities []Capability      `json:"capabilities"`
	Properties   map[string]string `json:"properties"`
}

type Severity

type Severity int64

Severity represents the severity of a image/component in terms of vulnerability.

const (
	SevUnknown Severity
	SevLow
	SevMedium
	SevHigh
	SevCritical
)

Sevxxx is the list of severity of image after scanning.

func (Severity) MarshalJSON

func (s Severity) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Severity enum value as a quoted JSON string.

func (Severity) String

func (s Severity) String() string

func (*Severity) UnmarshalJSON

func (s *Severity) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals quoted JSON string to the Severity enum value.

type VulnerabilityItem

type VulnerabilityItem struct {
	ID          string              `json:"id"`
	Pkg         string              `json:"package"`
	Version     string              `json:"version"`
	FixVersion  string              `json:"fix_version,omitempty"`
	Severity    Severity            `json:"severity"`
	Description string              `json:"description"`
	Links       []string            `json:"links"`
	Layer       *Layer              `json:"layer"`
	CVSS        map[string]CVSSInfo `json:"cvss,omitempty"`
	CweIDs      []string            `json:"cwe_ids,omitempty"`
}

VulnerabilityItem is an item in the vulnerability result returned by vulnerability details API.

Jump to

Keyboard shortcuts

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