@@ -41,6 +41,7 @@ import org.ossreviewtoolkit.model.Identifier
41
41
import org.ossreviewtoolkit.model.Package
42
42
import org.ossreviewtoolkit.model.VulnerabilityReference
43
43
import org.ossreviewtoolkit.model.config.AdvisorConfiguration
44
+ import org.ossreviewtoolkit.model.config.OsvConfiguration
44
45
import org.ossreviewtoolkit.utils.common.collectMessages
45
46
import org.ossreviewtoolkit.utils.common.enumSetOf
46
47
import org.ossreviewtoolkit.utils.common.toUri
@@ -51,19 +52,19 @@ import us.springett.cvss.Cvss
51
52
/* *
52
53
* An advice provider that obtains vulnerability information from Open Source Vulnerabilities (https://osv.dev/).
53
54
*/
54
- class Osv (name : String , advisorConfiguration : AdvisorConfiguration ) : AdviceProvider(name) {
55
+ class Osv (name : String , config : OsvConfiguration ) : AdviceProvider(name) {
55
56
companion object : Logging
56
57
57
58
class Factory : AbstractAdviceProviderFactory <Osv >(" OSV" ) {
58
59
override fun create (config : AdvisorConfiguration ) =
59
60
// OSV does not require any dedicated configuration to be present.
60
- Osv (type, config)
61
+ Osv (type, config.forProvider { osv } )
61
62
}
62
63
63
64
override val details: AdvisorDetails = AdvisorDetails (providerName, enumSetOf(AdvisorCapability .VULNERABILITIES ))
64
65
65
66
private val service = OsvService (
66
- serverUrl = advisorConfiguration.osv? .serverUrl,
67
+ serverUrl = config .serverUrl,
67
68
httpClient = OkHttpClientHelper .buildClient()
68
69
)
69
70
0 commit comments