model

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package model - API types for combining models in API requests/responses

Package model - Endpoint defines the struct for deployment targets

Package model - ProjectRelease defines the struct and handles marshaling/unmarshaling the struct to/from NFT Storage.

Package model - SBOM defines the struct and handles marshaling/unmarshaling the struct to/from NFT Storage.

Package model - Sync defines the struct for release-endpoint associations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AffectedEndpoint added in v1.0.2

type AffectedEndpoint struct {
	CveID           string    `json:"cve_id"`
	Summary         string    `json:"summary"`
	Details         string    `json:"details"`
	Severity        string    `json:"severity"`
	Published       string    `json:"published"`
	Modified        string    `json:"modified"`
	Aliases         []string  `json:"aliases"`
	Package         string    `json:"package"`
	AffectedVersion string    `json:"affected_version"`
	FullPurl        string    `json:"full_purl"`
	ReleaseName     string    `json:"release_name"`
	ReleaseVersion  string    `json:"release_version"`
	ContentSha      string    `json:"content_sha"`
	ProjectType     string    `json:"project_type"`
	EndpointName    string    `json:"endpoint_name"`
	EndpointType    string    `json:"endpoint_type"`
	Environment     string    `json:"environment"`
	SyncedAt        time.Time `json:"synced_at"`
}

AffectedEndpoint represents an endpoint that is affected by a CVE

type AffectedRelease added in v1.0.2

type AffectedRelease struct {
	CveID           string   `json:"cve_id"`
	Summary         string   `json:"summary"`
	Details         string   `json:"details"`
	Severity        string   `json:"severity"`
	Published       string   `json:"published"`
	Modified        string   `json:"modified"`
	Aliases         []string `json:"aliases"`
	Package         string   `json:"package"`
	AffectedVersion string   `json:"affected_version"`
	FullPurl        string   `json:"full_purl"`
	ReleaseName     string   `json:"release_name"`
	ReleaseVersion  string   `json:"release_version"`
	ContentSha      string   `json:"content_sha"`
	ProjectType     string   `json:"project_type"`
}

AffectedRelease represents a release that is affected by a CVE

type Endpoint added in v1.0.2

type Endpoint struct {
	Key          string       `json:"_key,omitempty"`
	Name         string       `json:"name"`
	EndpointType EndpointType `json:"endpoint_type"`
	Environment  string       `json:"environment"`
	ObjType      string       `json:"objtype,omitempty"`
}

Endpoint represents a deployment target for syncing releases

func NewEndpoint added in v1.0.2

func NewEndpoint() *Endpoint

NewEndpoint creates a new Endpoint instance with default values

type EndpointType added in v1.0.2

type EndpointType string

EndpointType represents the type of deployment target

const (
	// Cloud and Container Infrastructure
	EndpointTypeCluster EndpointType = "cluster"
	EndpointTypeEC2     EndpointType = "ec2"
	EndpointTypeLambda  EndpointType = "lambda"
	EndpointTypeECS     EndpointType = "ecs"
	EndpointTypeEKS     EndpointType = "eks"
	EndpointTypeGKE     EndpointType = "gke"
	EndpointTypeAKS     EndpointType = "aks"
	EndpointTypeFargate EndpointType = "fargate"

	// Edge and IoT Devices
	EndpointTypeEdge EndpointType = "edge"
	EndpointTypeIoT  EndpointType = "iot"

	// Mission Assets - Military and Defense
	EndpointTypeMissionAsset EndpointType = "mission_asset"
)

type PURL

type PURL struct {
	Key     string `json:"_key,omitempty"`
	Purl    string `json:"purl"` // Base PURL without version (e.g., pkg:npm/lodash)
	ObjType string `json:"objtype"`
}

PURL represents a package URL (base form without version) Used as a hub to connect CVEs and SBOMs

func NewPURL

func NewPURL() *PURL

NewPURL creates a new PURL instance

type ProjectRelease

type ProjectRelease struct {
	Key                      string    `json:"_key,omitempty"`
	Cid                      string    `json:"cid,omitempty"`
	ObjType                  string    `json:"objtype,omitempty"`
	Name                     string    `json:"name"`
	Version                  string    `json:"version"`
	ProjectType              string    `json:"projecttype,omitempty"`
	ContentSha               string    `json:"contentsha,omitempty"` // Git commit or Docker SHA for deduplication
	Basename                 string    `json:"basename,omitempty"`
	BuildDate                time.Time `json:"builddate,omitempty"`
	BuildID                  string    `json:"buildid,omitempty"`
	BuildNum                 string    `json:"buildnum,omitempty"`
	BuildURL                 string    `json:"buildurl,omitempty"`
	DockerRepo               string    `json:"dockerrepo,omitempty"`
	DockerSha                string    `json:"dockersha,omitempty"`
	DockerTag                string    `json:"dockertag,omitempty"`
	GitBranch                string    `json:"gitbranch,omitempty"`
	GitBranchCreateCommit    string    `json:"gitbranchcreatecommit,omitempty"`
	GitBranchCreateTimestamp time.Time `json:"gitbranchcreatetimestamp,omitempty"`
	GitBranchParent          string    `json:"gitbranchparent,omitempty"`
	GitCommit                string    `json:"gitcommit,omitempty"`
	GitCommitAuthors         string    `json:"gitcommitauthors,omitempty"`
	GitCommittersCnt         string    `json:"gitcommittescnt,omitempty"`
	GitCommitTimestamp       time.Time `json:"gitcommittimestamp,omitempty"`
	GitContribPercentage     string    `json:"gitcontribpercentage,omitempty"`
	GitLinesAdded            string    `json:"gitlinesadded,omitempty"`
	GitLinesDeleted          string    `json:"gitlinesdeleted,omitempty"`
	GitLinesTotal            string    `json:"gitlinestotal,omitempty"`
	GitOrg                   string    `json:"gitorg,omitempty"`
	GitPrevCompCommit        string    `json:"gitpreviouscomponentcommit,omitempty"`
	GitRepo                  string    `json:"gitrepo,omitempty"`
	GitRepoProject           string    `json:"gitrepoproject,omitempty"`
	GitSignedOffBy           string    `json:"gitsignedoffby,omitempty"`
	GitTag                   string    `json:"gittag,omitempty"`
	GitTotalCommittersCnt    string    `json:"gittotalcommittescnt,omitempty"`
	GitURL                   string    `json:"giturl,omitempty"`
	GitVerifyCommit          bool      `json:"gitverifycommit,omitempty"`
}

ProjectRelease defines a Version of an Component for a List View

func NewProjectRelease

func NewProjectRelease() *ProjectRelease

NewProjectRelease is the contructor that sets the appropriate default values

type ReleaseWithSBOM

type ReleaseWithSBOM struct {
	ProjectRelease
	SBOM SBOM `json:"sbom"`
}

ReleaseWithSBOM combines ProjectRelease and SBOM for API communication

type SBOM

type SBOM struct {
	Key        string          `json:"_key,omitempty"`
	ContentSha string          `json:"contentsha,omitempty"` // SHA256 hash of content for deduplication
	ObjType    string          `json:"objtype,omitempty"`
	Content    json.RawMessage `json:"content"`
}

SBOM defines a CycloneDX SBOM in JSON format

func NewSBOM

func NewSBOM() *SBOM

NewSBOM is the contructor that sets the appropriate default values

type Sync added in v1.0.2

type Sync struct {
	Key            string    `json:"_key,omitempty"`
	ReleaseName    string    `json:"release_name"`
	ReleaseVersion string    `json:"release_version"`
	EndpointName   string    `json:"endpoint_name"`
	SyncedAt       time.Time `json:"synced_at"`
	ObjType        string    `json:"objtype,omitempty"`
}

Sync represents the association between a release and an endpoint (deployment)

func NewSync added in v1.0.2

func NewSync() *Sync

NewSync creates a new Sync instance with default values

type SyncWithEndpoint added in v1.0.2

type SyncWithEndpoint struct {
	Sync
	Endpoint Endpoint `json:"endpoint"`
}

SyncWithEndpoint combines Sync and Endpoint for API communication

Jump to

Keyboard shortcuts

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