From 2147b4fee9d6897f86139315e8e6e82f2818879d Mon Sep 17 00:00:00 2001 From: Frank Viernau Date: Fri, 10 Nov 2023 10:30:24 +0100 Subject: [PATCH] feat(osv): Add the missing handling for the Hackage ecosystem Signed-off-by: Frank Viernau --- clients/osv/src/main/kotlin/Model.kt | 1 + plugins/advisors/osv/src/funTest/kotlin/OsvFunTest.kt | 1 + plugins/advisors/osv/src/main/kotlin/Osv.kt | 1 + 3 files changed, 3 insertions(+) diff --git a/clients/osv/src/main/kotlin/Model.kt b/clients/osv/src/main/kotlin/Model.kt index c60e8b52d60f2..4e24a0d63e8df 100644 --- a/clients/osv/src/main/kotlin/Model.kt +++ b/clients/osv/src/main/kotlin/Model.kt @@ -111,6 +111,7 @@ object Ecosystem { const val DEBIAN = "Debian" const val GIHUB_ACTIONS = "GitHub Actions" const val GO = "Go" + const val HACKAGE = "Hackage" const val HEX = "Hex" const val LINUX = "Linux" const val MAVEN = "Maven" diff --git a/plugins/advisors/osv/src/funTest/kotlin/OsvFunTest.kt b/plugins/advisors/osv/src/funTest/kotlin/OsvFunTest.kt index 5520def553aee..d4b09d1c2803a 100644 --- a/plugins/advisors/osv/src/funTest/kotlin/OsvFunTest.kt +++ b/plugins/advisors/osv/src/funTest/kotlin/OsvFunTest.kt @@ -43,6 +43,7 @@ class OsvFunTest : StringSpec({ "Composer:thorsten:phpmyfaq:3.0.7", "Gem::rack:2.0.4", "Go::github.com/nats-io/nats-server/v2:2.1.0", + "Hackage::xml-conduit:0.5.0", "Maven:com.jfinal:jfinal:1.4", "NPM::rebber:1.0.0", "NuGet::Bunkum:4.0.0", diff --git a/plugins/advisors/osv/src/main/kotlin/Osv.kt b/plugins/advisors/osv/src/main/kotlin/Osv.kt index afc2b3daf34f2..c1dde1d62055a 100644 --- a/plugins/advisors/osv/src/main/kotlin/Osv.kt +++ b/plugins/advisors/osv/src/main/kotlin/Osv.kt @@ -150,6 +150,7 @@ private fun createRequest(pkg: Package): VulnerabilitiesForPackageRequest? { "Crate" -> Ecosystem.CRATES_IO "Gem" -> Ecosystem.RUBY_GEMS "Go" -> Ecosystem.GO + "Hackage" -> Ecosystem.HACKAGE "NPM" -> Ecosystem.NPM "NuGet" -> Ecosystem.NUGET "Maven" -> Ecosystem.MAVEN