models

package
v0.0.0-...-d9b5379 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VulnerabilitySchemaTypeOpenSSF = "OpenSSF"
	VulnerabilitySourceOpenSSF     = VulnerabilitySchemaTypeOpenSSF
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Vulnerability

type Vulnerability struct {
	gorm.Model

	// Lookup key, must be unique (Composite index on MySQL 8 must be < 3072/4 with utf8mb4)
	Ecosystem string `gorm:"type:varchar(32);not null;index:lookup_idx;priority:1"`
	Group     string `gorm:"type:varchar(512);not null;index:lookup_idx;priority:2"`
	Name      string `gorm:"type:varchar(128);not null;index:lookup_idx;priority:3"`

	// Meta data to deserialize Data into appropriate vulnerability model
	SchemaType    string `gorm:"type:varchar(32);not null"`
	SchemaVersion string `gorm:"type:varchar(32);not null"`

	// Common vulnerability data
	ExternalSource string `gorm:"type:varchar(32);not null;uniqueIndex:external_src_idx;priority:1"`
	ExternalId     string `gorm:"type:varchar(128);unique;not null;uniqueIndex:external_src_idx;priority:2"`
	Title          string `gorm:"not null"`
	Description    string `gorm:"not null"`

	// JSON serialized vulnerability data in SchemaType/SchemaVersion format
	Data datatypes.JSON `gorm:"not null;size:2097152"`

	// Timestamp for vulnerability data from external sources
	DataModifiedAt  time.Time `gorm:"not null"`
	DataPublishedAt time.Time `gorm:"not null"`
}

Jump to

Keyboard shortcuts

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