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)
| 227 | |
| 228 | |
| 229 | def 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) |