Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // CVEIdRegex is the regular expression used to extract CVE IDs from LSN data. CVEIdRegex = regexp.MustCompile(`^UBUNTU-CVE-\d+-\d+$`) )
Functions ¶
func ComputeDigest ¶
ComputeDigest returns a base64 digest for a map of LSN data. The digest is stable regardless of the ordering of LSNs in the map.
func ProcessZIP ¶
ProcessZIP processes ZIP data from a byte slice and returns LSN data. This is more memory-efficient than ReadZIP when the data is already in memory, as it avoids an additional io.ReadAll() call.
The LSN files in the archive must start with "LSN-" and end with ".json". Any files not matching these criteria will be ignored.
Returns a map of LSN ID to LSNData.
func ReadXZ ¶
ReadXZ reads LSN data from a .tar.xz stream.
The LSN files in the archive must be organised under the `osv/lsn/` prefix. They must also start with "LSN-" and end with ".json". Any files not matching these criteria will be ignored.
Returns a map of LSN ID to LSNData.
The caller is responsible for closing the provided stream.
Types ¶
type LSN ¶
type LSN struct {
SchemaVersion string `json:"schema_version"`
ID string `json:"id"`
Published string `json:"published"`
Modified string `json:"modified"`
Upstream []string `json:"upstream"` // This field contains the CVE IDs related to this LSN, among other information.
Summary string `json:"summary"`
Details string `json:"details"`
}
LSN represents a Livepatch Security Notice in OSV format.
type LSNData ¶
type LSNData struct {
// ID is the unique identifier of the LSN, typically in the format "LSN-YYYY-NNNN".
ID string `json:"ID"`
// Published is the time when the LSN was published.
Published string `json:"Published"`
// Modified is the last modification time of the LSN.
Modified string `json:"Modified"`
// CVEIDs is a list of CVE IDs extracted from the LSN Upstream field.
CVEIDs []string `json:"CVEIDs"`
}
LSNData is a simplified representation of LSN data for storage and API responses.