Skip to content

Commit

Permalink
feat(sw360-package-curation-provider)!: Use secret options map
Browse files Browse the repository at this point in the history
Read the authentication credentials from the secrets map instead of the
options map in `Sw360PackageCurationProviderFactory`.

Signed-off-by: Martin Nonnenmacher <[email protected]>
  • Loading branch information
mnonnenmacher committed Oct 9, 2023
1 parent 336fa07 commit 247b3de
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions model/src/main/resources/reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ ort:
options:
restUrl: 'https://your-sw360-rest-url'
authUrl: 'https://your-authentication-url'
secrets:
username: username
password: password
clientId: clientId
Expand Down
4 changes: 3 additions & 1 deletion model/src/test/kotlin/config/OrtConfigurationTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ class Sw360PackageCurationProviderFactory : PackageCurationProviderFactory<Sw360
Sw360StorageConfiguration(
restUrl = options.getValue("restUrl"),
authUrl = options.getValue("authUrl"),
username = options.getValue("username"),
password = options["password"].orEmpty(),
clientId = options.getValue("clientId"),
clientPassword = options["clientPassword"].orEmpty(),
token = options["token"].orEmpty()
username = secrets.getValue("username"),
password = secrets["password"].orEmpty(),
clientId = secrets.getValue("clientId"),
clientPassword = secrets["clientPassword"].orEmpty(),
token = secrets["token"].orEmpty()
)
}

Expand Down

0 comments on commit 247b3de

Please sign in to comment.