From 247b3de0112d2bb7fc089536d712a677c1bd12ad Mon Sep 17 00:00:00 2001 From: Martin Nonnenmacher Date: Sun, 8 Oct 2023 18:23:37 +0200 Subject: [PATCH] feat(sw360-package-curation-provider)!: Use secret options map Read the authentication credentials from the secrets map instead of the options map in `Sw360PackageCurationProviderFactory`. Signed-off-by: Martin Nonnenmacher --- model/src/main/resources/reference.yml | 1 + model/src/test/kotlin/config/OrtConfigurationTest.kt | 4 +++- .../src/main/kotlin/Sw360PackageCurationProvider.kt | 10 +++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/model/src/main/resources/reference.yml b/model/src/main/resources/reference.yml index 7dbae0cbcbb15..0f436ff46c03f 100644 --- a/model/src/main/resources/reference.yml +++ b/model/src/main/resources/reference.yml @@ -72,6 +72,7 @@ ort: options: restUrl: 'https://your-sw360-rest-url' authUrl: 'https://your-authentication-url' + secrets: username: username password: password clientId: clientId diff --git a/model/src/test/kotlin/config/OrtConfigurationTest.kt b/model/src/test/kotlin/config/OrtConfigurationTest.kt index bc8f9d76aedc4..76ded94e05b42 100644 --- a/model/src/test/kotlin/config/OrtConfigurationTest.kt +++ b/model/src/test/kotlin/config/OrtConfigurationTest.kt @@ -85,7 +85,9 @@ class OrtConfigurationTest : WordSpec({ type = "SW360", options = mapOf( "restUrl" to "https://your-sw360-rest-url", - "authUrl" to "https://your-authentication-url", + "authUrl" to "https://your-authentication-url" + ), + secrets = mapOf( "username" to "username", "password" to "password", "clientId" to "clientId", diff --git a/plugins/package-curation-providers/sw360/src/main/kotlin/Sw360PackageCurationProvider.kt b/plugins/package-curation-providers/sw360/src/main/kotlin/Sw360PackageCurationProvider.kt index 2e0de9bfa0de1..558fbd53d85a4 100644 --- a/plugins/package-curation-providers/sw360/src/main/kotlin/Sw360PackageCurationProvider.kt +++ b/plugins/package-curation-providers/sw360/src/main/kotlin/Sw360PackageCurationProvider.kt @@ -57,11 +57,11 @@ class Sw360PackageCurationProviderFactory : PackageCurationProviderFactory