vulnerabilitychanges

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EndpointVulnerabilityChangesJSON is the endpoint for vulnerability changes in JSON format
	EndpointVulnerabilityChangesJSON = "/vulnerability_changes.json"

	// EndpointVulnerabilityChangesCSV is the endpoint for vulnerability changes in CSV format
	EndpointVulnerabilityChangesCSV = "/vulnerability_changes.csv"

	// Status filter values
	StatusDetected = "detected"
	StatusFixed    = "fixed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestQueryOptions

type RequestQueryOptions struct {
	Status   string // Filter by status: detected or fixed
	Query    string // Search query for formula name, version, vulnerability ID, or device
	Download bool   // For CSV: force download as attachment (set to true to add download=1)
}

RequestQueryOptions represents optional query parameters for vulnerability changes requests

type Service

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

Service handles communication with the vulnerability changes related methods of the Workbrew API.

func NewService

func NewService(client interfaces.HTTPClient) *Service

NewService creates a new vulnerability changes service

func (*Service) ListVulnerabilityChanges

func (s *Service) ListVulnerabilityChanges(ctx context.Context, opts *RequestQueryOptions) (*VulnerabilityChangesResponse, *interfaces.Response, error)

ListVulnerabilityChanges retrieves all vulnerability changes in JSON format URL: GET https://console.workbrew.com/workspaces/{workspace_name}/vulnerability_changes.json

Parameters:

  • opts: Optional query parameters (status filter, search query)

func (*Service) ListVulnerabilityChangesCSV

func (s *Service) ListVulnerabilityChangesCSV(ctx context.Context, opts *RequestQueryOptions) ([]byte, *interfaces.Response, error)

ListVulnerabilityChangesCSV retrieves all vulnerability changes in CSV format URL: GET https://console.workbrew.com/workspaces/{workspace_name}/vulnerability_changes.csv

Parameters:

  • opts: Optional query parameters (status filter, search query, download flag)

type VulnerabilityChange

type VulnerabilityChange struct {
	ID                 string    `json:"id"`
	EventType          string    `json:"event_type"`
	OccurredAt         time.Time `json:"occurred_at"`
	Status             string    `json:"status"`
	DeviceID           *string   `json:"device_id"`
	DeviceSerialNumber *string   `json:"device_serial_number"`
	FormulaName        string    `json:"formula_name"`
	FormulaVersion     string    `json:"formula_version"`
	VulnerabilityID    string    `json:"vulnerability_id"`
	CVSSSeverity       *string   `json:"cvss_severity"`
	CVSSScore          *float64  `json:"cvss_score"`
}

VulnerabilityChange represents a single vulnerability change event

type VulnerabilityChangesResponse

type VulnerabilityChangesResponse []VulnerabilityChange

VulnerabilityChangesResponse is the response from GET /vulnerability_changes.json

type VulnerabilityChangesServiceInterface

type VulnerabilityChangesServiceInterface interface {
	// ListVulnerabilityChanges returns a list of vulnerability change events
	//
	// Returns vulnerability lifecycle events (detected/fixed) with IDs, event types, timestamps, status,
	// device information, formula details, vulnerability IDs, CVSS severity, and scores.
	// Supports filtering by status (detected/fixed) and search queries via query options.
	ListVulnerabilityChanges(ctx context.Context, opts *RequestQueryOptions) (*VulnerabilityChangesResponse, *interfaces.Response, error)

	// ListVulnerabilityChangesCSV returns vulnerability change events as CSV
	//
	// Returns vulnerability change event data as CSV with columns: id, event_type, occurred_at, status, device_id,
	// device_serial_number, formula_name, formula_version, vulnerability_id, cvss_severity, cvss_score.
	// Supports filtering by status, search queries, and optional download parameter via query options.
	ListVulnerabilityChangesCSV(ctx context.Context, opts *RequestQueryOptions) ([]byte, *interfaces.Response, error)
}

VulnerabilityChangesServiceInterface defines the interface for vulnerability changes operations

Workbrew API docs: https://console.workbrew.com/documentation/api

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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