Skip to content

Incorrect AdvisoryV2 serialization due to missing PackageCommitPatch and Patch #2116

@keshav-space

Description

@keshav-space

#2017 introduced Patch and PackageCommitPatch to AdvisoryV2, but these are not being reported when serializing AdvisoryV2 to AdvisoryData using AdvisoryV2.to_advisory_data().

  • patches field is missing from AdvisoryV2.to_advisory_data().

    return AdvisoryData(
    advisory_id=self.advisory_id,
    aliases=[item.alias for item in self.aliases.all()],
    summary=self.summary,
    affected_packages=[
    impacted.to_affected_package_data() for impacted in self.impacted_packages.all()
    ],
    references_v2=[ref.to_reference_v2_data() for ref in self.references.all()],
    date_published=self.date_published,
    weaknesses=[weak.cwe_id for weak in self.weaknesses.all()],
    severities=[sev.to_vulnerability_severity_data() for sev in self.severities.all()],
    url=self.url,
    )

  • introduced_by_commit_patches and fixed_by_commit_patches field is missing from ImpactedPackage.to_dict().

    return {
    "package": purl_to_dict(self.base_purl),
    "affected_version_range": self.affecting_vers,
    "fixed_version_range": self.fixed_vers,
    }

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions