File tree Expand file tree Collapse file tree 4 files changed +9
-5
lines changed
plugins/scanners/scanoss/src Expand file tree Collapse file tree 4 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ class ScanOss(
5454 private val service = ScanApi .builder()
5555 // As there is only a single endpoint, the SCANOSS API client expects the path to be part of the API URL.
5656 .url(config.apiUrl.removeSuffix(" /" ) + " /scan/direct" )
57- .apiKey(config.apiKey)
57+ .apiKey(config.apiKey.value )
5858 .build()
5959
6060 override val version: String by lazy {
Original file line number Diff line number Diff line change 2020package org.ossreviewtoolkit.plugins.scanners.scanoss
2121
2222import org.ossreviewtoolkit.plugins.api.OrtPluginOption
23+ import org.ossreviewtoolkit.plugins.api.Secret
2324
2425data class ScanOssConfig (
2526 /* * The URL of the ScanOSS server. */
2627 @OrtPluginOption(defaultValue = " https://api.osskb.org/" )
2728 val apiUrl : String ,
2829
29- /* * The API key required to authenticate with the ScanOSS server. */
30- val apiKey : String ,
30+ /* * The API key used to authenticate with the ScanOSS server. */
31+ @OrtPluginOption(defaultValue = " " )
32+ val apiKey : Secret ,
3133
3234 /* *
3335 * A regular expression to match the scanner name when looking up scan results in the storage.
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ import org.ossreviewtoolkit.model.SnippetFinding
4242import org.ossreviewtoolkit.model.TextLocation
4343import org.ossreviewtoolkit.model.VcsInfo
4444import org.ossreviewtoolkit.model.VcsType
45+ import org.ossreviewtoolkit.plugins.api.Secret
4546import org.ossreviewtoolkit.scanner.ScanContext
4647import org.ossreviewtoolkit.utils.spdx.SpdxExpression
4748
@@ -61,7 +62,7 @@ class ScanOssScannerDirectoryTest : StringSpec({
6162
6263 beforeSpec {
6364 server.start()
64- scanner = spyk(ScanOssFactory .create(apiUrl = "http://localhost:${server.port()}", apiKey = "" ))
65+ scanner = spyk(ScanOssFactory .create(apiUrl = "http://localhost:${server.port()}", apiKey = Secret ("") ))
6566 }
6667
6768 afterSpec {
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import java.util.UUID
3636import org.ossreviewtoolkit.model.LicenseFinding
3737import org.ossreviewtoolkit.model.PackageType
3838import org.ossreviewtoolkit.model.TextLocation
39+ import org.ossreviewtoolkit.plugins.api.Secret
3940import org.ossreviewtoolkit.scanner.ScanContext
4041
4142private val TEST_FILE_TO_SCAN = File (" src/test/assets/filesToScan/ScannerFactory.kt" )
@@ -54,7 +55,7 @@ class ScanOssScannerFileTest : StringSpec({
5455
5556 beforeSpec {
5657 server.start()
57- scanner = spyk(ScanOssFactory .create(apiUrl = "http://localhost:${server.port()}", apiKey = "" ))
58+ scanner = spyk(ScanOssFactory .create(apiUrl = "http://localhost:${server.port()}", apiKey = Secret ("") ))
5859 }
5960
6061 afterSpec {
You can’t perform that action at this time.
0 commit comments