func()

in providers/redhat/schema/convert.go [29:69]


func (cve *CVE) Convert() (*nvd.NVDCVEFeedJSON10DefCVEItem, error) {
	publishedDate, err := convertTime(cve.PublicDate)
	if err != nil {
		return nil, fmt.Errorf("unable to convert published date: %v", err)
	}
	configurations, err := cve.newConfigurations()
	if err != nil {
		return nil, fmt.Errorf("unable to construct configurations: %v", err)
	}
	impact, err := cve.newImpact()
	if err != nil {
		return nil, fmt.Errorf("unable to construct impact: %v", err)
	}

	item := nvd.NVDCVEFeedJSON10DefCVEItem{
		CVE: &nvd.CVEJSON40{
			CVEDataMeta: &nvd.CVEJSON40CVEDataMeta{
				ID:       cve.ID(),
				ASSIGNER: "redhat",
			},
			DataFormat:  "MITRE",
			DataType:    "CVE",
			DataVersion: cveVersion,
			Description: &nvd.CVEJSON40Description{
				DescriptionData: []*nvd.CVEJSON40LangString{
					{
						Lang:  "en",
						Value: strings.Join(cve.Details, "\n"),
					},
				},
			},
			Problemtype: cve.newProblemType(),
			References:  cve.newReferences(),
		},
		Configurations: configurations,
		Impact:         impact,
		PublishedDate:  publishedDate,
	}

	return &item, nil
}