config

package
v1.23.2 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseTags

func ParseTags(tagsStr string) []string

ParseTags parses a comma-separated string of tags into a slice

Types

type CIContext

type CIContext struct {
	Platform         RuntimePlatform `json:"platform"`
	Repository       string          `json:"repository"`
	RepositoryOwner  string          `json:"repository_owner"`
	RunID            string          `json:"run_id"`
	RunNumber        string          `json:"run_number"`
	JobID            string          `json:"job_id"`
	SHA              string          `json:"sha"`
	RefName          string          `json:"ref_name"`
	RefType          string          `json:"ref_type"`
	HeadRef          string          `json:"head_ref"`
	BaseRef          string          `json:"base_ref"`
	EventName        string          `json:"event_name"`
	ServerURL        string          `json:"server_url"`
	APIURL           string          `json:"api_url"`
	Token            string          `json:"-"` // Don't serialize for security
	WorkspacePath    string          `json:"workspace_path"`
	RunnerOS         string          `json:"runner_os"`
	RunnerArch       string          `json:"runner_arch"`
	PlatformVersion  string          `json:"platform_version"`
	DetectedFeatures []string        `json:"detected_features"`
}

CIContext contains normalized CI/CD context information

func LoadCIContext

func LoadCIContext(version string) CIContext

LoadCIContext loads CI/CD context based on detected platform

type RuntimePlatform

type RuntimePlatform string

RuntimePlatform represents the detected runtime environment

const (
	PlatformGitHub      RuntimePlatform = "github"
	PlatformGitLab      RuntimePlatform = "gitlab"
	PlatformAzureDevOps RuntimePlatform = "azure"
	PlatformBitbucket   RuntimePlatform = "bitbucket"
	PlatformJenkins     RuntimePlatform = "jenkins"
	PlatformDocker      RuntimePlatform = "docker"
	PlatformKubernetes  RuntimePlatform = "kubernetes"
	PlatformPodman      RuntimePlatform = "podman"
	PlatformCLI         RuntimePlatform = "cli"
)

func DetectPlatform

func DetectPlatform() RuntimePlatform

DetectPlatform detects the current runtime platform based on environment variables

type TaskType

type TaskType string

TaskType represents the available task types

const (
	TaskInfo TaskType = "info" // Default info/healthcheck
)

func ValidateTask

func ValidateTask(task string) (TaskType, error)

ValidateTask validates that the specified task is supported

type Tool

type Tool struct {
	Category           string     `yaml:"category" json:"category"`
	ArtifactName       string     `yaml:"artifact_name" json:"artifact_name"`
	Format             ToolFormat `yaml:"format" json:"format"`
	CustomerIdentifier string     `yaml:"customer_identifier" json:"customer_identifier"`
}

Tool represents a tool configuration for fetching artifacts

type ToolFormat

type ToolFormat string

ToolFormat represents the supported artifact formats

const (
	FormatSARIF     ToolFormat = "SARIF"
	FormatSBOM      ToolFormat = "SBOM"
	FormatCSAF_VEX  ToolFormat = "CSAF_VEX"
	FormatOpenVEX   ToolFormat = "OpenVEX"
	FormatCycloneDX ToolFormat = "CycloneDX_VEX"
	FormatVDR       ToolFormat = "VDR"
	FormatPlainJSON ToolFormat = "PLAIN_JSON"
	FormatPlainXML  ToolFormat = "PLAIN_XML"
	FormatBlob      ToolFormat = "BLOB"
)

type VulnetixConfig

type VulnetixConfig struct {
	// Core Vulnetix settings
	OrgID       string   `json:"org_id"`
	Task        TaskType `json:"task"`
	ProjectName string   `json:"project_name,omitempty"`
	ProductName string   `json:"product_name,omitempty"`
	TeamName    string   `json:"team_name,omitempty"`
	GroupName   string   `json:"group_name,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Tools       []Tool   `json:"tools,omitempty"`

	// CI/CD context (replaces GitHub-specific context)
	CI CIContext `json:"ci"`

	// Runtime info
	Version string `json:"version"`
}

VulnetixConfig represents the complete configuration state

func (*VulnetixConfig) GenerateArtifactNamingConvention

func (c *VulnetixConfig) GenerateArtifactNamingConvention(params ...string) string

GenerateArtifactNamingConvention generates artifact naming based on parameters If toolCategory and baseArtifactName are provided, generates specific naming If no parameters, generates wildcard pattern for searching

func (*VulnetixConfig) GetWorkflowRunContext

func (c *VulnetixConfig) GetWorkflowRunContext() map[string]string

GetWorkflowRunContext returns workflow run context information

func (*VulnetixConfig) PrintConfiguration

func (c *VulnetixConfig) PrintConfiguration()

PrintConfiguration prints the current configuration for debugging

Jump to

Keyboard shortcuts

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