Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(advisors): Make configuration properties secrets #9051

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/advisors/nexus-iq/src/main/kotlin/NexusIq.kt
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ class NexusIq(override val descriptor: PluginDescriptor, private val config: Nex
private val service by lazy {
NexusIqService.create(
config.serverUrl,
config.username,
config.password,
config.username?.value,
config.password?.value,
OkHttpClientHelper.buildClient {
readTimeout(READ_TIMEOUT)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

package org.ossreviewtoolkit.plugins.advisors.nexusiq

import org.ossreviewtoolkit.plugins.api.Secret

/**
* The configuration for Nexus IQ as a security vulnerability provider.
*/
Expand All @@ -37,11 +39,11 @@ data class NexusIqConfiguration(
* The username to use for authentication. If not both [username] and [password] are provided, authentication is
* disabled.
*/
val username: String?,
val username: Secret?,

/**
* The password to use for authentication. If not both [username] and [password] are provided, authentication is
* disabled.
*/
val password: String?
val password: Secret?
)
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class VulnerableCode(override val descriptor: PluginDescriptor, config: Vulnerab
if (config.readTimeout != null) readTimeout(config.readTimeout, TimeUnit.SECONDS)
}

VulnerableCodeService.create(config.serverUrl, config.apiKey, client)
VulnerableCodeService.create(config.serverUrl, config.apiKey?.value, client)
}

override suspend fun retrievePackageFindings(packages: Set<Package>): Map<Package, AdvisorResult> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package org.ossreviewtoolkit.plugins.advisors.vulnerablecode

import org.ossreviewtoolkit.clients.vulnerablecode.VulnerableCodeService
import org.ossreviewtoolkit.plugins.api.OrtPluginOption
import org.ossreviewtoolkit.plugins.api.Secret

/**
* The configuration for VulnerableCode as security vulnerability provider.
Expand All @@ -35,7 +36,7 @@ data class VulnerableCodeConfiguration(
/**
* The optional API key to use.
*/
val apiKey: String?,
val apiKey: Secret?,

/**
* The read timeout for the server connection in seconds. Defaults to whatever is the HTTP client's default value.
Expand Down
Loading