Bypass purls (mostly) for deny checks
This commit is contained in:
+9
-1
@@ -233,7 +233,7 @@ function validatePURL(allow_dependencies_licenses: string[] | undefined): void {
|
||||
return
|
||||
}
|
||||
const invalid_purls = allow_dependencies_licenses.filter(
|
||||
purl => !PackageURL.fromString(purl)
|
||||
purl => !isPURLValid(purl)
|
||||
)
|
||||
|
||||
if (invalid_purls.length > 0) {
|
||||
@@ -243,3 +243,11 @@ function validatePURL(allow_dependencies_licenses: string[] | undefined): void {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
const isPURLValid = (purl: string): boolean => {
|
||||
try {
|
||||
return PackageURL.fromString(purl) !== null
|
||||
} catch (error) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user