summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--glsamaker/models/reference.py5
-rw-r--r--glsamaker/tests/models/test_reference.py2
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):