vulnerabilities

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: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EndpointVulnerabilitiesJSON is the endpoint for vulnerabilities in JSON format
	EndpointVulnerabilitiesJSON = "/vulnerabilities.json"

	// EndpointVulnerabilitiesCSV is the endpoint for vulnerabilities in CSV format
	EndpointVulnerabilitiesCSV = "/vulnerabilities.csv"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service handles communication with the vulnerabilities related methods of the Workbrew API.

func NewService

func NewService(client interfaces.HTTPClient) *Service

NewService creates a new vulnerabilities service

func (*Service) ListVulnerabilities

func (s *Service) ListVulnerabilities(ctx context.Context) (*VulnerabilitiesResponse, *interfaces.Response, error)

ListVulnerabilities retrieves all vulnerabilities in JSON format URL: GET https://console.workbrew.com/workspaces/{workspace_name}/vulnerabilities.json

Note: This endpoint may return 403 on Free tier plans

func (*Service) ListVulnerabilitiesCSV

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

ListVulnerabilitiesCSV retrieves all vulnerabilities in CSV format URL: GET https://console.workbrew.com/workspaces/{workspace_name}/vulnerabilities.csv

Note: This endpoint may return 403 on Free tier plans

type VulnerabilitiesResponse

type VulnerabilitiesResponse []Vulnerability

VulnerabilitiesResponse is the response from GET /vulnerabilities.json

type VulnerabilitiesServiceInterface

type VulnerabilitiesServiceInterface interface {
	// ListVulnerabilities returns a list of Vulnerabilities
	//
	// Returns security vulnerabilities affecting installed formulae, including CVE IDs with CVSS scores,
	// affected formula names, outdated devices, support status, and Homebrew core versions.
	// May return 403 Forbidden on Free tier plans.
	ListVulnerabilities(ctx context.Context) (*VulnerabilitiesResponse, *interfaces.Response, error)

	// ListVulnerabilitiesCSV returns a list of Vulnerabilities in CSV format
	//
	// Returns vulnerability data as CSV with columns: vulnerabilities, formula, outdated_devices, supported, homebrew_core_version.
	ListVulnerabilitiesCSV(ctx context.Context) ([]byte, *interfaces.Response, error)
}

VulnerabilitiesServiceInterface defines the interface for vulnerabilities operations

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

type Vulnerability

type Vulnerability struct {
	Vulnerabilities     []VulnerabilityDetail `json:"vulnerabilities"`
	Formula             string                `json:"formula"`
	OutdatedDevices     []string              `json:"outdated_devices"`
	Supported           bool                  `json:"supported"`
	HomebrewCoreVersion string                `json:"homebrew_core_version"`
}

Vulnerability represents a vulnerability entry with associated formula and devices

type VulnerabilityDetail

type VulnerabilityDetail struct {
	CleanID   string   `json:"clean_id"`
	CVSSScore *float64 `json:"cvss_score"`
}

VulnerabilityDetail represents a single vulnerability

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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