services

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 13 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinMgrService added in v0.20.1

type BinMgrService struct {
	XrayDetails auth.ServiceDetails
	// contains filtered or unexported fields
}

BinMgrService defines the http client and Xray details

func NewBinMgrService added in v0.20.1

func NewBinMgrService(client *jfroghttpclient.JfrogHttpClient) *BinMgrService

NewBinMgrService creates a new Xray Binary Manager Service

func (*BinMgrService) AddBuildsToIndexing added in v0.20.1

func (xbms *BinMgrService) AddBuildsToIndexing(buildNames []string) error

AddBuildsToIndexing will add builds to indexing configuration

func (*BinMgrService) GetJfrogHttpClient added in v0.20.1

func (xbms *BinMgrService) GetJfrogHttpClient() *jfroghttpclient.JfrogHttpClient

GetJfrogHttpClient returns the http client

func (*BinMgrService) GetXrayDetails added in v0.20.1

func (xbms *BinMgrService) GetXrayDetails() auth.ServiceDetails

GetXrayDetails returns the Xray details

type Component added in v0.25.0

type Component struct {
	FixedVersions []string `json:"fixed_versions,omitempty"`
	ImpactPaths   []string `json:"impact_paths,omitempty"`
}

type Cve added in v0.25.0

type Cve struct {
	Id           string `json:"cve,omitempty"`
	CvssV2Score  string `json:"cvss_v2_score,omitempty"`
	CvssV2Vector string `json:"cvss_v2_vector,omitempty"`
	CvssV3Score  string `json:"cvss_v3_score,omitempty"`
	CvssV3Vector string `json:"cvss_v3_vector,omitempty"`
}

type GraphNode added in v0.25.0

type GraphNode struct {
	// Component Id in the JFrog standard.
	// For instance, for maven: gav://<groupId>:<artifactId>:<version>
	// For detailed format examples please see:
	// https://www.jfrog.com/confluence/display/JFROG/Xray+REST+API#XrayRESTAPI-ComponentIdentifiers
	Id string `json:"component_id,omitempty"`
	// Sha of the binary representing the component.
	Sha256 string `json:"sha256,omitempty"`
	Sha1   string `json:"sha1,omitempty"`
	// For root file shall be the file name.
	// For internal components shall be the internal path. (Relevant only for binary scan).
	Path string `json:"path,omitempty"`
	// List of license names
	Licenses []string `json:"licenses,omitempty"`
	// List of sub components.
	Nodes []*GraphNode `json:"nodes,omitempty"`
}

type License added in v0.25.0

type License struct {
	Key        string               `json:"key,omitempty"`
	Name       string               `json:"name,omitempty"`
	Components map[string]Component `json:"components,omitempty"`
	Custom     bool                 `json:"custom,omitempty"`
	References []string             `json:"references,omitempty"`
}

type PolicyAlreadyExistsError added in v0.21.0

type PolicyAlreadyExistsError struct {
	InnerError error
}

func (*PolicyAlreadyExistsError) Error added in v0.21.0

type PolicyService added in v0.20.1

type PolicyService struct {
	XrayDetails auth.ServiceDetails
	// contains filtered or unexported fields
}

PolicyService defines the http client and Xray details

func NewPolicyService added in v0.20.1

func NewPolicyService(client *jfroghttpclient.JfrogHttpClient) *PolicyService

NewPolicyService creates a new Xray Policy Service

func (*PolicyService) Create added in v0.20.1

func (xps *PolicyService) Create(params utils.PolicyParams) error

Create will create a new Xray policy

func (*PolicyService) Delete added in v0.20.1

func (xps *PolicyService) Delete(policyName string) error

Delete will delete an existing policy by name It will error if no policy can be found by that name.

func (*PolicyService) Get added in v0.20.1

func (xps *PolicyService) Get(policyName string) (policyResp *utils.PolicyParams, err error)

Get retrieves the details about an Xray policy by its name It will error if no policy can be found by that name.

func (*PolicyService) GetJfrogHttpClient added in v0.20.1

func (xps *PolicyService) GetJfrogHttpClient() *jfroghttpclient.JfrogHttpClient

GetJfrogHttpClient returns the http client

func (*PolicyService) GetXrayDetails added in v0.20.1

func (xps *PolicyService) GetXrayDetails() auth.ServiceDetails

GetXrayDetails returns the Xray details

func (*PolicyService) Update added in v0.20.1

func (xps *PolicyService) Update(params utils.PolicyParams) error

Update will update an existing Xray policy by name It will error if no policy can be found by that name.

type RequestScanResponse added in v0.25.0

type RequestScanResponse struct {
	ScanId string `json:"scan_id,omitempty"`
}

type ScanResponse added in v0.25.0

type ScanResponse struct {
	ScanId          string          `json:"scan_id,omitempty"`
	Violations      []Violation     `json:"violations,omitempty"`
	Vulnerabilities []Vulnerability `json:"vulnerabilities,omitempty"`
	Licenses        []License       `json:"licenses,omitempty"`
}

type ScanService added in v0.25.0

type ScanService struct {
	XrayDetails    auth.ServiceDetails
	MaxWaitMinutes time.Duration
	// contains filtered or unexported fields
}

func NewScanService added in v0.25.0

func NewScanService(client *jfroghttpclient.JfrogHttpClient) *ScanService

NewScanService creates a new service to scan Binaries and VCS projects.

func (*ScanService) GetScanGraphResults added in v0.25.0

func (ss *ScanService) GetScanGraphResults(scanId string) (*ScanResponse, error)

func (*ScanService) ScanGraph added in v0.25.0

func (ss *ScanService) ScanGraph(scanParams XrayGraphScanParams) (string, error)

type VersionService

type VersionService struct {
	XrayDetails auth.ServiceDetails
	// contains filtered or unexported fields
}

VersionService returns the https client and Xray details

func NewVersionService

func NewVersionService(client *jfroghttpclient.JfrogHttpClient) *VersionService

NewVersionService creates a new service to retrieve the version of Xray

func (*VersionService) GetVersion

func (vs *VersionService) GetVersion() (string, error)

GetVersion returns the version of Xray

func (*VersionService) GetXrayDetails

func (vs *VersionService) GetXrayDetails() auth.ServiceDetails

GetXrayDetails returns the Xray details

type Violation added in v0.25.0

type Violation struct {
	Summary       string               `json:"summary,omitempty"`
	Severity      string               `json:"severity,omitempty"`
	ViolationType string               `json:"type,omitempty"`
	Components    map[string]Component `json:"components,omitempty"`
	WatchName     string               `json:"watch_name,omitempty"`
	IssueId       string               `json:"issue_id,omitempty"`
	Cves          []Cve                `json:"cves,omitempty"`
	References    []string             `json:"references,omitempty"`
	FailBuild     bool                 `json:"fail_build,omitempty"`
	LicenseKey    string               `json:"license_key,omitempty"`
	LicenseName   string               `json:"license_name,omitempty"`
	IgnoreUrl     string               `json:"ignore_url,omitempty"`
}

type Vulnerability added in v0.25.0

type Vulnerability struct {
	Cves                 []Cve                `json:"cves,omitempty"`
	Summary              string               `json:"summary,omitempty"`
	Severity             string               `json:"severity,omitempty"`
	VulnerableComponents []string             `json:"vulnerable_components,omitempty"`
	Components           map[string]Component `json:"components,omitempty"`
}

type WatchAlreadyExistsError added in v0.21.0

type WatchAlreadyExistsError struct {
	InnerError error
}

func (*WatchAlreadyExistsError) Error added in v0.21.0

type WatchService

type WatchService struct {
	XrayDetails auth.ServiceDetails
	// contains filtered or unexported fields
}

WatchService defines the http client and Xray details

func NewWatchService

func NewWatchService(client *jfroghttpclient.JfrogHttpClient) *WatchService

NewWatchService creates a new Xray Watch Service

func (*WatchService) Create

func (xws *WatchService) Create(params utils.WatchParams) error

Create will create a new Xray watch

func (*WatchService) Delete

func (xws *WatchService) Delete(watchName string) error

Delete will delete an existing watch by name It will error if no watch can be found by that name.

func (*WatchService) Get

func (xws *WatchService) Get(watchName string) (watchResp *utils.WatchParams, err error)

Get retrieves the details about an Xray watch by its name It will error if no watch can be found by that name.

func (*WatchService) GetJfrogHttpClient

func (xws *WatchService) GetJfrogHttpClient() *jfroghttpclient.JfrogHttpClient

GetJfrogHttpClient returns the http client

func (*WatchService) GetXrayDetails

func (vs *WatchService) GetXrayDetails() auth.ServiceDetails

GetXrayDetails returns the Xray details

func (*WatchService) Update

func (xws *WatchService) Update(params utils.WatchParams) error

Update will update an existing Xray watch by name It will error if no watch can be found by that name.

type XrayGraphScanParams added in v0.25.0

type XrayGraphScanParams struct {
	// A path in Artifactory that this Artifact is intended to be deployed to.
	// This will provide a way to extract the watches that should be applied on this graph
	RepoPath   string
	ProjectKey string
	Graph      *GraphNode
}

func NewXrayGraphScanParams added in v0.25.0

func NewXrayGraphScanParams() XrayGraphScanParams

func (*XrayGraphScanParams) GetProjectKey added in v0.25.0

func (gp *XrayGraphScanParams) GetProjectKey() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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