Skip to content

Commit

Permalink
feat(osv): Enable querying vulnerabilities for the SwiftURL ecosystem
Browse files Browse the repository at this point in the history
Since the package identifiers in OSV's vulnerability data for the
SwiftURL ecosystem have become consistent [1], it is now clear how to
construct the requests. Simply add the missing mapping and a test to
enable retrieving vulnerabilities for Swift packages.

Fixes #7841.

[1] google/osv.dev#1923 (comment)

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
  • Loading branch information
fviernau authored and sschuberth committed May 24, 2024
1 parent 740b7d6 commit c7edb85
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions clients/osv/src/main/kotlin/Model.kt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ object Ecosystem {
const val PUB = "Pub"
const val PYPI = "PyPI"
const val RUBY_GEMS = "RubyGems"
const val SWIFT_URL = "SwiftURL"
}

@Serializable(EventSerializer::class)
Expand Down
3 changes: 2 additions & 1 deletion plugins/advisors/osv/src/funTest/kotlin/OsvFunTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class OsvFunTest : StringSpec({
"NPM::rebber:1.0.0",
"NuGet::Bunkum:4.0.0",
"Pub::http:0.13.1",
"PyPI::django:3.2"
"PyPI::django:3.2",
"Swift::github.com/apple/swift-nio:2.41.0"
).mapTo(mutableSetOf()) {
identifierToPackage(it)
}
Expand Down
1 change: 1 addition & 0 deletions plugins/advisors/osv/src/main/kotlin/Osv.kt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ private fun createRequest(pkg: Package): VulnerabilitiesForPackageRequest? {
"Maven" -> Ecosystem.MAVEN
"Pub" -> Ecosystem.PUB
"PyPI" -> Ecosystem.PYPI
"Swift" -> Ecosystem.SWIFT_URL
else -> null
}

Expand Down

0 comments on commit c7edb85

Please sign in to comment.