Skip to content

Commit 5e77ad3

Browse files
committed
chore(sw360)!: Remove the scan storage implementation
This still uses the "legacy" SW360 client and generally seems to be unused. Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 6a49b6a commit 5e77ad3

File tree

8 files changed

+2
-332
lines changed

8 files changed

+2
-332
lines changed

integrations/schemas/analyzer-configuration-schema.json

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -24,48 +24,8 @@
2424
"packageManagers": {
2525
"$ref": "https://raw.githubusercontent.com/oss-review-toolkit/ort/main/integrations/schemas/package-manager-configuration-schema.json"
2626
},
27-
"sw360Configuration": {
28-
"$ref": "#/definitions/Sw360Configuration"
29-
},
3027
"skipExcluded": {
3128
"type": "boolean"
3229
}
33-
},
34-
"definitions": {
35-
"Sw360Configuration": {
36-
"type": "object",
37-
"additionalProperties": false,
38-
"properties": {
39-
"restUrl": {
40-
"type": "string",
41-
"format": "uri"
42-
},
43-
"authUrl": {
44-
"type": "string",
45-
"format": "uri"
46-
},
47-
"username": {
48-
"type": "string"
49-
},
50-
"password": {
51-
"type": "string"
52-
},
53-
"clientId": {
54-
"type": "string"
55-
},
56-
"clientPassword": {
57-
"type": "string"
58-
},
59-
"token": {
60-
"type": "string"
61-
}
62-
},
63-
"required": [
64-
"authUrl",
65-
"clientId",
66-
"restUrl",
67-
"username"
68-
]
69-
}
7030
}
7131
}

model/src/main/kotlin/config/ScanStorageConfiguration.kt

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
package org.ossreviewtoolkit.model.config
2121

22-
import com.fasterxml.jackson.annotation.JsonProperty
2322
import com.fasterxml.jackson.annotation.JsonSubTypes
2423
import com.fasterxml.jackson.annotation.JsonSubTypes.Type
2524
import com.fasterxml.jackson.annotation.JsonTypeInfo
@@ -38,8 +37,7 @@ import org.ossreviewtoolkit.utils.ort.storage.FileStorage
3837
@JsonSubTypes(
3938
Type(ClearlyDefinedStorageConfiguration::class),
4039
Type(FileBasedStorageConfiguration::class),
41-
Type(PostgresStorageConfiguration::class),
42-
Type(Sw360StorageConfiguration::class)
40+
Type(PostgresStorageConfiguration::class)
4341
)
4442
sealed interface ScanStorageConfiguration
4543

@@ -83,50 +81,6 @@ data class PostgresStorageConfiguration(
8381
val type: StorageType = StorageType.PROVENANCE_BASED
8482
) : ScanStorageConfiguration
8583

86-
/**
87-
* A class to hold the configuration for SW360.
88-
*/
89-
data class Sw360StorageConfiguration(
90-
/**
91-
* The REST API URL of SW360.
92-
*/
93-
val restUrl: String,
94-
95-
/**
96-
* The authentication URL of your SW360 instance.
97-
*/
98-
val authUrl: String,
99-
100-
/**
101-
* The username for the requests to SW360.
102-
*/
103-
val username: String,
104-
105-
/**
106-
* The password of the SW360 user.
107-
*/
108-
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
109-
val password: String = "",
110-
111-
/**
112-
* The client ID of the SW360 instance for the two-step authentication.
113-
*/
114-
val clientId: String,
115-
116-
/**
117-
* The password of the client ID.
118-
*/
119-
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
120-
val clientPassword: String = "",
121-
122-
/**
123-
* Optional access token that can be used instead of the [authUrl], [username], [password], [clientId] and
124-
* [clientPassword] if the token is already known.
125-
*/
126-
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
127-
val token: String = ""
128-
) : ScanStorageConfiguration
129-
13084
/**
13185
* An enum to describe different types of storages.
13286
*/

model/src/main/resources/reference.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,6 @@ ort:
330330
minimumIdle: 600000
331331
type: PROVENANCE_BASED
332332

333-
sw360Configuration:
334-
restUrl: 'https://your-sw360-rest-url'
335-
authUrl: 'https://your-authentication-url'
336-
username: username
337-
password: password
338-
clientId: clientId
339-
clientPassword: clientPassword
340-
token: token
341-
342333
# Storage readers are listed from highest to lower priority, i.e. the first match wins.
343334
storageReaders: [local, postgres, http, aws, clearlyDefined]
344335

model/src/test/kotlin/config/OrtConfigurationTest.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class OrtConfigurationTest : WordSpec({
264264

265265
storages shouldNotBeNull {
266266
keys should containExactlyInAnyOrder(
267-
"local", "http", "aws", "clearlyDefined", "postgres", "sw360Configuration"
267+
"local", "http", "aws", "clearlyDefined", "postgres"
268268
)
269269

270270
val localStorage = this["local"]
@@ -310,16 +310,6 @@ class OrtConfigurationTest : WordSpec({
310310
}
311311

312312
postgresStorage.type shouldBe StorageType.PROVENANCE_BASED
313-
314-
val sw360Storage = this["sw360Configuration"]
315-
sw360Storage.shouldBeInstanceOf<Sw360StorageConfiguration>()
316-
sw360Storage.restUrl shouldBe "https://your-sw360-rest-url"
317-
sw360Storage.authUrl shouldBe "https://your-authentication-url"
318-
sw360Storage.username shouldBe "username"
319-
sw360Storage.password shouldBe "password"
320-
sw360Storage.clientId shouldBe "clientId"
321-
sw360Storage.clientPassword shouldBe "clientPassword"
322-
sw360Storage.token shouldBe "token"
323313
}
324314

325315
storageReaders should containExactly("local", "postgres", "http", "aws", "clearlyDefined")

model/src/test/kotlin/config/Sw360StorageConfigurationTest.kt

Lines changed: 0 additions & 44 deletions
This file was deleted.

scanner/build.gradle.kts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ dependencies {
3737
implementation(libs.bundles.exposed)
3838
implementation(libs.kotlinx.coroutines)
3939
implementation(libs.postgres)
40-
implementation(libs.sw360Client) {
41-
constraints {
42-
implementation("commons-io:commons-io:2.20.0")
43-
.because("commons-io 2.11.0 is vulnerable by CVE-2024-47554")
44-
}
45-
}
4640

4741
funTestImplementation(platform(projects.plugins.scanners))
4842
funTestImplementation(platform(projects.plugins.versionControlSystems))

scanner/src/main/kotlin/ScanStorages.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import org.ossreviewtoolkit.model.config.PostgresStorageConfiguration
2727
import org.ossreviewtoolkit.model.config.ScanStorageConfiguration
2828
import org.ossreviewtoolkit.model.config.ScannerConfiguration
2929
import org.ossreviewtoolkit.model.config.StorageType
30-
import org.ossreviewtoolkit.model.config.Sw360StorageConfiguration
3130
import org.ossreviewtoolkit.model.utils.DatabaseUtils
3231
import org.ossreviewtoolkit.scanner.provenance.NestedProvenance
3332
import org.ossreviewtoolkit.scanner.provenance.NestedProvenanceScanResult
@@ -41,7 +40,6 @@ import org.ossreviewtoolkit.scanner.storages.PackageBasedFileStorage
4140
import org.ossreviewtoolkit.scanner.storages.PackageBasedPostgresStorage
4241
import org.ossreviewtoolkit.scanner.storages.ProvenanceBasedFileStorage
4342
import org.ossreviewtoolkit.scanner.storages.ProvenanceBasedPostgresStorage
44-
import org.ossreviewtoolkit.scanner.storages.Sw360Storage
4543
import org.ossreviewtoolkit.utils.common.div
4644
import org.ossreviewtoolkit.utils.ort.ortDataDirectory
4745
import org.ossreviewtoolkit.utils.ort.storage.XZCompressedLocalFileStorage
@@ -128,7 +126,6 @@ private fun createStorage(config: ScanStorageConfiguration): ScanStorage =
128126
is FileBasedStorageConfiguration -> createFileBasedStorage(config)
129127
is PostgresStorageConfiguration -> createPostgresStorage(config)
130128
is ClearlyDefinedStorageConfiguration -> createClearlyDefinedStorage(config)
131-
is Sw360StorageConfiguration -> createSw360Storage(config)
132129
}
133130

134131
private fun createFileBasedStorage(config: FileBasedStorageConfiguration) =
@@ -148,5 +145,3 @@ private fun createPostgresStorage(config: PostgresStorageConfiguration) =
148145
}
149146

150147
private fun createClearlyDefinedStorage(config: ClearlyDefinedStorageConfiguration) = ClearlyDefinedStorage(config)
151-
152-
private fun createSw360Storage(config: Sw360StorageConfiguration) = Sw360Storage(config)

0 commit comments

Comments
 (0)