xray

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InternalServerError = errors.New("internal server error")
	ErrNotFound         = errors.New("not found")
	ErrConfict          = errors.New("conflict")
	ErrBadRequest       = errors.New("bad request")
)

Functions

func CheckError

func CheckError(code int) error

func ErrorIs

func ErrorIs(expected, actual error) bool

Types

type Client

type Client interface {
	GetReleaseBundleSBOM(ctx context.Context, name, version string) (CycloneDXReport, error)
	GetReleaseBundleSBOMRaw(ctx context.Context, name, version string) (json.RawMessage, error)
}

func NewClient

func NewClient(artifactory_url string, token string) (Client, error)

type ComponentDetails

type ComponentDetails struct {
	ComponentLicences []ComponentLicences `json:"licenses"`
}

type ComponentDetailsRequest

type ComponentDetailsRequest struct {
	ComponentName            string `json:"component_name,omitempty"`             // "image:tag",
	PackageType              string `json:"package_type,omitempty"`               // "build | releaseBundle | docker | debian | npm | rpm | go | pypi | conan | terraform | alpine | nuget | cran | conan | maven",
	Sha256                   string `json:"sha_256,omitempty"`                    //: "1d36301476dc57eb479e03d9e37a885dd751a6e6979f6f916a92c10cb7520e4e",
	Violations               bool   `json:"violations,omitempty"`                 // true | false,
	IncludeIgnoredViolations bool   `json:"include_ignored_violations,omitempty"` // true | false
	License                  bool   `json:"license,omitempty"`                    // true | false,
	ExcludeUnknown           bool   `json:"exclude_unknown,omitempty"`            // true | false,
	Security                 bool   `json:"security,omitempty"`                   // true | false,
	MaliciousCode            bool   `json:"malicious_code,omitempty"`             // true | false,
	Iac                      bool   `json:"iac,omitempty"`                        // true | false,
	Services                 bool   `json:"services,omitempty"`                   // true | false,
	Applications             bool   `json:"applications,omitempty"`               // true | false,
	OutputFormat             string `json:"output_format,omitempty"`              // "pdf | csv | json | json_full",
	Spdx                     bool   `json:"spdx,omitempty"`                       // true | false,
	SpdxFormat               string `json:"spdx_format,omitempty"`                // "json | tag:value | xlsx",
	Cyclonedx                bool   `json:"cyclonedx,omitempty"`                  // true | false,
	CyclonedxFormat          string `json:"cyclonedx_format,omitempty"`           // "json | xml"
}

type ComponentLicences

type ComponentLicences struct {
	ComponentID   string `json:"component_id"`
	ComponentName string `json:"component_name"`
	Version       string `json:"version"`
	PkgType       string `json:"pkg_type"`
	PackageID     string `json:"package_id"`
	Licenses      []struct {
		Key     string `json:"key"`
		Link    string `json:"link"`
		Sources []struct {
			Source      string `json:"source"`
			Occurrences int    `json:"occurrences"`
		} `json:"sources"`
	} `json:"licenses"`
}

type CycloneDXReport

type CycloneDXReport struct {
	BomFormat    string `json:"bomFormat"`
	SpecVersion  string `json:"specVersion"`
	SerialNumber string `json:"serialNumber"`
	Version      int    `json:"version"`
	Metadata     struct {
		Timestamp time.Time `json:"timestamp"`
		Tools     []struct {
			Vendor  string `json:"vendor"`
			Name    string `json:"name"`
			Version string `json:"version"`
		} `json:"tools"`
		Component struct {
			Type    string `json:"type"`
			Name    string `json:"name"`
			Version string `json:"version"`
		} `json:"component"`
	} `json:"metadata"`
	Components      []CycloneDXReportComponent       `json:"components"`
	Vulnerabilities []CycloneDXReportVulnerabilities `json:"vulnerabilities"`
}

type CycloneDXReportComponent

type CycloneDXReportComponent struct {
	BomRef  string `json:"bom-ref"`
	Type    string `json:"type"`
	Name    string `json:"name"`
	Version string `json:"version,omitempty"`
	Hashes  []struct {
		Alg     string `json:"alg"`
		Content string `json:"content"`
	} `json:"hashes,omitempty"`
	Licenses []struct {
		License struct {
			ID  string `json:"id"`
			URL string `json:"url"`
		} `json:"license"`
	} `json:"licenses"`
	Purl string `json:"purl"`
}

type CycloneDXReportVulnerabilities

type CycloneDXReportVulnerabilities struct {
	BomRef   string `json:"bom-ref"`
	ID       string `json:"id"`
	Analysis struct {
		State  string `json:"state"`
		Detail string `json:"detail"`
	} `json:"analysis,omitempty"`
}

Directories

Path Synopsis
Package mock_xray is a generated GoMock package.
Package mock_xray is a generated GoMock package.

Jump to

Keyboard shortcuts

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