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

Function get_advisory_data

vulnerabilities/importers/rust.py:229–241  ·  view source on GitHub ↗

Return a mapping of vulnerability data from a RustSec advisory file at ``location``. RustSec advisories documents are .md files starting with a block of TOML identified as the text inside a tripple-backtick TOML block. Per https://github.com/RustSec/advisory-db#advisory-format:

(location)

Source from the content-addressed store, hash-verified

227
228
229def get_advisory_data(location):
230 """
231 Return a mapping of vulnerability data from a RustSec advisory file at
232 ``location``.
233 RustSec advisories documents are .md files starting with a block of TOML
234 identified as the text inside a tripple-backtick TOML block. Per
235 https://github.com/RustSec/advisory-db#advisory-format:
236 Advisories are formatted in Markdown with TOML "front matter".
237 """
238
239 with open(location) as lines:
240 toml_lines = get_toml_lines(lines)
241 return data_from_toml_lines(toml_lines)

Callers 3

collect_packagesMethod · 0.85
_load_advisoryMethod · 0.85

Calls 2

get_toml_linesFunction · 0.85
data_from_toml_linesFunction · 0.85

Tested by 1