From 92e9bae87f3bff0681ebf0a20d7fb22d3fca137b Mon Sep 17 00:00:00 2001 From: Enrico Risa Date: Thu, 15 Feb 2024 09:58:44 +0100 Subject: [PATCH] chore: pr suggestions --- .github/workflows/verify.yaml | 4 +--- edc-extensions/iatp/tx-iatp-sts-dim/build.gradle.kts | 2 -- .../edc/iam/iatp/sts/dim/DimOauthClientExtension.java | 4 ++++ .../edc/iam/iatp/sts/dim/DimSecureTokenService.java | 8 ++++++++ .../iam/iatp/sts/dim/StsRemoteClientConfiguration.java | 8 +++++++- edc-tests/e2e-tests/build.gradle.kts | 1 + 6 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml index 8ee780849..27510f350 100644 --- a/.github/workflows/verify.yaml +++ b/.github/workflows/verify.yaml @@ -119,9 +119,7 @@ jobs: - uses: ./.github/actions/setup-java - name: Run E2E tests - run: | - ./gradlew compileJava compileTestJava - ./gradlew test -DincludeTags="EndToEndTest" -PverboseTest=true + run: ./gradlew test -DincludeTags="EndToEndTest" -PverboseTest=true postgres-tests: runs-on: ubuntu-latest diff --git a/edc-extensions/iatp/tx-iatp-sts-dim/build.gradle.kts b/edc-extensions/iatp/tx-iatp-sts-dim/build.gradle.kts index 69c8771c3..1286f6cf1 100644 --- a/edc-extensions/iatp/tx-iatp-sts-dim/build.gradle.kts +++ b/edc-extensions/iatp/tx-iatp-sts-dim/build.gradle.kts @@ -23,8 +23,6 @@ plugins { } dependencies { - implementation(libs.edc.spi.core) - implementation(libs.edc.spi.policyengine) implementation(libs.edc.identity.trust.spi) implementation(libs.edc.auth.oauth2.client) implementation(project(":spi:core-spi")) diff --git a/edc-extensions/iatp/tx-iatp-sts-dim/src/main/java/org/eclipse/tractusx/edc/iam/iatp/sts/dim/DimOauthClientExtension.java b/edc-extensions/iatp/tx-iatp-sts-dim/src/main/java/org/eclipse/tractusx/edc/iam/iatp/sts/dim/DimOauthClientExtension.java index 5df770640..a21184a80 100644 --- a/edc-extensions/iatp/tx-iatp-sts-dim/src/main/java/org/eclipse/tractusx/edc/iam/iatp/sts/dim/DimOauthClientExtension.java +++ b/edc-extensions/iatp/tx-iatp-sts-dim/src/main/java/org/eclipse/tractusx/edc/iam/iatp/sts/dim/DimOauthClientExtension.java @@ -28,6 +28,10 @@ import org.eclipse.tractusx.edc.iam.iatp.sts.dim.oauth.DimOauth2Client; import org.eclipse.tractusx.edc.iam.iatp.sts.dim.oauth.DimOauthClientImpl; +/** + * Extension that provides an implementation if {@link DimOauth2Client} using {@link Oauth2Client} + * and the {@link StsRemoteClientConfiguration} configuration for fetching an OAuth token + */ @Extension(DimOauthClientExtension.NAME) public class DimOauthClientExtension implements ServiceExtension { diff --git a/edc-extensions/iatp/tx-iatp-sts-dim/src/main/java/org/eclipse/tractusx/edc/iam/iatp/sts/dim/DimSecureTokenService.java b/edc-extensions/iatp/tx-iatp-sts-dim/src/main/java/org/eclipse/tractusx/edc/iam/iatp/sts/dim/DimSecureTokenService.java index aec155590..1de0a017f 100644 --- a/edc-extensions/iatp/tx-iatp-sts-dim/src/main/java/org/eclipse/tractusx/edc/iam/iatp/sts/dim/DimSecureTokenService.java +++ b/edc-extensions/iatp/tx-iatp-sts-dim/src/main/java/org/eclipse/tractusx/edc/iam/iatp/sts/dim/DimSecureTokenService.java @@ -53,6 +53,14 @@ import static org.eclipse.edc.jwt.spi.JwtRegisteredClaimNames.SUBJECT; import static org.eclipse.edc.spi.http.FallbackFactories.retryWhenStatusIsNotIn; +/** + * Implementation of {@link SecureTokenService} that talks with DIM wallet. It supports two APIs for fetching the + * SI Token: + * + */ public class DimSecureTokenService implements SecureTokenService { public static final MediaType TYPE_JSON = MediaType.parse("application/json"); diff --git a/edc-extensions/iatp/tx-iatp-sts-dim/src/main/java/org/eclipse/tractusx/edc/iam/iatp/sts/dim/StsRemoteClientConfiguration.java b/edc-extensions/iatp/tx-iatp-sts-dim/src/main/java/org/eclipse/tractusx/edc/iam/iatp/sts/dim/StsRemoteClientConfiguration.java index 79f5ace71..35cd8c913 100644 --- a/edc-extensions/iatp/tx-iatp-sts-dim/src/main/java/org/eclipse/tractusx/edc/iam/iatp/sts/dim/StsRemoteClientConfiguration.java +++ b/edc-extensions/iatp/tx-iatp-sts-dim/src/main/java/org/eclipse/tractusx/edc/iam/iatp/sts/dim/StsRemoteClientConfiguration.java @@ -19,8 +19,14 @@ package org.eclipse.tractusx.edc.iam.iatp.sts.dim; +import org.eclipse.edc.spi.security.Vault; + /** - * Configuration of the OAuth2 client + * Configuration of the OAuth2 client for the OAuth2 Client credentials flow + * + * @param tokenUrl The token endpoint + * @param clientId The identifier of the client + * @param clientSecretAlias The client secret alias to be used with the {@link Vault} for fetching the secret */ public record StsRemoteClientConfiguration(String tokenUrl, String clientId, String clientSecretAlias) { diff --git a/edc-tests/e2e-tests/build.gradle.kts b/edc-tests/e2e-tests/build.gradle.kts index 45ae8df12..52ae1929c 100644 --- a/edc-tests/e2e-tests/build.gradle.kts +++ b/edc-tests/e2e-tests/build.gradle.kts @@ -62,6 +62,7 @@ dependencies { testCompileOnly(project(":edc-tests:runtime:runtime-memory")) testCompileOnly(project(":edc-tests:runtime:iatp:runtime-memory-sts")) testCompileOnly(project(":edc-tests:runtime:iatp:runtime-memory-iatp-ih")) + testCompileOnly(project(":edc-tests:runtime:iatp:runtime-memory-iatp-dim-ih")) testCompileOnly(project(":edc-tests:runtime:runtime-memory-ssi")) testCompileOnly(project(":edc-tests:runtime:runtime-postgresql"))