diff options
author | 2024-02-02 19:37:06 -0800 | |
---|---|---|
committer | 2024-02-02 19:37:06 -0800 | |
commit | 90dac72e7e2c20755a86dc4c9243f312f2c6272d (patch) | |
tree | 8b79bc46549d4cecd75d2096c7de55aa1ba8d6eb | |
parent | models/reference: add GLIBC-SA (diff) | |
download | glsamaker-90dac72e7e2c20755a86dc4c9243f312f2c6272d.tar.gz glsamaker-90dac72e7e2c20755a86dc4c9243f312f2c6272d.tar.bz2 glsamaker-90dac72e7e2c20755a86dc4c9243f312f2c6272d.zip |
glsamaker/models: add reference URL for XSA advisoriesglsamakerv4
Signed-off-by: John Helmert III <ajak@gentoo.org>
-rw-r--r-- | glsamaker/models/reference.py | 5 | ||||
-rw-r--r-- | glsamaker/tests/models/test_reference.py | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/glsamaker/models/reference.py b/glsamaker/models/reference.py index 272f5ee..2e0f146 100644 --- a/glsamaker/models/reference.py +++ b/glsamaker/models/reference.py @@ -52,6 +52,11 @@ class Reference(base): self.url += f"{ref.lower()}.html" elif ref_text.startswith("YSA"): self.url = f"https://www.yubico.com/support/security-advisories/{self.ref_text}" + elif ref_text.startswith("XSA"): + ref_text_components = ref_text.split("-") + if len(ref_text_components) > 1: + xsa_id = ref_text_components[1] + self.url = f"https://xenbits.xen.org/xsa/advisory-{xsa_id}.html" # TODO: see bug.py's new TODO @classmethod diff --git a/glsamaker/tests/models/test_reference.py b/glsamaker/tests/models/test_reference.py index d4364a6..55379ef 100644 --- a/glsamaker/tests/models/test_reference.py +++ b/glsamaker/tests/models/test_reference.py @@ -39,6 +39,8 @@ class TestReference: "YSA-2021-03", "https://www.yubico.com/support/security-advisories/YSA-2021-03", ), + ("XSA-123", "https://xenbits.xen.org/xsa/advisory-123.html"), + ("XSAGARBAGE", None), ], ) def test_reference_url(self, identifier, url): |