vmaas

package
v1.31.4 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecurityErratumType = "security"
	CriticalCveImpact   = "Critical"
	ImportantCveImpact  = "Important"
	ModerateCveImpact   = "Moderate"
	LowCveImpact        = "Low"
)
View Source
const DefaultVariantSuffix = "N/A"
View Source
const Dump = "/data/vmaas.db"

Variables

View Source
var (
	ErrProcessingInput = errors.New("processing input")
	ReleaseverRegex    = regexp.MustCompile(`^\d+\.\d+$`)
)

Functions

func DownloadCache

func DownloadCache(url, dest string) error

func ShouldReload added in v1.0.1

func ShouldReload(c *Cache, latestDumpEndpoint string) bool

Types

type API

type API struct {
	Cache *Cache
	// contains filtered or unexported fields
}

func InitFromFile

func InitFromFile(cachePath string, opts ...Option) (*API, error)

func InitFromURL

func InitFromURL(cacheURL string, opts ...Option) (*API, error)

func (*API) Cves added in v1.13.0

func (api *API) Cves(request *CvesRequest) (*Cves, error)

func (*API) DBChange added in v1.26.0

func (api *API) DBChange() *DBChange

func (*API) Errata added in v1.14.0

func (api *API) Errata(request *ErrataRequest) (*Errata, error)

func (*API) LoadCacheFromFile

func (api *API) LoadCacheFromFile(cachePath string) error

func (*API) LoadCacheFromURL

func (api *API) LoadCacheFromURL(cacheURL string) error

func (*API) OSVulnerabilityReport added in v1.16.0

func (api *API) OSVulnerabilityReport() (*VulnerabilityReport, error)

func (*API) Packages added in v1.18.0

func (api *API) Packages(request *PackagesRequest) (*Packages, error)

func (*API) Patches added in v1.23.0

func (api *API) Patches(request *Request) (*Patches, error)

func (*API) PeriodicCacheReload

func (api *API) PeriodicCacheReload(interval time.Duration, latestDumpEndpoint string, cacheURL *string)

func (*API) PkgList added in v1.19.0

func (api *API) PkgList(request *PkgListRequest) *PkgList

func (*API) PkgTree added in v1.21.0

func (api *API) PkgTree(request *PkgTreeRequest) (*PkgTree, error)

func (*API) RPMPkgNames added in v1.24.0

func (api *API) RPMPkgNames(request *RPMPkgNamesRequest) (*RPMPkgNames, error)

func (*API) Repos added in v1.17.0

func (api *API) Repos(request *ReposRequest) (*Repos, error)

func (*API) SRPMPkgNames added in v1.25.0

func (api *API) SRPMPkgNames(request *SRPMPkgNamesRequest) (*SRPMPkgNames, error)

func (*API) Updates

func (api *API) Updates(request *Request) (*Updates, error)

func (*API) Version added in v1.27.0

func (api *API) Version() *string

func (*API) Vulnerabilities

func (api *API) Vulnerabilities(request *Request) (*Vulnerabilities, error)

func (*API) VulnerabilitiesExtended

func (api *API) VulnerabilitiesExtended(request *Request) (*VulnerabilitiesExtended, error)

type AffectedPackage added in v0.7.0

type AffectedPackage struct {
	Name string   `json:"package_name"`
	EVRA string   `json:"evra"`
	Cpe  CpeLabel `json:"cpe"`
	ModuleStreamPtrs
}

type ArchID

type ArchID int

type CSAFCVEID added in v1.3.0

type CSAFCVEID int

type CSAFCVEProduct added in v1.3.0

type CSAFCVEProduct struct {
	CVEID         CVEID
	CSAFProductID CSAFProductID
}

type CSAFCVEs added in v1.3.0

type CSAFCVEs struct {
	Fixed   []CVEID
	Unfixed []CVEID
}

type CSAFProduct added in v1.3.0

type CSAFProduct struct {
	CpeID         CpeID
	VariantSuffix VariantSuffix
	PackageNameID NameID
	PackageID     PkgID
	ModuleStream  ModuleStream
}

type CSAFProductID added in v1.3.0

type CSAFProductID int

type CVEID added in v1.3.0

type CVEID int

type Cache

type Cache struct {
	DumpSchemaVersion int

	Packagename2ID map[string]NameID
	ID2Packagename map[NameID]string

	// name -> []pkg ordered by e-v-r ordering
	Updates map[NameID][]PkgID
	// name -> evr -> idx into updates[name]
	UpdatesIndex                map[NameID]map[EvrID][]int
	PackageDetailsModifiedIndex []PkgID

	Evr2ID map[utils.Evr]EvrID
	ID2Evr map[EvrID]utils.Evr

	ID2Arch map[ArchID]string
	Arch2ID map[string]ArchID

	ArchCompat map[ArchID]map[ArchID]bool

	PackageDetails map[PkgID]PackageDetail
	Nevra2PkgID    map[Nevra]PkgID

	RepoIDs            []RepoID
	RepoDetails        map[RepoID]RepoDetail
	RepoLabel2IDs      map[string][]RepoID
	RepoOrgs           map[string]bool
	RepoPath2IDs       map[string][]RepoID
	Label2ContentSetID map[string]ContentSetID
	ContentSetID2Label map[ContentSetID]string

	ContentSetID2PkgNameIDs    map[ContentSetID][]NameID
	SrcPkgNameID2ContentSetIDs map[NameID][]ContentSetID

	ProductID2RepoIDs map[int][]RepoID
	PkgID2RepoIDs     map[PkgID][]RepoID

	ErratumID2Name    map[ErratumID]string
	PkgID2ErratumIDs  map[PkgID][]ErratumID
	ErratumID2RepoIDs map[ErratumID]map[RepoID]bool

	CveDetail map[string]CveDetail
	CveNames  map[int]string

	PkgErratum2Module map[PkgErratum][]int
	Module2IDs        map[ModuleStream][]int
	ModuleRequires    map[int][]int
	DBChange          DBChange
	ErratumDetails    map[string]ErratumDetail
	SrcPkgID2PkgID    map[PkgID][]PkgID
	String            map[int]string

	ContentSetID2CpeIDs map[ContentSetID][]CpeID
	RepoID2CpeIDs       map[RepoID][]CpeID
	CpeID2Label         map[CpeID]CpeLabel
	CpeLabel2ID         map[CpeLabel]CpeID

	// CSAF
	CSAFProductStatus      map[int]string
	CSAFCVEs               map[VariantSuffix]map[CpeIDNameID]map[CSAFProductID]CSAFCVEs
	CSAFCVEProduct2Erratum map[CSAFCVEProduct]string
	CSAFProduct2ID         map[CSAFProduct]CSAFProductID
	CSAFProductID2Product  map[CSAFProductID]CSAFProduct
	ReleaseGraphs          []ReleaseGraph

	OSReleaseDetails map[int]OSReleaseDetail
}

type ContentData added in v1.24.0

type ContentData map[string][]string

type ContentSetID

type ContentSetID int

type CpeID

type CpeID int

type CpeIDNameID added in v1.6.0

type CpeIDNameID struct {
	CpeID  CpeID
	NameID NameID
}

type CpeLabel added in v1.4.0

type CpeLabel string

func (CpeLabel) Parse added in v1.4.0

func (l CpeLabel) Parse() (*ParsedCpe, error)

type CveDetail

type CveDetail struct {
	Name          string     `json:"synopsis" example:"CVE-2017-5715"`
	RedHatURL     string     `json:"redhat_url" example:"https://access.redhat.com/security/cve/cve-2017-5715"`
	SecondaryURL  string     `json:"secondary_url" example:"https://seconday.url.com"`
	Cvss3Score    string     `json:"cvss3_score" example:"5.1"`
	Cvss3Metrics  string     `json:"cvss3_metrics" example:"AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:N/A:N"`
	Impact        string     `json:"impact" enums:"NotSet,None,Low,Medium,Moderate,Important,High,Critical"`
	PublishedDate *time.Time `json:"public_date" example:"2018-01-04T13:29:00+00:00" format:"date-time"`
	ModifiedDate  *time.Time `json:"modified_date" example:"2018-03-31T01:29:00+00:00" format:"date-time"`
	Iava          string     `json:"-"`
	Description   string     `json:"description" example:"description text"`
	Cvss2Score    string     `json:"cvss2_score" example:"5.600"`
	Cvss2Metrics  string     `json:"cvss2_metrics" example:"AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:N/A:N"`
	Source        string     `json:"-"`

	CWEs       []string    `json:"cwe_list" example:"CWE-20"`
	PkgIDs     []int       `json:"-"`
	ErratumIDs []ErratumID `json:"-"`

	Errata         []string `json:"errata_list" example:"RHSA-2015:1981"`
	Packages       []string `json:"package_list" example:"nss-devel-3.16.1-9.el6_5.x86_64"`
	SourcePackages []string `json:"source_package_list" example:"nss-devel-3.16.1-9.el6_5.src"`
}

type CveDetails added in v1.13.0

type CveDetails map[string]CveDetail

type CveIDString added in v1.20.0

type CveIDString struct {
	ID     CVEID
	String string
}

type Cves added in v1.13.0

type Cves struct {
	Cves       CveDetails `json:"cve_list"`
	LastChange time.Time  `json:"last_change" example:"2024-11-20T12:36:49.640592Z"`
	utils.Pagination
}

type CvesRequest added in v1.13.0

type CvesRequest struct {
	Cves           []string   `json:"cve_list" example:"CVE-2017-57.*" minItems:"1" validate:"required"`
	PublishedSince *time.Time `json:"published_since" example:"2018-04-05T01:23:45+02:00" format:"date-time"`
	ModifiedSince  *time.Time `json:"modified_since" example:"2018-04-05T01:23:45+02:00" format:"date-time"`
	RHOnly         bool       `json:"rh_only"`
	// Return only those CVEs which are associated with at least one errata. Defaults to false.
	AreErrataAssociated bool `json:"errata_associated"`
	// Include content from \"third party\" repositories into the response, disabled by default.
	ThirdParty bool `json:"third_party" default:"false"`
	utils.PaginationRequest
}

type DBChange

type DBChange struct {
	ErrataChanges time.Time `json:"errata_changes" example:"2024-11-20T12:24:23.488871Z"`
	CveChanges    time.Time `json:"cve_changes" example:"2024-11-20T12:26:20.009512Z"`
	RepoChanges   time.Time `json:"repository_changes" example:"2024-11-20T12:24:23.486827Z"`
	LastChange    time.Time `json:"last_change" example:"2024-11-20T12:36:49.640592Z"`
	Exported      time.Time `json:"exported" example:"2024-11-20T12:37:47.605526Z"`
}

@Description VMaaS DB last-updated time stramps

type Errata added in v1.14.0

type Errata struct {
	Errata     ErratumDetails `json:"errata_list"`
	Type       TypeT          `json:"type,omitempty" example:"security"`
	Severity   SeverityT      `json:"severity,omitempty" enums:"Low,Moderate,Important,Critical,null"`
	LastChange time.Time      `json:"last_change" example:"2024-11-20T12:36:49.640592Z"`
	utils.Pagination
}

type ErrataRequest added in v1.14.0

type ErrataRequest struct {
	Errata        []string   `json:"errata_list" example:"RHSA-2018:05.*" minItems:"1" validate:"required"`
	ModifiedSince *time.Time `json:"modified_since" example:"2018-04-05T01:23:45+02:00" format:"date-time"`
	// Include content from \"third party\" repositories into the response, disabled by default.
	ThirdParty bool      `json:"third_party" default:"false"`
	Type       TypeT     `json:"type" example:"security"`
	Severity   SeverityT `json:"severity" enums:"Low,Moderate,Important,Critical,null"`
	utils.PaginationRequest
}

type ErratumDetail added in v0.7.1

type ErratumDetail struct {
	Synopsis       string  `json:"synopsis" example:"Important: kernel security and bug fix update"`
	Summary        string  `json:"summary" example:"summary text"`
	Type           string  `json:"type" example:"security"`
	Severity       *string `json:"severity" enums:"Low,Moderate,Important,Critical,null"`
	Description    string  `json:"description" example:"description text"`
	Solution       string  `json:"solution" example:"solution text"`
	URL            string  `json:"url" example:"https://access.redhat.com/errata/RHSA-2018:0512"`
	ThirdParty     bool    `json:"third_party"`
	RequiresReboot bool    `json:"requires_reboot"`

	ID        ErratumID  `json:"-"`
	Issued    *time.Time `json:"issued" example:"2018-03-13T17:31:28+00:00" format:"date-time"`
	Updated   *time.Time `json:"updated" example:"2018-03-13T17:31:41+00:00"`
	CVEs      []string   `json:"cve_list" example:"CVE-2017-5715"`
	PkgIDs    []int      `json:"-"`
	Bugzillas []string   `json:"bugzilla_list" example:"1519778"`
	Refs      []string   `json:"reference_list" example:"classification-RHSA-2018:0512"`
	Modules   []Module   `json:"modules_list"`

	PackageList       []string `json:"package_list" example:"kernel-2.6.32-696.23.1.el6.x86_64"`
	SourcePackageList []string `json:"source_package_list" example:"kernel-2.6.32-696.23.1.el6.src"`
	ReleaseVersions   []string `json:"release_versions" example:"8.1"`
}

type ErratumDetails added in v1.26.1

type ErratumDetails map[string]ErratumDetail

type ErratumID added in v0.7.1

type ErratumID int

type EvrID

type EvrID int

type Module

type Module struct {
	Name              string   `json:"module_name"`
	Stream            string   `json:"module_stream"`
	Version           int      `json:"module_version"`
	Context           string   `json:"module_context"`
	PackageList       []string `json:"package_list"`
	SourcePackageList []string `json:"source_package_list"`
}

type ModuleStream

type ModuleStream struct {
	Module string `json:"module_name"`
	Stream string `json:"module_stream"`
}

func (*ModuleStream) Scan added in v1.3.0

func (ms *ModuleStream) Scan(value interface{}) error

Implement the Scan method for the ModuleStream type

type ModuleStreamPtrs added in v0.4.3

type ModuleStreamPtrs struct {
	Module *string `json:"module_name" example:"rhn-tools" validate:"required"`
	Stream *string `json:"module_stream" example:"1" validate:"required"`
}

type NameArch

type NameArch struct {
	Name string
	Arch string
}

type NameID

type NameID int

type Nevra

type Nevra struct {
	NameID NameID
	EvrID  EvrID
	ArchID ArchID
}

type NevraIDs

type NevraIDs struct {
	NameID NameID
	EvrIDs []int
	ArchID ArchID
}

type NevraString

type NevraString struct {
	Nevra utils.Nevra
	Pkg   string
}

type OSReleaseDetail added in v1.16.0

type OSReleaseDetail struct {
	Name                   string `json:"name"`
	Major                  int    `json:"major"`
	Minor                  int    `json:"minor"`
	LifecyclePhase         string `json:"lifecycle_phase"`
	SystemProfile          string `json:"-"`
	CvesCritical           int    `json:"cves_critical"`
	CvesImportant          int    `json:"cves_important"`
	CvesModerate           int    `json:"cves_moderate"`
	CvesLow                int    `json:"cves_low"`
	CvesUnpatchedCritical  int    `json:"cves_unpatched_critical"`
	CvesUnpatchedImportant int    `json:"cves_unpatched_important"`
	CvesUnpatchedModerate  int    `json:"cves_unpatched_moderate"`
	CvesUnpatchedLow       int    `json:"cves_unpatched_low"`
}

type Option added in v1.0.0

type Option interface {
	// contains filtered or unexported methods
}

func WithExcludedPackages added in v1.9.0

func WithExcludedPackages(pkgs map[string]bool) Option

Option to set excluded package names

func WithExcludedReleases added in v1.14.2

func WithExcludedReleases(rel map[string]bool) Option

Option to set excluded package releases

func WithMaxGoroutines added in v1.0.0

func WithMaxGoroutines(g int) Option

Option to set maximum number of goroutines used by the lib

func WithNewerReleaseverCsaf added in v1.11.3

func WithNewerReleaseverCsaf(n bool) Option

Option to look for updates/cves in newer release version when evaluating from CSAF

func WithNewerReleaseverRepos added in v1.11.3

func WithNewerReleaseverRepos(n bool) Option

Option to look for updates/cves in newer release version when evaluating from repositories

func WithUnfixed added in v1.0.0

func WithUnfixed(u bool) Option

Option to evaluate unfixed CVEs by CSAF

func WithVmaasVersionFilePath added in v1.27.0

func WithVmaasVersionFilePath(path string) Option

Option that specifies VMaaS version file path

type Package added in v0.6.0

type Package struct {
	utils.Nevra
	String string
	NameID NameID
}

type PackageDetail

type PackageDetail struct {
	NameID        NameID
	EvrID         EvrID
	ArchID        ArchID
	SummaryID     int
	DescriptionID int

	SrcPkgID   *PkgID
	Modified   *time.Time
	ModifiedID int
}

type PackageDetailResponse added in v1.18.0

type PackageDetailResponse struct {
	Summary       string             `json:"summary" example:"package summary"`
	Description   string             `json:"description" example:"package description"`
	SourcePackage string             `json:"source_package" example:"kernel-2.6.32-696.23.1.el6.src"`
	Packages      []string           `json:"package_list" example:"kernel-2.6.32-696.23.1.el6.x86_64"`
	Repositories  []RepoDetailCommon `json:"repositories"`
}

type PackageDetails added in v1.18.0

type PackageDetails map[string]interface{}

type Packages added in v1.18.0

type Packages struct {
	Packages   PackageDetails `json:"package_list"`
	LastChange time.Time      `json:"last_change" example:"2024-11-20T12:36:49.640592Z"`
}

type PackagesRequest added in v1.18.0

type PackagesRequest struct {
	Packages []string `json:"package_list" example:"kernel-2.6.32-696.20.1.el6.x86_64" minItems:"1" validate:"required"`
	// Include content from "third party" repositories into the response, disabled by default.
	ThirdParty bool `json:"third_party" default:"false"`
}

type ParsedCpe added in v1.4.0

type ParsedCpe struct {
	Part     *string
	Vendor   *string
	Product  *string
	Version  *string
	Update   *string
	Edition  *string
	Language *string
}

func (*ParsedCpe) CmpByVersion added in v1.20.0

func (l *ParsedCpe) CmpByVersion(r *ParsedCpe) int

func (*ParsedCpe) Match added in v1.20.0

func (l *ParsedCpe) Match(r *ParsedCpe) bool

type Patches added in v1.23.0

type Patches struct {
	Errata     []string  `json:"errata_list" example:"RHSA-2018:0151"`
	LastChange time.Time `json:"last_change" example:"2024-11-20T12:36:49.640592Z"`
}

type PkgErratum added in v0.7.1

type PkgErratum struct {
	PkgID     PkgID
	ErratumID ErratumID
}

type PkgID

type PkgID int

type PkgList added in v1.19.0

type PkgList struct {
	PkgList []PkgListItem `json:"package_list"`
	// Total number of packages to return.
	Total      int       `json:"total" example:"100"`
	LastChange time.Time `json:"last_change" example:"2024-11-20T12:36:49.640592Z"`
	utils.Pagination
}

type PkgListItem added in v1.19.0

type PkgListItem struct {
	Nevra       string     `json:"nevra" example:"kernel-rt-4.18.0-147.rt24.93.el8.x86_64"`
	Summary     string     `json:"summary" example:"My package summary"`
	Description string     `json:"description" example:"My package description"`
	Modified    *time.Time `json:"modified,omitempty" example:"2018-04-05T01:23:45+02:00" format:"date-time"`
}

type PkgListRequest added in v1.19.0

type PkgListRequest struct {
	ModifiedSince *time.Time `json:"modified_since" example:"2018-04-05T01:23:45+02:00" format:"date-time"`
	// Include 'modified' package attribute into the response
	ReturnModified bool `json:"return_modified" default:"false"`
	utils.PaginationRequest
}

type PkgTree added in v1.21.0

type PkgTree struct {
	PackageNames PkgTreeItems `json:"package_name_list"`
	LastChange   time.Time    `json:"last_change" example:"2024-11-20T12:36:49.640592Z"`
	utils.Pagination
}

type PkgTreeErratumDetail added in v1.21.0

type PkgTreeErratumDetail struct {
	Name    string     `json:"name" example:"RHSA-2019:2730" validate:"required"`
	Issued  *time.Time `json:"issued" example:"2019-11-19T09:41:05+00:00" format:"date-time" validate:"required"`
	Updated *time.Time `json:"updated" example:"2019-11-19T09:41:05+00:00" format:"date-time"`
	CVEs    []string   `json:"cve_list" example:"CVE-2018-13405"`
}

type PkgTreeItem added in v1.21.0

type PkgTreeItem struct {
	// Example: kernel-rt-4.18.0-147.rt24.93.el8.x86_64
	Nevra       string `json:"nevra" validate:"required"`
	Summary     string `json:"summary,omitempty" example:"My package summary"`
	Description string `json:"description,omitempty" example:"My package description"`
	// Example: 2020-01-13T17:31:41+00:00
	FirstPublished *time.Time              `json:"first_published,omitempty" format:"date-time" validate:"required"`
	Repositories   *[]PkgTreeRepoDetail    `json:"repositories,omitempty"`
	Errata         *[]PkgTreeErratumDetail `json:"errata,omitempty"`
}

type PkgTreeItems added in v1.21.0

type PkgTreeItems map[string][]PkgTreeItem

type PkgTreeRepoDetail added in v1.21.0

type PkgTreeRepoDetail struct {
	RepoDetailCommon
	Revision string `json:"revision" example:"2019-11-19T09:41:05+00:00" format:"date-time" validate:"required"`
}

type PkgTreeRequest added in v1.21.0

type PkgTreeRequest struct {
	PackageNames  []string   `json:"package_name_list" example:"kernel-rt" minItems:"1" validate:"required"`
	ModifiedSince *time.Time `json:"modified_since" example:"2018-04-05T01:23:45+02:00" format:"date-time"`
	// Include content from "third party" repositories into the response, disabled by default.
	ThirdParty bool `json:"third_party" default:"false"`
	// Include nevra repositories info into the response.
	ReturnRepositories *bool `json:"return_repositories" default:"true"`
	// Include nevra errata info into the response.
	ReturnErrata *bool `json:"return_errata" default:"true"`
	// Include nevra summary info into the response.
	ReturnSummary bool `json:"return_summary" default:"false"`
	// Include nevra description info into the response.
	ReturnDescription bool `json:"return_description" default:"false"`
	utils.PaginationRequest
}

type ProcessedRequest

type ProcessedRequest struct {
	Updates            *Updates
	Packages           []NevraString
	Variants           []VariantSuffix
	NewerVariants      []VariantSuffix
	ContentSetVariants []VariantSuffix
	Cpes               []CpeID
	NewerCpes          []CpeID
	ContentSetCpes     []CpeID
	OriginalRequest    *Request
}

type ProductsPackage added in v1.4.0

type ProductsPackage struct {
	ProductsFixed             []CSAFProductID
	ProductsUnfixed           []CSAFProductID
	ProductsFixedNewerRelease []CSAFProductID
	Package                   Package
}

type RPMData added in v1.25.0

type RPMData map[string]map[string][]string

type RPMPkgNames added in v1.24.0

type RPMPkgNames struct {
	Names      ContentData `json:"rpm_name_list"` // TODO: use `omitzero` from go1.24
	LastChange time.Time   `json:"last_change" example:"2024-11-20T12:36:49.640592Z"`
}

type RPMPkgNamesRequest added in v1.24.0

type RPMPkgNamesRequest struct {
	RPMNames    []string `json:"rpm_name_list" example:"openssl-libs" validate:"required"`
	ContentSets []string `json:"content_set_list" example:"rhel-7-desktop-rpms"`
}

type ReleaseGraph added in v1.29.0

type ReleaseGraph struct {
	GetByVariant map[VariantSuffix]*ReleaseNode
	GetByCpe     map[CpeLabel][]*ReleaseNode
}

func (*ReleaseGraph) GetAncestors added in v1.29.0

func (g *ReleaseGraph) GetAncestors(variant VariantSuffix) []*ReleaseNode

Get all parent nodes (ancestors) of a node by a node id - product variant suffix

type ReleaseGraphRaw added in v1.31.0

type ReleaseGraphRaw struct {
	Nodes map[string]struct {
		Type string     `json:"type"`
		CPEs []CpeLabel `json:"cpes"`
	} `json:"nodes"`
	Edges map[string][]string `json:"edges"`
}

func (*ReleaseGraphRaw) BuildGraph added in v1.31.0

func (raw *ReleaseGraphRaw) BuildGraph(cpeID2Label map[CpeID]CpeLabel) *ReleaseGraph

Build the ReleaseGraph tree structure

type ReleaseNode added in v1.29.0

type ReleaseNode struct {
	VariantSuffix VariantSuffix
	Type          string
	CPEs          []CpeLabel
	Children      []*ReleaseNode
	Parent        *ReleaseNode
}

func (*ReleaseNode) GetAncestors added in v1.31.0

func (n *ReleaseNode) GetAncestors() []*ReleaseNode

Get all parent nodes (ancestors) of a node

type RepoDetail

type RepoDetail struct {
	RepoDetailCommon
	URL        string     `json:"url" example:"https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/"`
	Product    string     `json:"product" example:"Red Hat Enterprise Linux Server"`
	ProductID  int        `json:"-"`
	Revision   string     `json:"revision" example:"2018-03-27T10:55:16+00:00"`
	LastChange *time.Time `json:"last_change"`
	ThirdParty bool       `json:"third_party"`

	CPEs                []CpeLabel `json:"cpes" example:"cpe:/a:redhat"`
	UpdatedPackageNames *[]string  `json:"updated_package_names,omitempty" example:"kernel"`
}

type RepoDetailCommon added in v1.18.0

type RepoDetailCommon struct {
	Label        string `json:"label" example:"rhel-6-server-rpms" validate:"required"`
	Name         string `json:"name" example:"Red Hat Enterprise Linux 6 Server (RPMs)" validate:"required"`
	Basearch     string `json:"basearch" example:"x86_64" validate:"required"`
	Releasever   string `json:"releasever" example:"6Server" validate:"required"`
	Organization string `json:"organization"`
}

type RepoDetails added in v1.17.0

type RepoDetails map[string][]RepoDetail

type RepoID

type RepoID int

type Repos added in v1.17.0

type Repos struct {
	Repos            RepoDetails `json:"repository_list"`
	LatestRepoChange *time.Time  `json:"latest_repo_change,omitempty" example:"2024-11-20T12:36:49.640592Z"`
	LastChange       time.Time   `json:"last_change" example:"2024-11-20T12:36:49.640592Z"`
	utils.Pagination
}

type ReposRequest added in v1.17.0

type ReposRequest struct {
	Repos []string `json:"repository_list" example:"rhel-6-server-rpms" minItems:"1" validate:"required"`
	// Return only repositories changed after the given date
	ModifiedSince *time.Time `json:"modified_since" example:"2018-04-05T01:23:45+02:00" format:"date-time"`
	// Include content from \"third party\" repositories into the response, disabled by default.
	ThirdParty bool `json:"third_party" default:"false"`
	// Show updated package names in a repo since the last modified_since
	ShowPackages bool `json:"show_packages" default:"false"`
	// Return only repositories having advisories with packages released since the last modified_since
	HasPackages  bool   `json:"has_packages" default:"false"`
	Organization string `json:"organization"`
	utils.PaginationRequest
}

type Request

type Request struct {
	Packages   []string           `json:"package_list" example:"kernel-2.6.32-696.20.1.el6.x86_64" validate:"required"`
	Repos      *[]string          `json:"repository_list" example:"rhel-6-server-rpms"`
	Modules    []ModuleStreamPtrs `json:"modules_list"`
	Releasever *string            `json:"releasever" example:"6Server"`
	Basearch   *string            `json:"basearch" example:"x86_64"`
	RepoPaths  []string           `json:"repository_paths" example:"/content/dist/rhel/rhui/server/7/7Server/x86_64/os/"`

	// Include content from "third party" repositories into the response, disabled by default.
	ThirdParty   bool `json:"third_party" default:"false"`
	LatestOnly   bool `json:"latest_only"`
	SecurityOnly bool `json:"security_only"`

	Extended      bool   `json:"extended"`
	EpochRequired bool   `json:"epoch_required"`
	Organization  string `json:"organization"`
}

type SRPMPkgNames added in v1.25.0

type SRPMPkgNames struct {
	Names      RPMData   `json:"srpm_name_list"`
	LastChange time.Time `json:"last_change" example:"2024-11-20T12:36:49.640592Z"`
}

type SRPMPkgNamesRequest added in v1.25.0

type SRPMPkgNamesRequest struct {
	SRPMNames   []string `json:"srpm_name_list" example:"openssl" validate:"required"`
	ContentSets []string `json:"content_set_list" example:"rhel-7-desktop-rpms"`
}

type SeverityT added in v1.14.7

type SeverityT []*string

func (*SeverityT) UnmarshalJSON added in v1.14.7

func (slice *SeverityT) UnmarshalJSON(data []byte) error

type TypeT added in v1.14.7

type TypeT []string

func (*TypeT) UnmarshalJSON added in v1.14.7

func (slice *TypeT) UnmarshalJSON(data []byte) error

type Update

type Update struct {
	Package     string `json:"package" example:"kernel-2.6.32-696.23.1.el6.x86_64"`
	PackageName string `json:"package_name" example:"kernel"`
	EVRA        string `json:"evra" example:"0:2.6.32-696.23.1.el6.x86_64"`
	Erratum     string `json:"erratum" example:"RHSA-2018:0512"`
	Repository  string `json:"repository" example:"rhel-6-server-rpms"`
	Basearch    string `json:"basearch" example:"x86_64"`
	Releasever  string `json:"releasever" example:"6Server"`
	// contains filtered or unexported fields
}

type UpdateDetail

type UpdateDetail struct {
	AvailableUpdates []Update `json:"available_updates,omitempty"`
}

type UpdateList

type UpdateList map[string]UpdateDetail

type Updates

type Updates struct {
	UpdateList UpdateList `json:"update_list"`
	RepoList   *[]string  `json:"repository_list,omitempty" example:"rhel-6-server-rpms"`
	// Example: /content/dist/rhel/rhui/server/7/7Server/x86_64/os/
	RepoPaths  []string       `json:"repository_paths,omitempty"`
	ModuleList []ModuleStream `json:"modules_list,omitempty"`
	Releasever *string        `json:"releasever,omitempty" example:"6Server"`
	Basearch   *string        `json:"basearch,omitempty" example:"x86_64"`
	LastChange time.Time      `json:"last_change" example:"2024-11-20T12:36:49.640592Z"`
}

type VariantSuffix added in v1.30.0

type VariantSuffix string

func (*VariantSuffix) Compare added in v1.31.2

func (x *VariantSuffix) Compare(y *VariantSuffix) int

Compare compares this variant to another variant. Returns -1, 0, or 1 if this variant is smaller, equal, or larger than the other variant.

func (*VariantSuffix) Split added in v1.31.2

func (x *VariantSuffix) Split() ([]string, string)

Split variant into slice of version numbers followed by string

type Vulnerabilities

type Vulnerabilities struct {
	CVEs                []Vulnerability `json:"cve_list" validate:"required"`
	ManuallyFixableCVEs []Vulnerability `json:"manually_fixable_cve_list" validate:"required"`
	UnpatchedCVEs       []Vulnerability `json:"unpatched_cve_list" validate:"required"`
	LastChange          time.Time       `json:"last_change" example:"2024-11-20T12:36:49.640592Z"`
}

type VulnerabilitiesCvesDetails

type VulnerabilitiesCvesDetails struct {
	Cves          map[string]VulnerabilityDetail
	ManualCves    map[string]VulnerabilityDetail
	UnpatchedCves map[string]VulnerabilityDetail
	LastChange    *time.Time
}

type VulnerabilitiesExtended

type VulnerabilitiesExtended struct {
	CVEs                []VulnerabilityDetail `json:"cve_list"`
	ManuallyFixableCVEs []VulnerabilityDetail `json:"manually_fixable_cve_list"`
	UnpatchedCVEs       []VulnerabilityDetail `json:"unpatched_cve_list"`
	LastChange          time.Time             `json:"last_change"`
}

type Vulnerability

type Vulnerability string

type VulnerabilityDetail

type VulnerabilityDetail struct {
	CVE      string `json:"cve"`
	Packages map[string]bool
	Errata   map[string]bool
	Affected []AffectedPackage `json:"affected,omitempty"`
}

func (VulnerabilityDetail) MarshalJSON added in v1.0.6

func (d VulnerabilityDetail) MarshalJSON() ([]byte, error)

marshal VulnerabilityDetail Packages and Errata as json arrays for backward compatibility

type VulnerabilityReport added in v1.16.0

type VulnerabilityReport struct {
	OSReleases []OSReleaseDetail `json:"os_releases"`
	LastChange time.Time         `json:"last_change"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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