Index: openacs-4/packages/acs-tcl/lib/check-installed.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/lib/check-installed.tcl,v diff -u -r1.3.2.14 -r1.3.2.15 --- openacs-4/packages/acs-tcl/lib/check-installed.tcl 1 Aug 2024 12:35:08 -0000 1.3.2.14 +++ openacs-4/packages/acs-tcl/lib/check-installed.tcl 5 Aug 2024 14:42:53 -0000 1.3.2.15 @@ -106,29 +106,22 @@ } } -#ns_log notice "vulnerabilityCheck configured: [dict exists $resource_info vulnerabilityCheck]" if {[dict exists $resource_info vulnerabilityCheck]} { set vulnerabilityCheck [dict get $resource_info vulnerabilityCheck] dict with vulnerabilityCheck { - switch $service { - snyk { - set vulnerabilityCheckURL https://snyk.io/advisor/npm-package/$library - set vulnerabilityCheckVersionURL https://security.snyk.io/package/npm/$library/$version - set page [::util::resources::http_get_with_default \ - -url $vulnerabilityCheckVersionURL \ - -key snyk-$library/$version] - if {$page eq ""} { - unset vulnerabilityCheckVersionURL - ns_log notice "vulnerabilityCheck: request failed $vulnerabilityCheckVersionURL" - } else { - ns_log notice "vulnerabilityCheck: keep vulnerabilityCheckVersionURL $vulnerabilityCheckVersionURL" - } - } - default "vulnerabilityCheck: unknown service '$service'" + set result [::util::resources::check_vulnerability \ + -service $service \ + -library $library \ + -version $version] + if {[dict get $result hasVulnerability] ne "?"} { + set vulnerabilityCheckURL [dict get $result libraryURL] + set vulnerabilityCheckVersionURL [dict get $result versionURL] + set vulnerabilityCheckResult [dict get $result hasVulnerability] } } } + foreach url {versionCheckURL vulnerabilityCheck} { if {[dict exists $resource_info $url]} { set $url [dict get $resource_info $url]