scanner

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// AnalysisStatusQueued denotes a request for analysis has been
	// accepted and queued
	AnalysisStatusQueued = "queued"
	// AnalysisStatusErrored denotes a request for analysis has errored during
	// the run, the message field will have more details
	AnalysisStatusErrored = "errored"
	// AnalysisStatusFinished denotes a request for analysis has been
	// completed, view the passed field from an Analysis and the scan details for
	// more information
	AnalysisStatusFinished = "finished"
	// AnalysisStatusPassed denotes a request for analysis has failed to
	// run, the message field will have more details
	AnalysisStatusPassed = "passed"
	// AnalysisStatusFailed denotes a request for analysis has been
	// accepted and has failed
	AnalysisStatusFailed = "failed"
	// AnalysisStatusAnalyzing denotes a request for analysis has been
	// accepted and has begun
	AnalysisStatusAnalyzing = "analyzing"
)
View Source
const (
	// ScannerAnalyzeProjectEndpoint is a string representation of the current endpoint for analyzing project
	ScannerAnalyzeProjectEndpoint = "v1/scanner/analyzeProject"
	// ScannerGetAnalysisStatusEndpoint is a string representation of the current endpoint for getting analysis status
	ScannerGetAnalysisStatusEndpoint = "v1/scanner/getAnalysisStatus"
	// ScannerGetLatestAnalysisStatusEndpoint is a string representation of the current endpoint for getting latest analysis status
	ScannerGetLatestAnalysisStatusEndpoint = "v1/scanner/getLatestAnalysisStatus"
	// ScannerGetLatestAnalysisStatusesEndpoint is a string representation of the current endpoint for getting latest analysis statuses
	ScannerGetLatestAnalysisStatusesEndpoint = "v1/scanner/getLatestAnalysisStatuses"
)
View Source
const (
	// DeliveryStatusErrored denotes a request for delivery has errored during
	// the run, the message field will have more details
	DeliveryStatusErrored = "errored"
	// DeliveryStatusFinished denotes a request for delivery has been
	// completed, view the passed field from an Delivery and the scan details for
	// more information
	DeliveryStatusFinished = "finished"
	// DeliveryStatusCanceled denotes a request for delivery has been canceled
	// the message field will have more details
	DeliveryStatusCanceled = "canceled"
	// DeliveryStatusNotConfigured denotes a request for delivery has been
	// rejected due to no delivery details
	DeliveryStatusNotConfigured = "not_configured"
)
View Source
const (
	// ScannerAddScanEndpoint is a string representation of the current endpoint for scanner add scan
	ScannerAddScanEndpoint = "v1/scanner/addScanResult"
	// ScannerGetProjectsStates is a string representation of the current endpoint getting requested projects scan states
	ScannerGetProjectsStates = "v1/scanner/getProjectsStates"

	// ScanStatusErrored denotes a request for scan has errored during
	// the run, the message field will have more details
	ScanStatusErrored = "errored"
	// ScanStatusFinished denotes a request for scan has been
	// completed, view the passed field from an Scan and the scan details for
	// more information
	ScanStatusFinished = "finished"
	// ScanStatusStarted denotes a request for scan has been
	// accepted and has begun
	ScanStatusStarted = "started"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalysisStatus

type AnalysisStatus struct {
	ID                  string              `json:"id"`
	TeamID              string              `json:"team_id"`
	ProjectID           string              `json:"project_id"`
	Message             string              `json:"message"`
	Branch              string              `json:"branch"`
	Status              string              `json:"status"`
	UnreachableError    bool                `json:"unreachable_error"`
	AnalysisEventSource string              `json:"analysis_event_src"`
	CreatedAt           time.Time           `json:"created_at"`
	UpdatedAt           time.Time           `json:"updated_at"`
	ScanStatus          []ScanStatus        `json:"scan_status"`
	Deliveries          map[string]Delivery `json:"deliveries"`
}

AnalysisStatus is a representation of an Ion Channel Analysis Status within the system

func (*AnalysisStatus) Done added in v0.19.1

func (a *AnalysisStatus) Done() bool

Done indicates an analyse has stopped processing

type AnalyzeRequest added in v0.19.1

type AnalyzeRequest struct {
	TeamID    string `json:"team_id,omitempty"`
	ProjectID string `json:"project_id,omitempty"`
	Branch    string `json:"branch,omitempty"`
}

AnalyzeRequest represents the body to send when requesting an analysis be done on a project.

type Delivery added in v0.19.1

type Delivery struct {
	ID          string    `json:"id"`
	TeamID      string    `json:"team_id"`
	ProjectID   string    `json:"project_id"`
	AnalysisID  string    `json:"analysis_id"`
	Destination string    `json:"destination"`
	Status      string    `json:"status"`
	Filename    string    `json:"filename"`
	Hash        string    `json:"hash"`
	Message     string    `json:"message"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
	DeliveredAt time.Time `json:"delivered_at"`
}

Delivery represents the delivery information of a singular artifact associated with an analysis status

type ExternalCoverage

type ExternalCoverage struct {
	Value float64 `json:"value"`
}

ExternalCoverage is a percent of unit test code coverage as provided by the client

type ExternalScan

type ExternalScan struct {
	Coverage      *ExternalCoverage      `json:"coverage,omitempty"`
	Vulnerability *ExternalVulnerability `json:"external_vulnerability,omitempty"`
	Source        Source                 `json:"source"`
	Notes         string                 `json:"notes"`
	Raw           *json.RawMessage       `json:"raw,omitempty"`
}

ExternalScan is a representation of a scan result not performed by the Ion system

type ExternalVulnerability added in v0.19.1

type ExternalVulnerability struct {
	Critcal int `json:"critical"`
	High    int `json:"high"`
	Medium  int `json:"medium"`
	Low     int `json:"low"`
}

ExternalVulnerability is a representation of a vulnerability scan provided by the client

type Navigation struct {
	Analysis       *AnalysisStatus `json:"analysis"`
	LatestAnalysis *AnalysisStatus `json:"latest_analysis"`
}

Navigation represents a navigational meta data reference to given analysis

type ProjectsStates added in v0.19.1

type ProjectsStates struct {
	ID         string `json:"id"`
	Status     string `json:"status"`
	AnalysisID string `json:"analysis_id"`
}

ProjectsStates identfies the state of a scan for requested projects

type ScanStatus

type ScanStatus struct {
	ID               string    `json:"id"`
	AnalysisStatusID string    `json:"analysis_status_id"`
	ProjectID        string    `json:"project_id"`
	TeamID           string    `json:"team_id"`
	Message          string    `json:"message"`
	Name             string    `json:"name"`
	Read             string    `json:"read"`
	Status           string    `json:"status"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
}

ScanStatus identifies the state of a scan performed by the Ion system

func (*ScanStatus) Errored added in v0.19.1

func (s *ScanStatus) Errored() bool

Errored encapsulates the concerns of whether a ScanStatus is in an errored state or not. It returns true or false based on whether the ScanStatus is errored.

type Source

type Source struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

Source identifies the provider of external scans

Jump to

Keyboard shortcuts

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