MCPcopy Create free account
hub / github.com/aboutcode-org/vulnerablecode / from_id

Method from_id

vulnerabilities/references.py:87–97  ·  view source on GitHub ↗

Return a new XsaReference from an XSA-XXXX id.

(cls, xsa_id)

Source from the content-addressed store, hash-verified

85
86 @classmethod
87 def from_id(cls, xsa_id):
88 """
89 Return a new XsaReference from an XSA-XXXX id.
90 """
91 if not xsa_id or not xsa_id.lower().startswith("xsa"):
92 return ValueError(f"Not a Xen reference. Does not start with XSA: {xsa_id!r}")
93 _, numid = xsa_id.rsplit("-")
94 return ReferenceV2(
95 reference_id=xsa_id,
96 url=f"https://xenbits.xen.org/xsa/advisory-{numid}.html",
97 )
98
99 @classmethod
100 def from_number(cls, number):

Callers

nothing calls this directly

Calls 1

ReferenceV2Class · 0.90

Tested by

no test coverage detected