webpage

package
v0.0.0-...-9a7fc0b Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package webpage contains functions related to generating the XSA information webpage at https://xenbits.xenproject.org/xsa

Index

Constants

View Source
const XSATimeFormat = `"2006-01-02 15:04"`

Variables

This section is empty.

Functions

func GenerateJSON

func GenerateJSON(xsaOrig []*xsagit.XsaInfo, w io.Writer) error

GenerateJSON will take a list of XSAs write out JSON in canonical format to the writer.

XSAs and versions are sorted in ascending order.

A few differences to the perl xsa.json code:

  • We expose information for a lot more XSAs

  • cve and file fields were sometimes empty lists `[ ]`, and sometimes ommitted. This turns out not easy to do using golang's json.Marshal(); just omit empty lists all the time.

  • We don't yet expose the "docs_only" flag

func GeneratePublicWebpage

func GeneratePublicWebpage(xsapath, output string) error

func Push

func Push[S ~[]E, E any](s S, e E) S

func VersionSingleToVarraySingle

func VersionSingleToVarraySingle(v parseadvisory.VersionSingle) *string

func VersionToVArray

func VersionToVArray(v parseadvisory.Version) []*string

Types

type XSAFileInfo

type XSAFileInfo struct {
	Name     string      `json:"name"`
	Project  string      `json:"project,omitempty"`
	Upstream string      `json:"upstream,omitempty"`
	Versions [][]*string `json:"versions,omitempty"`
}

type XSAInfo

type XSAInfo struct {
	Deallocated bool          `json:"deallocated,omitempty"`
	Cve         []string      `json:"cve,omitempty"`
	Files       []XSAFileInfo `json:"files,omitempty"`
	PublicTime  XSATime       `json:"public_time"`
	Title       string        `json:"title,omitempty"`
	Version     int           `json:"version,omitempty"`
	VersionTime *XSATime      `json:"version_time,omitempty"`
	Withdrawn   bool          `json:"withdrawn,omitempty"`
	XSA         int           `json:"xsa,string"` // For some reason this is a string rather than an integer
}

XSAInfo contains information about a given XSA.

XenVersionList and ProjectList are "accumulated" values from Files, to make it easier to filter XSAs at the top level.

type XSATime

type XSATime struct {
	time.Time
}

func (*XSATime) MarshalJSON

func (xt *XSATime) MarshalJSON() ([]byte, error)

func (*XSATime) UnmarshalJSON

func (xt *XSATime) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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