From 09eee23b959a7ad79de2f49f1f6865c822efc983 Mon Sep 17 00:00:00 2001 From: ndr_brt Date: Mon, 21 Oct 2024 09:02:43 +0200 Subject: [PATCH] fix compilation --- DEPENDENCIES | 486 +++++++++--------- .../AgreementRetirementValidator.java | 19 +- ...tirementPreValidatorRegisterExtension.java | 10 +- .../AgreementRetirementValidatorTest.java | 17 +- ...mentPreValidatorRegisterExtensionTest.java | 10 +- .../bpn-validation-core/build.gradle.kts | 3 +- ...inessPartnerNumberValidationExtension.java | 27 +- .../BusinessPartnerValidationExtension.java | 26 +- .../BusinessPartnerGroupFunction.java | 33 +- ...sinessPartnerNumberPermissionFunction.java | 28 +- ...sPartnerNumberValidationExtensionTest.java | 10 +- .../BusinessPartnerGroupFunctionTest.java | 109 ++-- ...ssPartnerNumberPermissionFunctionTest.java | 151 +++--- edc-extensions/cx-policy/build.gradle.kts | 6 +- .../edc/policy/cx/CxPolicyExtension.java | 58 ++- .../edc/policy/cx/CxPolicyRegistration.java | 68 --- ...ctDynamicCredentialConstraintFunction.java | 15 +- ...ismantlerCredentialConstraintFunction.java | 45 +- ...AgreementCredentialConstraintFunction.java | 46 +- ...embershipCredentialConstraintFunction.java | 43 +- ...tlerCredentialConstraintFunctionTest.java} | 28 +- ...mentCredentialConstraintFunctionTest.java} | 86 ++-- ...shipCredentialConstraintFunctionTest.java} | 28 +- edc-extensions/dcp/tx-dcp/build.gradle.kts | 1 + .../iam/iatp/IatpDefaultScopeExtension.java | 11 +- .../iatp/scope/CredentialScopeExtractor.java | 23 +- .../iam/iatp/scope/DefaultScopeExtractor.java | 10 +- .../iatp/IatpDefaultScopeExtensionTest.java | 18 +- .../scope/CredentialScopeExtractorTest.java | 48 +- .../iatp/scope/DefaultScopeExtractorTest.java | 30 +- gradle/libs.versions.toml | 1 + 31 files changed, 809 insertions(+), 685 deletions(-) delete mode 100644 edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/CxPolicyRegistration.java rename edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/dismantler/{DismantlerConstraintFunctionTest.java => DismantlerCredentialConstraintFunctionTest.java} (97%) rename edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/framework/{FrameworkAgreementConstraintFunctionTest.java => FrameworkAgreementCredentialConstraintFunctionTest.java} (80%) rename edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/membership/{MembershipConstraintFunctionTest.java => MembershipCredentialConstraintFunctionTest.java} (84%) diff --git a/DEPENDENCIES b/DEPENDENCIES index 3e4a024fb..0f0ea1025 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -6,19 +6,12 @@ maven/mavencentral/com.apicatalog/iron-verifiable-credentials/0.14.0, Apache-2.0 maven/mavencentral/com.apicatalog/titanium-json-ld/1.0.0, Apache-2.0, approved, clearlydefined maven/mavencentral/com.apicatalog/titanium-json-ld/1.4.0, Apache-2.0, approved, #15200 maven/mavencentral/com.apicatalog/titanium-json-ld/1.4.1, Apache-2.0, approved, #15200 -maven/mavencentral/com.azure/azure-core-http-netty/1.15.2, MIT AND Apache-2.0, approved, #16697 -maven/mavencentral/com.azure/azure-core-http-netty/1.15.3, MIT AND Apache-2.0, approved, #16697 maven/mavencentral/com.azure/azure-core-http-netty/1.15.4, MIT AND Apache-2.0, approved, #16697 maven/mavencentral/com.azure/azure-core-http-netty/1.15.5, MIT AND Apache-2.0, approved, #16697 -maven/mavencentral/com.azure/azure-core/1.50.0, MIT, approved, clearlydefined -maven/mavencentral/com.azure/azure-core/1.51.0, MIT, approved, clearlydefined maven/mavencentral/com.azure/azure-core/1.52.0, MIT, approved, clearlydefined maven/mavencentral/com.azure/azure-core/1.53.0, MIT, approved, clearlydefined -maven/mavencentral/com.azure/azure-identity/1.13.2, MIT, approved, clearlydefined maven/mavencentral/com.azure/azure-identity/1.14.0, MIT, approved, #16714 -maven/mavencentral/com.azure/azure-json/1.2.0, MIT, approved, clearlydefined maven/mavencentral/com.azure/azure-json/1.3.0, MIT, approved, clearlydefined -maven/mavencentral/com.azure/azure-security-keyvault-secrets/4.8.5, MIT, approved, #13690 maven/mavencentral/com.azure/azure-security-keyvault-secrets/4.8.7, MIT, approved, #13690 maven/mavencentral/com.azure/azure-storage-blob/12.28.0, MIT, approved, clearlydefined maven/mavencentral/com.azure/azure-storage-blob/12.28.1, MIT, approved, clearlydefined @@ -104,17 +97,14 @@ maven/mavencentral/com.jcraft/jzlib/1.1.3, BSD-2-Clause, approved, CQ6218 maven/mavencentral/com.lmax/disruptor/3.4.4, Apache-2.0, approved, clearlydefined maven/mavencentral/com.microsoft.azure/msal4j-persistence-extension/1.3.0, MIT, approved, #14411 maven/mavencentral/com.microsoft.azure/msal4j/1.15.0, MIT, approved, clearlydefined -maven/mavencentral/com.microsoft.azure/msal4j/1.16.2, MIT, approved, clearlydefined maven/mavencentral/com.microsoft.azure/msal4j/1.17.2, MIT, approved, #16709 maven/mavencentral/com.networknt/json-schema-validator/1.0.76, Apache-2.0, approved, CQ22638 maven/mavencentral/com.nimbusds/content-type/2.3, Apache-2.0, approved, clearlydefined maven/mavencentral/com.nimbusds/lang-tag/1.7, Apache-2.0, approved, clearlydefined maven/mavencentral/com.nimbusds/nimbus-jose-jwt/9.28, Apache-2.0, approved, clearlydefined -maven/mavencentral/com.nimbusds/nimbus-jose-jwt/9.37.3, Apache-2.0, approved, #11701 maven/mavencentral/com.nimbusds/nimbus-jose-jwt/9.40, Apache-2.0, approved, #15156 maven/mavencentral/com.nimbusds/nimbus-jose-jwt/9.41.2, Apache-2.0, approved, clearlydefined maven/mavencentral/com.nimbusds/oauth2-oidc-sdk/11.18, Apache-2.0, approved, clearlydefined -maven/mavencentral/com.nimbusds/oauth2-oidc-sdk/11.9.1, Apache-2.0, approved, #12667 maven/mavencentral/com.puppycrawl.tools/checkstyle/10.18.2, LGPL-2.1-or-later AND (Apache-2.0 AND LGPL-2.1-or-later) AND Apache-2.0, approved, #16060 maven/mavencentral/com.samskivert/jmustache/1.15, BSD-2-Clause AND BSD-3-Clause, approved, clearlydefined maven/mavencentral/com.squareup.okhttp3/okhttp-dnsoverhttps/4.12.0, Apache-2.0, approved, #11159 @@ -269,10 +259,10 @@ maven/mavencentral/javax.ws.rs/javax.ws.rs-api/2.1, (CDDL-1.1 OR GPL-2.0 WITH Cl maven/mavencentral/joda-time/joda-time/2.10.5, Apache-2.0, approved, clearlydefined maven/mavencentral/junit/junit/4.13.2, EPL-2.0, approved, CQ23636 maven/mavencentral/net.bytebuddy/byte-buddy-agent/1.14.1, Apache-2.0, approved, #7164 -maven/mavencentral/net.bytebuddy/byte-buddy-agent/1.15.3, Apache-2.0, approved, #16009 +maven/mavencentral/net.bytebuddy/byte-buddy-agent/1.15.4, Apache-2.0, approved, #16009 maven/mavencentral/net.bytebuddy/byte-buddy/1.14.1, Apache-2.0 AND BSD-3-Clause, approved, #7163 maven/mavencentral/net.bytebuddy/byte-buddy/1.14.18, Apache-2.0 AND BSD-3-Clause, approved, #7163 -maven/mavencentral/net.bytebuddy/byte-buddy/1.15.3, Apache-2.0 AND BSD-3-Clause, approved, #16008 +maven/mavencentral/net.bytebuddy/byte-buddy/1.15.4, Apache-2.0 AND BSD-3-Clause, approved, #16008 maven/mavencentral/net.java.dev.jna/jna-platform/5.13.0, Apache-2.0 OR LGPL-2.1-or-later, approved, #6707 maven/mavencentral/net.java.dev.jna/jna-platform/5.6.0, Apache-2.0 OR LGPL-2.1-or-later, approved, CQ22390 maven/mavencentral/net.java.dev.jna/jna/5.13.0, Apache-2.0 AND LGPL-2.1-or-later, approved, #15196 @@ -335,204 +325,211 @@ maven/mavencentral/org.codehaus.plexus/plexus-container-default/2.1.0, Apache-2. maven/mavencentral/org.codehaus.plexus/plexus-utils/3.1.1, , approved, CQ16492 maven/mavencentral/org.codehaus.plexus/plexus-utils/3.3.0, , approved, CQ21066 maven/mavencentral/org.eclipse.angus/angus-activation/1.0.0, EPL-2.0 OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.angus -maven/mavencentral/org.eclipse.edc.aws/aws-s3-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc.aws/aws-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc.aws/data-plane-aws-s3/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc.aws/validator-data-address-s3/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc.azure/azure-blob-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc.azure/data-plane-azure-storage/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc.azure/provision-blob/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc.azure/vault-azure/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/accesstoken-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/accesstokendata-store-sql/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/api-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/api-observability/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/asset-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/asset-index-sql/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/asset-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/auth-configuration/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/auth-delegated/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/auth-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/auth-tokenbased/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/autodoc-processor/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/boot-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/boot-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/boot/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/callback-event-dispatcher/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/callback-http-dispatcher/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/callback-static-endpoint/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/catalog-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/catalog-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/catalog-util-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/configuration-filesystem/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/connector-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/contract-agreement-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/contract-definition-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/contract-definition-store-sql/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/contract-negotiation-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/contract-negotiation-store-sql/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/contract-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/control-api-configuration/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/control-plane-aggregate-services/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/control-plane-api-client-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/control-plane-api-client/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/control-plane-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/control-plane-catalog/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/control-plane-contract/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/control-plane-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/control-plane-policies-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/control-plane-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/control-plane-transfer/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/control-plane-transform/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/core-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/crawler-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/crawler-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/credential-query-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/crypto-common-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-address-http-data-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-http-oauth2-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-http-oauth2/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-http-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-http/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-iam/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-instance-store-sql/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-public-api-v2/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-selector-client/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-selector-control-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-selector-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-selector-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-self-registration/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-signaling-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-signaling-client/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-signaling-transform/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-store-sql/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/data-plane-util/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/did-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-catalog-http-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-catalog-http-dispatcher/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-catalog-transform/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-catalog/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-http-api-configuration/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-http-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-http-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-negotiation-http-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-negotiation-http-dispatcher/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-negotiation-transform/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-negotiation/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-transfer-process-http-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-transfer-process-http-dispatcher/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-transfer-process-transform/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-transfer-process/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp-version-http-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/dsp/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/edr-index-sql/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/edr-store-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/edr-store-receiver/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/edr-store-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/federated-catalog-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/federated-catalog-cache-sql/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/federated-catalog-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/federated-catalog-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/http-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/http-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/http/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/iam-mock/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-did-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-did-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-did-web/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-hub-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-hub-did/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-hub-keypairs/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-hub-participants/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-hub-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-hub-store-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-trust-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-trust-issuers-configuration/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-trust-service/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-trust-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-trust-sts-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-trust-sts-client-configuration/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-trust-sts-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-trust-sts-embedded/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-trust-sts-remote-client/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-trust-sts-remote-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-trust-sts-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/identity-trust-transform/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/jersey-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/jersey-micrometer/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/jersey-providers-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/jetty-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/jetty-micrometer/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/json-ld-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/json-ld-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/json-ld/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/json-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/junit-base/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/junit/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/jws2020-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/jwt-signer-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/jwt-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/jwt-verifiable-credentials/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/keypair-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/keypair-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/keys-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/keys-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/ldp-verifiable-credentials/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/management-api-configuration/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/management-api-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/management-api-test-fixtures/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/management-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/micrometer-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/oauth2-client/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/oauth2-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/participant-context-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/policy-definition-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/policy-definition-store-sql/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/policy-engine-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/policy-engine-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/policy-evaluator-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/policy-model/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/policy-monitor-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/policy-monitor-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/policy-monitor-store-sql/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/policy-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/presentation-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/query-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/runtime-metamodel/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/secrets-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/sql-bootstrapper/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/sql-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/sql-lease/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/sql-pool-apache-commons/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/state-machine-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/store-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/sts-account-provisioner/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/token-core/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/token-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/transaction-datasource-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/transaction-local/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/transaction-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/transfer-data-plane-signaling/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/transfer-data-plane-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/transfer-process-api/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/transfer-process-store-sql/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/transfer-pull-http-dynamic-receiver/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/transfer-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/transform-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/transform-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/util-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/validator-data-address-http-data/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/validator-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/validator-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/vault-hashicorp/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/verifiable-credential-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/verifiable-credentials-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/verifiable-credentials/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/verifiable-presentation-lib/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/web-spi/0.10.0-20241014-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc.aws/aws-s3-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc.aws/aws-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc.aws/data-plane-aws-s3/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc.aws/validator-data-address-s3/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc.azure/azure-blob-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc.azure/data-plane-azure-storage/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc.azure/provision-blob/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc.azure/vault-azure/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/accesstoken-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/accesstokendata-store-sql/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/api-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/api-observability/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/asset-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/asset-index-sql/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/asset-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/auth-configuration/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/auth-delegated/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/auth-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/auth-tokenbased/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/autodoc-processor/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/boot-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/boot-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/boot/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/callback-event-dispatcher/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/callback-http-dispatcher/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/callback-static-endpoint/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/catalog-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/catalog-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/catalog-util-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/configuration-filesystem/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/connector-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/contract-agreement-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/contract-definition-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/contract-definition-store-sql/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/contract-negotiation-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/contract-negotiation-store-sql/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/contract-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/control-api-configuration/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/control-plane-aggregate-services/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/control-plane-api-client-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/control-plane-api-client/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/control-plane-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/control-plane-catalog/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/control-plane-contract/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/control-plane-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/control-plane-policies-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/control-plane-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/control-plane-transfer/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/control-plane-transform/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/core-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/crawler-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/crawler-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/credential-query-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/crypto-common-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-address-http-data-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-http-oauth2-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-http-oauth2/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-http-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-http/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-iam/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-instance-store-sql/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-public-api-v2/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-selector-client/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-selector-control-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-selector-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-selector-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-self-registration/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-signaling-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-signaling-client/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-signaling-transform/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-store-sql/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/data-plane-util/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/did-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-catalog-http-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-catalog-http-dispatcher/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-catalog-transform-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-catalog-transform/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-catalog-validation-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-catalog/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-http-api-configuration/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-http-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-http-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-negotiation-http-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-negotiation-http-dispatcher/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-negotiation-transform-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-negotiation-transform/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-negotiation-validation-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-negotiation/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-transfer-process-http-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-transfer-process-http-dispatcher/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-transfer-process-transform-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-transfer-process-transform/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-transfer-process-validation-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-transfer-process/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp-version-http-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/dsp/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/edr-index-sql/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/edr-store-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/edr-store-receiver/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/edr-store-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/federated-catalog-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/federated-catalog-cache-sql/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/federated-catalog-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/federated-catalog-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/http-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/http-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/http/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/iam-mock/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-did-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-did-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-did-web/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-hub-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-hub-did/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-hub-keypairs/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-hub-participants/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-hub-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-hub-store-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-trust-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-trust-issuers-configuration/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-trust-service/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-trust-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-trust-sts-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-trust-sts-client-configuration/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-trust-sts-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-trust-sts-embedded/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-trust-sts-remote-client/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-trust-sts-remote-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-trust-sts-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/identity-trust-transform/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/jersey-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/jersey-micrometer/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/jersey-providers-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/jetty-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/jetty-micrometer/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/json-ld-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/json-ld-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/json-ld/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/json-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/junit-base/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/junit/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/jws2020-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/jwt-signer-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/jwt-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/jwt-verifiable-credentials/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/keypair-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/keypair-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/keys-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/keys-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/ldp-verifiable-credentials/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/management-api-configuration/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/management-api-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/management-api-test-fixtures/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/management-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/micrometer-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/oauth2-client/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/oauth2-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/participant-context-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/policy-definition-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/policy-definition-store-sql/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/policy-engine-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/policy-engine-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/policy-evaluator-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/policy-model/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/policy-monitor-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/policy-monitor-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/policy-monitor-store-sql/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/policy-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/presentation-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/query-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/request-policy-context-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/runtime-metamodel/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/secrets-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/sql-bootstrapper/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/sql-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/sql-lease/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/sql-pool-apache-commons/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/state-machine-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/store-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/sts-account-provisioner/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/token-core/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/token-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/transaction-datasource-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/transaction-local/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/transaction-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/transfer-data-plane-signaling/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/transfer-data-plane-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/transfer-process-api/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/transfer-process-store-sql/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/transfer-pull-http-dynamic-receiver/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/transfer-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/transform-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/transform-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/util-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/validator-data-address-http-data/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/validator-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/validator-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/vault-hashicorp/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/verifiable-credential-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/verifiable-credentials-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/verifiable-credentials/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/verifiable-presentation-lib/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/web-spi/0.10.0-20241020-SNAPSHOT, Apache-2.0, approved, technology.edc maven/mavencentral/org.eclipse.jetty.toolchain/jetty-jakarta-servlet-api/5.0.2, EPL-2.0 OR Apache-2.0, approved, rt.jetty maven/mavencentral/org.eclipse.jetty.toolchain/jetty-jakarta-websocket-api/2.0.0, EPL-2.0 OR Apache-2.0, approved, rt.jetty maven/mavencentral/org.eclipse.jetty.websocket/websocket-core-client/11.0.24, EPL-2.0 OR Apache-2.0, approved, rt.jetty @@ -591,11 +588,8 @@ maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.9.10, Apache-2.0, a maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib/1.9.10, Apache-2.0, approved, #11827 maven/mavencentral/org.jetbrains/annotations/13.0, Apache-2.0, approved, clearlydefined maven/mavencentral/org.jetbrains/annotations/17.0.0, Apache-2.0, approved, clearlydefined -maven/mavencentral/org.jetbrains/annotations/25.0.0, Apache-2.0, approved, #16624 -maven/mavencentral/org.jetbrains/annotations/26.0.0, Apache-2.0, approved, #16629 -maven/mavencentral/org.junit.jupiter/junit-jupiter-api/5.11.1, EPL-2.0, approved, #15935 +maven/mavencentral/org.jetbrains/annotations/26.0.1, Apache-2.0, approved, #16629 maven/mavencentral/org.junit.jupiter/junit-jupiter-api/5.11.2, EPL-2.0, approved, #15935 -maven/mavencentral/org.junit.jupiter/junit-jupiter-engine/5.11.1, EPL-2.0, approved, #15939 maven/mavencentral/org.junit.jupiter/junit-jupiter-engine/5.11.2, EPL-2.0, approved, #15939 maven/mavencentral/org.junit.jupiter/junit-jupiter-params/5.11.2, EPL-2.0, approved, #15940 maven/mavencentral/org.junit.platform/junit-platform-commons/1.11.2, EPL-2.0, approved, #15936 @@ -606,7 +600,7 @@ maven/mavencentral/org.latencyutils/LatencyUtils/2.0.3, CC0-1.0, approved, #1528 maven/mavencentral/org.mock-server/mockserver-client-java/5.15.0, Apache-2.0 AND LGPL-3.0-only, approved, #9324 maven/mavencentral/org.mock-server/mockserver-core/5.15.0, Apache-2.0, approved, clearlydefined maven/mavencentral/org.mock-server/mockserver-netty/5.15.0, Apache-2.0, approved, #9276 -maven/mavencentral/org.mockito/mockito-core/5.14.1, MIT AND (Apache-2.0 AND MIT) AND Apache-2.0, approved, #16375 +maven/mavencentral/org.mockito/mockito-core/5.14.2, MIT AND (Apache-2.0 AND MIT) AND Apache-2.0, approved, #16375 maven/mavencentral/org.mockito/mockito-core/5.2.0, MIT AND (Apache-2.0 AND MIT) AND Apache-2.0, approved, #7401 maven/mavencentral/org.mozilla/rhino/1.7.7.2, MPL-2.0 AND BSD-3-Clause AND ISC, approved, CQ16320 maven/mavencentral/org.objenesis/objenesis/3.3, Apache-2.0, approved, clearlydefined @@ -645,46 +639,46 @@ maven/mavencentral/org.yaml/snakeyaml/1.33, Apache-2.0, approved, clearlydefined maven/mavencentral/org.yaml/snakeyaml/2.2, Apache-2.0 AND (Apache-2.0 OR BSD-3-Clause OR EPL-1.0 OR GPL-2.0-or-later OR LGPL-2.1-or-later), approved, #10232 maven/mavencentral/org.yaml/snakeyaml/2.3, Apache-2.0 AND (Apache-2.0 OR BSD-3-Clause OR EPL-1.0 OR GPL-2.0-or-later OR LGPL-2.1-or-later), approved, #16046 maven/mavencentral/software.amazon.awssdk/annotations/2.28.12, Apache-2.0, approved, #16522 -maven/mavencentral/software.amazon.awssdk/annotations/2.28.20, Apache-2.0, approved, #16522 -maven/mavencentral/software.amazon.awssdk/apache-client/2.28.20, Apache-2.0, approved, #16533 +maven/mavencentral/software.amazon.awssdk/annotations/2.28.22, Apache-2.0, approved, #16522 +maven/mavencentral/software.amazon.awssdk/apache-client/2.28.22, Apache-2.0, approved, #16533 maven/mavencentral/software.amazon.awssdk/arns/2.28.12, Apache-2.0, approved, #16519 -maven/mavencentral/software.amazon.awssdk/arns/2.28.20, Apache-2.0, approved, #16519 +maven/mavencentral/software.amazon.awssdk/arns/2.28.22, Apache-2.0, approved, #16519 maven/mavencentral/software.amazon.awssdk/auth/2.28.12, Apache-2.0, approved, #16541 -maven/mavencentral/software.amazon.awssdk/auth/2.28.20, Apache-2.0, approved, #16541 +maven/mavencentral/software.amazon.awssdk/auth/2.28.22, Apache-2.0, approved, #16541 maven/mavencentral/software.amazon.awssdk/aws-core/2.28.12, Apache-2.0, approved, #16534 -maven/mavencentral/software.amazon.awssdk/aws-core/2.28.20, Apache-2.0, approved, #16534 -maven/mavencentral/software.amazon.awssdk/aws-query-protocol/2.28.20, Apache-2.0, approved, #16507 -maven/mavencentral/software.amazon.awssdk/aws-xml-protocol/2.28.20, Apache-2.0, approved, #16502 -maven/mavencentral/software.amazon.awssdk/checksums-spi/2.28.20, Apache-2.0, approved, #16517 -maven/mavencentral/software.amazon.awssdk/checksums/2.28.20, Apache-2.0, approved, #16542 -maven/mavencentral/software.amazon.awssdk/crt-core/2.28.20, Apache-2.0, approved, #16512 -maven/mavencentral/software.amazon.awssdk/endpoints-spi/2.28.20, Apache-2.0, approved, #16509 -maven/mavencentral/software.amazon.awssdk/http-auth-aws-eventstream/2.28.20, Apache-2.0, approved, #16513 -maven/mavencentral/software.amazon.awssdk/http-auth-aws/2.28.20, Apache-2.0, approved, #16508 -maven/mavencentral/software.amazon.awssdk/http-auth-spi/2.28.20, Apache-2.0, approved, #16498 -maven/mavencentral/software.amazon.awssdk/http-auth/2.28.20, Apache-2.0, approved, #16511 +maven/mavencentral/software.amazon.awssdk/aws-core/2.28.22, Apache-2.0, approved, #16534 +maven/mavencentral/software.amazon.awssdk/aws-query-protocol/2.28.22, Apache-2.0, approved, #16507 +maven/mavencentral/software.amazon.awssdk/aws-xml-protocol/2.28.22, Apache-2.0, approved, #16502 +maven/mavencentral/software.amazon.awssdk/checksums-spi/2.28.22, Apache-2.0, approved, #16517 +maven/mavencentral/software.amazon.awssdk/checksums/2.28.22, Apache-2.0, approved, #16542 +maven/mavencentral/software.amazon.awssdk/crt-core/2.28.22, Apache-2.0, approved, #16512 +maven/mavencentral/software.amazon.awssdk/endpoints-spi/2.28.22, Apache-2.0, approved, #16509 +maven/mavencentral/software.amazon.awssdk/http-auth-aws-eventstream/2.28.22, Apache-2.0, approved, #16513 +maven/mavencentral/software.amazon.awssdk/http-auth-aws/2.28.22, Apache-2.0, approved, #16508 +maven/mavencentral/software.amazon.awssdk/http-auth-spi/2.28.22, Apache-2.0, approved, #16498 +maven/mavencentral/software.amazon.awssdk/http-auth/2.28.22, Apache-2.0, approved, #16511 maven/mavencentral/software.amazon.awssdk/http-client-spi/2.28.12, Apache-2.0, approved, #16526 -maven/mavencentral/software.amazon.awssdk/http-client-spi/2.28.20, Apache-2.0, approved, #16526 -maven/mavencentral/software.amazon.awssdk/iam/2.28.20, Apache-2.0, approved, #16684 -maven/mavencentral/software.amazon.awssdk/identity-spi/2.28.20, Apache-2.0, approved, #16544 +maven/mavencentral/software.amazon.awssdk/http-client-spi/2.28.22, Apache-2.0, approved, #16526 +maven/mavencentral/software.amazon.awssdk/iam/2.28.22, Apache-2.0, approved, #16684 +maven/mavencentral/software.amazon.awssdk/identity-spi/2.28.22, Apache-2.0, approved, #16544 maven/mavencentral/software.amazon.awssdk/json-utils/2.28.12, Apache-2.0, approved, #16543 -maven/mavencentral/software.amazon.awssdk/json-utils/2.28.20, Apache-2.0, approved, #16543 -maven/mavencentral/software.amazon.awssdk/metrics-spi/2.28.20, Apache-2.0, approved, #16515 -maven/mavencentral/software.amazon.awssdk/netty-nio-client/2.28.20, Apache-2.0, approved, #16538 -maven/mavencentral/software.amazon.awssdk/profiles/2.28.20, Apache-2.0, approved, #16520 +maven/mavencentral/software.amazon.awssdk/json-utils/2.28.22, Apache-2.0, approved, #16543 +maven/mavencentral/software.amazon.awssdk/metrics-spi/2.28.22, Apache-2.0, approved, #16515 +maven/mavencentral/software.amazon.awssdk/netty-nio-client/2.28.22, Apache-2.0, approved, #16538 +maven/mavencentral/software.amazon.awssdk/profiles/2.28.22, Apache-2.0, approved, #16520 maven/mavencentral/software.amazon.awssdk/protocol-core/2.28.12, Apache-2.0, approved, #16521 -maven/mavencentral/software.amazon.awssdk/protocol-core/2.28.20, Apache-2.0, approved, #16521 +maven/mavencentral/software.amazon.awssdk/protocol-core/2.28.22, Apache-2.0, approved, #16521 maven/mavencentral/software.amazon.awssdk/regions/2.28.12, Apache-2.0, approved, #16518 -maven/mavencentral/software.amazon.awssdk/regions/2.28.20, Apache-2.0, approved, #16518 -maven/mavencentral/software.amazon.awssdk/retries-spi/2.28.20, Apache-2.0, approved, #16514 -maven/mavencentral/software.amazon.awssdk/retries/2.28.20, Apache-2.0, approved, #16495 +maven/mavencentral/software.amazon.awssdk/regions/2.28.22, Apache-2.0, approved, #16518 +maven/mavencentral/software.amazon.awssdk/retries-spi/2.28.22, Apache-2.0, approved, #16514 +maven/mavencentral/software.amazon.awssdk/retries/2.28.22, Apache-2.0, approved, #16495 maven/mavencentral/software.amazon.awssdk/s3-transfer-manager/2.28.12, Apache-2.0, approved, clearlydefined maven/mavencentral/software.amazon.awssdk/s3/2.28.12, Apache-2.0, approved, #16505 -maven/mavencentral/software.amazon.awssdk/s3/2.28.20, Apache-2.0, approved, #16505 +maven/mavencentral/software.amazon.awssdk/s3/2.28.22, Apache-2.0, approved, #16505 maven/mavencentral/software.amazon.awssdk/sdk-core/2.28.12, Apache-2.0, approved, #16532 -maven/mavencentral/software.amazon.awssdk/sdk-core/2.28.20, Apache-2.0, approved, #16532 -maven/mavencentral/software.amazon.awssdk/sts/2.28.20, Apache-2.0, approved, #16685 -maven/mavencentral/software.amazon.awssdk/third-party-jackson-core/2.28.20, Apache-2.0, approved, #16500 +maven/mavencentral/software.amazon.awssdk/sdk-core/2.28.22, Apache-2.0, approved, #16532 +maven/mavencentral/software.amazon.awssdk/sts/2.28.22, Apache-2.0, approved, #16685 +maven/mavencentral/software.amazon.awssdk/third-party-jackson-core/2.28.22, Apache-2.0, approved, #16500 maven/mavencentral/software.amazon.awssdk/utils/2.28.12, Apache-2.0, approved, #16527 -maven/mavencentral/software.amazon.awssdk/utils/2.28.20, Apache-2.0, approved, #16527 +maven/mavencentral/software.amazon.awssdk/utils/2.28.22, Apache-2.0, approved, #16527 maven/mavencentral/software.amazon.eventstream/eventstream/1.0.1, Apache-2.0, approved, clearlydefined diff --git a/edc-extensions/agreements/retirement-evaluation-core/src/main/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementRetirementValidator.java b/edc-extensions/agreements/retirement-evaluation-core/src/main/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementRetirementValidator.java index e904b4c61..cd6b6d36d 100644 --- a/edc-extensions/agreements/retirement-evaluation-core/src/main/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementRetirementValidator.java +++ b/edc-extensions/agreements/retirement-evaluation-core/src/main/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementRetirementValidator.java @@ -19,18 +19,25 @@ package org.eclipse.tractusx.edc.agreements.retirement; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.TransferProcessPolicyContext; import org.eclipse.edc.connector.controlplane.contract.spi.types.agreement.ContractAgreement; +import org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorContext; import org.eclipse.edc.policy.engine.spi.PolicyContext; -import org.eclipse.edc.policy.engine.spi.PolicyValidatorFunction; -import org.eclipse.edc.policy.model.Policy; +import org.eclipse.edc.policy.engine.spi.PolicyValidatorRule; import org.eclipse.tractusx.edc.agreements.retirement.spi.service.AgreementsRetirementService; -public record AgreementRetirementValidator(AgreementsRetirementService agreementsRetirementService) implements PolicyValidatorFunction { +public record AgreementRetirementValidator(AgreementsRetirementService agreementsRetirementService) { - @Override - public Boolean apply(Policy policy, PolicyContext policyContext) { - var agreement = policyContext.getContextData(ContractAgreement.class); + public PolicyValidatorRule transferProcess() { + return (policy, context) -> validate(context.contractAgreement(), context); + } + + public PolicyValidatorRule policyMonitor() { + return (policy, context) -> validate(context.contractAgreement(), context); + } + + public Boolean validate(ContractAgreement agreement, PolicyContext policyContext) { if (agreement != null) { if (agreementsRetirementService.isRetired(agreement.getId())) { policyContext.reportProblem(String.format("Contract Agreement with ID=%s has been retired", agreement.getId())); diff --git a/edc-extensions/agreements/retirement-evaluation-core/src/main/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementsRetirementPreValidatorRegisterExtension.java b/edc-extensions/agreements/retirement-evaluation-core/src/main/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementsRetirementPreValidatorRegisterExtension.java index 1340a6f63..25a1658c2 100644 --- a/edc-extensions/agreements/retirement-evaluation-core/src/main/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementsRetirementPreValidatorRegisterExtension.java +++ b/edc-extensions/agreements/retirement-evaluation-core/src/main/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementsRetirementPreValidatorRegisterExtension.java @@ -19,6 +19,8 @@ package org.eclipse.tractusx.edc.agreements.retirement; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.TransferProcessPolicyContext; +import org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorContext; import org.eclipse.edc.policy.engine.spi.PolicyEngine; import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; @@ -26,8 +28,6 @@ import org.eclipse.edc.spi.system.ServiceExtensionContext; import org.eclipse.tractusx.edc.agreements.retirement.spi.service.AgreementsRetirementService; -import static org.eclipse.edc.connector.controlplane.contract.spi.validation.ContractValidationService.TRANSFER_SCOPE; -import static org.eclipse.edc.connector.policy.monitor.PolicyMonitorExtension.POLICY_MONITOR_SCOPE; import static org.eclipse.tractusx.edc.agreements.retirement.AgreementsRetirementPreValidatorRegisterExtension.NAME; @@ -44,8 +44,8 @@ public class AgreementsRetirementPreValidatorRegisterExtension implements Servic @Override public void initialize(ServiceExtensionContext context) { - var agreementRetirementValidator = new AgreementRetirementValidator(service); - policyEngine.registerPreValidator(TRANSFER_SCOPE, agreementRetirementValidator); - policyEngine.registerPreValidator(POLICY_MONITOR_SCOPE, agreementRetirementValidator); + var validator = new AgreementRetirementValidator(service); + policyEngine.registerPreValidator(TransferProcessPolicyContext.class, validator.transferProcess()); + policyEngine.registerPreValidator(PolicyMonitorContext.class, validator.policyMonitor()); } } diff --git a/edc-extensions/agreements/retirement-evaluation-core/src/test/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementRetirementValidatorTest.java b/edc-extensions/agreements/retirement-evaluation-core/src/test/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementRetirementValidatorTest.java index 31c528fe1..04b85efa3 100644 --- a/edc-extensions/agreements/retirement-evaluation-core/src/test/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementRetirementValidatorTest.java +++ b/edc-extensions/agreements/retirement-evaluation-core/src/test/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementRetirementValidatorTest.java @@ -40,7 +40,6 @@ class AgreementRetirementValidatorTest { private AgreementRetirementValidator validator; private final AgreementsRetirementService service = mock(); - private final Policy policy = mock(); private final PolicyContext context = mock(); @BeforeEach @@ -51,11 +50,7 @@ public void setup() { @Test @DisplayName("Verify validator returns true if no agreement is found in policyContext") public void verify_agreementExistsInPolicyContext() { - - when(context.getContextData(ContractAgreement.class)) - .thenReturn(null); - assertThat(validator.apply(policy, context)).isTrue(); - + assertThat(validator.validate(null, context)).isTrue(); } @Test @@ -63,12 +58,10 @@ public void verify_returnFalseWhenRetired() { var agreementId = "test-agreement"; var agreement = buildAgreement(agreementId); - when(context.getContextData(ContractAgreement.class)) - .thenReturn(agreement); when(service.isRetired(agreementId)) .thenReturn(true); - var result = validator.apply(policy, context); + var result = validator.validate(agreement, context); assertThat(result).isFalse(); verify(context, times(1)).reportProblem(anyString()); @@ -79,12 +72,10 @@ public void verify_returnFalseWhenNotRetired() { var agreementId = "test-agreement"; var agreement = buildAgreement(agreementId); - when(context.getContextData(ContractAgreement.class)) - .thenReturn(agreement); when(service.isRetired(agreementId)) .thenReturn(false); - var result = validator.apply(policy, context); + var result = validator.validate(agreement, context); assertThat(result).isTrue(); verify(context, never()).reportProblem(anyString()); @@ -100,4 +91,4 @@ private ContractAgreement buildAgreement(String agreementId) { .build(); } -} \ No newline at end of file +} diff --git a/edc-extensions/agreements/retirement-evaluation-core/src/test/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementsRetirementPreValidatorRegisterExtensionTest.java b/edc-extensions/agreements/retirement-evaluation-core/src/test/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementsRetirementPreValidatorRegisterExtensionTest.java index 003a7d5e3..78fd5d05b 100644 --- a/edc-extensions/agreements/retirement-evaluation-core/src/test/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementsRetirementPreValidatorRegisterExtensionTest.java +++ b/edc-extensions/agreements/retirement-evaluation-core/src/test/java/org/eclipse/tractusx/edc/agreements/retirement/AgreementsRetirementPreValidatorRegisterExtensionTest.java @@ -20,6 +20,8 @@ package org.eclipse.tractusx.edc.agreements.retirement; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.TransferProcessPolicyContext; +import org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorContext; import org.eclipse.edc.junit.extensions.DependencyInjectionExtension; import org.eclipse.edc.policy.engine.spi.PolicyEngine; import org.eclipse.edc.spi.system.ServiceExtensionContext; @@ -27,8 +29,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -import static org.eclipse.edc.connector.controlplane.contract.spi.validation.ContractValidationService.TRANSFER_SCOPE; -import static org.eclipse.edc.connector.policy.monitor.PolicyMonitorExtension.POLICY_MONITOR_SCOPE; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; @@ -50,8 +50,8 @@ public void verify_functionIsRegisteredOnInitialization(ServiceExtensionContext extension.initialize(context); verify(policyEngine, times(1)) - .registerPreValidator(eq(TRANSFER_SCOPE), any()); + .registerPreValidator(eq(TransferProcessPolicyContext.class), any()); verify(policyEngine, times(1)) - .registerPreValidator(eq(POLICY_MONITOR_SCOPE), any()); + .registerPreValidator(eq(PolicyMonitorContext.class), any()); } -} \ No newline at end of file +} diff --git a/edc-extensions/bpn-validation/bpn-validation-core/build.gradle.kts b/edc-extensions/bpn-validation/bpn-validation-core/build.gradle.kts index 463660342..ff97162ae 100644 --- a/edc-extensions/bpn-validation/bpn-validation-core/build.gradle.kts +++ b/edc-extensions/bpn-validation/bpn-validation-core/build.gradle.kts @@ -27,8 +27,9 @@ dependencies { api(project(":edc-extensions:bpn-validation:bpn-validation-spi")) implementation(project(":spi:core-spi")) api(libs.edc.spi.core) - implementation(libs.edc.spi.policy) + implementation(libs.edc.spi.catalog) implementation(libs.edc.spi.contract) + implementation(libs.edc.spi.policy) implementation(libs.edc.spi.policyengine) testImplementation(libs.edc.junit) diff --git a/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/BusinessPartnerNumberValidationExtension.java b/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/BusinessPartnerNumberValidationExtension.java index b5a99b168..17e101904 100644 --- a/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/BusinessPartnerNumberValidationExtension.java +++ b/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/BusinessPartnerNumberValidationExtension.java @@ -19,6 +19,11 @@ package org.eclipse.tractusx.edc.validation.businesspartner; +import org.eclipse.edc.connector.controlplane.catalog.spi.policy.CatalogPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.ContractNegotiationPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.TransferProcessPolicyContext; +import org.eclipse.edc.policy.engine.spi.AtomicConstraintRuleFunction; +import org.eclipse.edc.policy.engine.spi.PolicyContext; import org.eclipse.edc.policy.engine.spi.PolicyEngine; import org.eclipse.edc.policy.engine.spi.RuleBindingRegistry; import org.eclipse.edc.policy.model.Permission; @@ -28,12 +33,12 @@ import org.eclipse.edc.spi.system.ServiceExtensionContext; import org.eclipse.tractusx.edc.validation.businesspartner.functions.BusinessPartnerNumberPermissionFunction; -import static org.eclipse.edc.connector.controlplane.contract.spi.validation.ContractValidationService.NEGOTIATION_SCOPE; -import static org.eclipse.edc.connector.controlplane.contract.spi.validation.ContractValidationService.TRANSFER_SCOPE; +import static org.eclipse.edc.connector.controlplane.catalog.spi.policy.CatalogPolicyContext.CATALOG_SCOPE; +import static org.eclipse.edc.connector.controlplane.contract.spi.policy.ContractNegotiationPolicyContext.NEGOTIATION_SCOPE; +import static org.eclipse.edc.connector.controlplane.contract.spi.policy.TransferProcessPolicyContext.TRANSFER_SCOPE; import static org.eclipse.edc.policy.model.OdrlNamespace.ODRL_SCHEMA; import static org.eclipse.tractusx.edc.edr.spi.CoreConstants.TX_NAMESPACE; import static org.eclipse.tractusx.edc.validation.businesspartner.BusinessPartnerNumberValidationExtension.NAME; -import static org.eclipse.tractusx.edc.validation.businesspartner.BusinessPartnerValidationExtension.CATALOGING_SCOPE; /** * Business partner number evaluation function. @@ -70,23 +75,21 @@ public String name() { @Override public void initialize(ServiceExtensionContext context) { + var function = new BusinessPartnerNumberPermissionFunction(); - var permissionFunction = new BusinessPartnerNumberPermissionFunction(); - - bindToScope(permissionFunction, TRANSFER_SCOPE); - bindToScope(permissionFunction, NEGOTIATION_SCOPE); - bindToScope(permissionFunction, CATALOGING_SCOPE); - + bindToScope(TransferProcessPolicyContext.class, function.transferProcess(), TRANSFER_SCOPE); + bindToScope(ContractNegotiationPolicyContext.class, function.contractNegotiation(), NEGOTIATION_SCOPE); + bindToScope(CatalogPolicyContext.class, function.catalog(), CATALOG_SCOPE); } - private void bindToScope(BusinessPartnerNumberPermissionFunction permissionFunction, String scope) { + private void bindToScope(Class contextType, AtomicConstraintRuleFunction function, String scope) { ruleBindingRegistry.bind("USE", scope); ruleBindingRegistry.bind(ODRL_SCHEMA + "use", scope); ruleBindingRegistry.bind(BUSINESS_PARTNER_CONSTRAINT_KEY, scope); ruleBindingRegistry.bind(TX_BUSINESS_PARTNER_CONSTRAINT_KEY, scope); - policyEngine.registerFunction(scope, Permission.class, BUSINESS_PARTNER_CONSTRAINT_KEY, permissionFunction); - policyEngine.registerFunction(scope, Permission.class, TX_BUSINESS_PARTNER_CONSTRAINT_KEY, permissionFunction); + policyEngine.registerFunction(contextType, Permission.class, BUSINESS_PARTNER_CONSTRAINT_KEY, function); + policyEngine.registerFunction(contextType, Permission.class, TX_BUSINESS_PARTNER_CONSTRAINT_KEY, function); } } diff --git a/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/BusinessPartnerValidationExtension.java b/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/BusinessPartnerValidationExtension.java index 7c5f64fec..49f3aaa20 100644 --- a/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/BusinessPartnerValidationExtension.java +++ b/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/BusinessPartnerValidationExtension.java @@ -19,6 +19,11 @@ package org.eclipse.tractusx.edc.validation.businesspartner; +import org.eclipse.edc.connector.controlplane.catalog.spi.policy.CatalogPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.ContractNegotiationPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.TransferProcessPolicyContext; +import org.eclipse.edc.policy.engine.spi.AtomicConstraintRuleFunction; +import org.eclipse.edc.policy.engine.spi.PolicyContext; import org.eclipse.edc.policy.engine.spi.PolicyEngine; import org.eclipse.edc.policy.engine.spi.RuleBindingRegistry; import org.eclipse.edc.policy.model.Permission; @@ -29,9 +34,11 @@ import org.eclipse.tractusx.edc.validation.businesspartner.functions.BusinessPartnerGroupFunction; import org.eclipse.tractusx.edc.validation.businesspartner.spi.BusinessPartnerStore; -import static org.eclipse.edc.connector.controlplane.contract.spi.validation.ContractValidationService.NEGOTIATION_SCOPE; -import static org.eclipse.edc.connector.controlplane.contract.spi.validation.ContractValidationService.TRANSFER_SCOPE; +import static org.eclipse.edc.connector.controlplane.catalog.spi.policy.CatalogPolicyContext.CATALOG_SCOPE; +import static org.eclipse.edc.connector.controlplane.contract.spi.policy.ContractNegotiationPolicyContext.NEGOTIATION_SCOPE; +import static org.eclipse.edc.connector.controlplane.contract.spi.policy.TransferProcessPolicyContext.TRANSFER_SCOPE; import static org.eclipse.edc.policy.model.OdrlNamespace.ODRL_SCHEMA; +import static org.eclipse.tractusx.edc.validation.businesspartner.functions.BusinessPartnerGroupFunction.BUSINESS_PARTNER_CONSTRAINT_KEY; /** * Registers a {@link org.eclipse.tractusx.edc.validation.businesspartner.functions.BusinessPartnerGroupFunction} for the following scopes: @@ -57,8 +64,6 @@ @Extension(value = "Registers a function to evaluate whether a BPN number is covered by a certain policy or not", categories = { "policy", "contract" }) public class BusinessPartnerValidationExtension implements ServiceExtension { - public static final String CATALOGING_SCOPE = "catalog"; - private static final String USE = "USE"; @Inject @@ -72,16 +77,17 @@ public class BusinessPartnerValidationExtension implements ServiceExtension { public void initialize(ServiceExtensionContext context) { var function = new BusinessPartnerGroupFunction(store); - bindToScope(function, TRANSFER_SCOPE); - bindToScope(function, NEGOTIATION_SCOPE); - bindToScope(function, CATALOGING_SCOPE); + bindToScope(TRANSFER_SCOPE, TransferProcessPolicyContext.class, function.transferProcess()); + bindToScope(NEGOTIATION_SCOPE, ContractNegotiationPolicyContext.class, function.contractNegotiation()); + bindToScope(CATALOG_SCOPE, CatalogPolicyContext.class, function.catalog()); } - private void bindToScope(BusinessPartnerGroupFunction function, String scope) { + private void bindToScope(String scope, Class contextType, AtomicConstraintRuleFunction function) { ruleBindingRegistry.bind(USE, scope); ruleBindingRegistry.bind(ODRL_SCHEMA + "use", scope); - ruleBindingRegistry.bind(BusinessPartnerGroupFunction.BUSINESS_PARTNER_CONSTRAINT_KEY, scope); + ruleBindingRegistry.bind(BUSINESS_PARTNER_CONSTRAINT_KEY, scope); - policyEngine.registerFunction(scope, Permission.class, BusinessPartnerGroupFunction.BUSINESS_PARTNER_CONSTRAINT_KEY, function); + policyEngine.registerFunction(contextType, Permission.class, BUSINESS_PARTNER_CONSTRAINT_KEY, function); } + } diff --git a/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerGroupFunction.java b/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerGroupFunction.java index a8ce9e6fa..34f218a40 100644 --- a/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerGroupFunction.java +++ b/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerGroupFunction.java @@ -19,7 +19,10 @@ package org.eclipse.tractusx.edc.validation.businesspartner.functions; -import org.eclipse.edc.policy.engine.spi.AtomicConstraintFunction; +import org.eclipse.edc.connector.controlplane.catalog.spi.policy.CatalogPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.ContractNegotiationPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.TransferProcessPolicyContext; +import org.eclipse.edc.policy.engine.spi.AtomicConstraintRuleFunction; import org.eclipse.edc.policy.engine.spi.PolicyContext; import org.eclipse.edc.policy.model.Operator; import org.eclipse.edc.policy.model.Permission; @@ -31,6 +34,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.function.Function; @@ -77,7 +81,7 @@ * * @see BusinessPartnerStore */ -public class BusinessPartnerGroupFunction implements AtomicConstraintFunction { +public class BusinessPartnerGroupFunction { public static final String BUSINESS_PARTNER_CONSTRAINT_KEY = TX_NAMESPACE + "BusinessPartnerGroup"; private static final List ALLOWED_OPERATORS = List.of(EQ, NEQ, IN, IS_ALL_OF, IS_ANY_OF, IS_NONE_OF); private static final Map> OPERATOR_EVALUATOR_MAP = new HashMap<>(); @@ -93,6 +97,21 @@ public BusinessPartnerGroupFunction(BusinessPartnerStore store) { OPERATOR_EVALUATOR_MAP.put(IS_NONE_OF, this::evaluateIsNoneOf); } + public AtomicConstraintRuleFunction transferProcess() { + return (operator, rightValue, permission, context) -> + evaluate(operator, rightValue, context.agent(), context); + } + + public AtomicConstraintRuleFunction contractNegotiation() { + return (operator, rightValue, permission, context) -> + evaluate(operator, rightValue, context.agent(), context); + } + + public AtomicConstraintRuleFunction catalog() { + return (operator, rightValue, permission, context) -> + evaluate(operator, rightValue, context.agent(), context); + } + /** * Policy evaluation function that checks whether a given BusinessPartnerNumber is covered by a given policy. * The evaluation is prematurely aborted (returns {@code false}) if: @@ -103,10 +122,7 @@ public BusinessPartnerGroupFunction(BusinessPartnerStore store) { *
  • The right value is anything other than {@link String} or {@link Collection}
  • * */ - @Override - public boolean evaluate(Operator operator, Object rightValue, Permission rule, PolicyContext policyContext) { - var participantAgent = policyContext.getContextData(ParticipantAgent.class); - + public boolean evaluate(Operator operator, Object rightValue, ParticipantAgent participantAgent, PolicyContext policyContext) { // No participant agent found in context if (participantAgent == null) { policyContext.reportProblem("ParticipantAgent not found on PolicyContext"); @@ -153,11 +169,11 @@ private List parseRightOperand(Object rightValue, PolicyContext context) context.reportProblem(format("Right operand expected to be either String or a Collection, but was %s", rightValue.getClass())); return null; } - + private Boolean evaluateIn(BpnGroupHolder bpnGroupHolder) { var assigned = bpnGroupHolder.assignedGroups; // checks whether both lists overlap - return bpnGroupHolder.allowedGroups.containsAll(assigned); + return new HashSet<>(bpnGroupHolder.allowedGroups).containsAll(assigned); } private Boolean evaluateNotEquals(BpnGroupHolder bpnGroupHolder) { @@ -189,4 +205,5 @@ private boolean evaluateIsNoneOf(BpnGroupHolder bpnGroupHolder) { */ private record BpnGroupHolder(List assignedGroups, List allowedGroups) { } + } diff --git a/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerNumberPermissionFunction.java b/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerNumberPermissionFunction.java index 3f3d08abe..b41b4e29e 100644 --- a/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerNumberPermissionFunction.java +++ b/edc-extensions/bpn-validation/bpn-validation-core/src/main/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerNumberPermissionFunction.java @@ -19,7 +19,10 @@ package org.eclipse.tractusx.edc.validation.businesspartner.functions; -import org.eclipse.edc.policy.engine.spi.AtomicConstraintFunction; +import org.eclipse.edc.connector.controlplane.catalog.spi.policy.CatalogPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.ContractNegotiationPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.TransferProcessPolicyContext; +import org.eclipse.edc.policy.engine.spi.AtomicConstraintRuleFunction; import org.eclipse.edc.policy.engine.spi.PolicyContext; import org.eclipse.edc.policy.model.Operator; import org.eclipse.edc.policy.model.Permission; @@ -42,7 +45,7 @@ /** * AtomicConstraintFunction to validate business partner numbers for edc permissions. */ -public class BusinessPartnerNumberPermissionFunction implements AtomicConstraintFunction { +public class BusinessPartnerNumberPermissionFunction { private static final List SUPPORTED_OPERATORS = Arrays.asList( EQ, @@ -55,8 +58,22 @@ public class BusinessPartnerNumberPermissionFunction implements AtomicConstraint Operator.HAS_PART ); - @Override - public boolean evaluate(Operator operator, Object rightValue, Permission rule, PolicyContext context) { + public AtomicConstraintRuleFunction transferProcess() { + return (operator, rightValue, permission, context) -> + evaluate(operator, rightValue, context.agent(), context); + } + + public AtomicConstraintRuleFunction contractNegotiation() { + return (operator, rightValue, permission, context) -> + evaluate(operator, rightValue, context.agent(), context); + } + + public AtomicConstraintRuleFunction catalog() { + return (operator, rightValue, permission, context) -> + evaluate(operator, rightValue, context.agent(), context); + } + + public boolean evaluate(Operator operator, Object rightValue, ParticipantAgent participantAgent, PolicyContext context) { if (!SUPPORTED_OPERATORS.contains(operator)) { var message = "Operator %s is not supported. Supported operators: %s".formatted(operator, SUPPORTED_OPERATORS); @@ -64,7 +81,6 @@ public boolean evaluate(Operator operator, Object rightValue, Permission rule, P return false; } - var participantAgent = context.getContextData(ParticipantAgent.class); if (participantAgent == null) { context.reportProblem("Required PolicyContext data not found: " + ParticipantAgent.class.getName()); return false; @@ -101,7 +117,7 @@ public boolean evaluate(Operator operator, Object rightValue, Permission rule, P } private Result checkListContains(String identity, Object rightValue, Operator operator) { - if (rightValue instanceof List numbers) { + if (rightValue instanceof List numbers) { return success(numbers.contains(identity)); } return failure("Invalid right-value: operator '%s' requires a 'List' but got a '%s'".formatted(operator, Optional.of(rightValue).map(Object::getClass).map(Class::getName).orElse(null))); diff --git a/edc-extensions/bpn-validation/bpn-validation-core/src/test/java/org/eclipse/tractusx/edc/validation/businesspartner/BusinessPartnerNumberValidationExtensionTest.java b/edc-extensions/bpn-validation/bpn-validation-core/src/test/java/org/eclipse/tractusx/edc/validation/businesspartner/BusinessPartnerNumberValidationExtensionTest.java index f3d6fa3a8..74b33a443 100644 --- a/edc-extensions/bpn-validation/bpn-validation-core/src/test/java/org/eclipse/tractusx/edc/validation/businesspartner/BusinessPartnerNumberValidationExtensionTest.java +++ b/edc-extensions/bpn-validation/bpn-validation-core/src/test/java/org/eclipse/tractusx/edc/validation/businesspartner/BusinessPartnerNumberValidationExtensionTest.java @@ -33,6 +33,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -51,22 +52,17 @@ void setup(ServiceExtensionContext context) { @Test void testRegisterPermissionFunction(ServiceExtensionContext context, BusinessPartnerNumberValidationExtension extension) { - - // invoke extension.initialize(context); - // verify verify(policyEngine, times(3)) .registerFunction( - anyString(), + isA(Class.class), eq(Permission.class), eq(BUSINESS_PARTNER_CONSTRAINT_KEY), any()); - - // verify verify(policyEngine, times(3)) .registerFunction( - anyString(), + isA(Class.class), eq(Permission.class), eq(TX_BUSINESS_PARTNER_CONSTRAINT_KEY), any()); diff --git a/edc-extensions/bpn-validation/bpn-validation-core/src/test/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerGroupFunctionTest.java b/edc-extensions/bpn-validation/bpn-validation-core/src/test/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerGroupFunctionTest.java index c26bd05d2..6205bd866 100644 --- a/edc-extensions/bpn-validation/bpn-validation-core/src/test/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerGroupFunctionTest.java +++ b/edc-extensions/bpn-validation/bpn-validation-core/src/test/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerGroupFunctionTest.java @@ -20,14 +20,11 @@ package org.eclipse.tractusx.edc.validation.businesspartner.functions; import org.eclipse.edc.policy.engine.spi.PolicyContext; -import org.eclipse.edc.policy.model.AtomicConstraint; -import org.eclipse.edc.policy.model.LiteralExpression; +import org.eclipse.edc.policy.engine.spi.PolicyContextImpl; import org.eclipse.edc.policy.model.Operator; -import org.eclipse.edc.policy.model.Permission; import org.eclipse.edc.spi.agent.ParticipantAgent; import org.eclipse.edc.spi.result.StoreResult; import org.eclipse.tractusx.edc.validation.businesspartner.spi.BusinessPartnerStore; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtensionContext; @@ -54,12 +51,8 @@ import static org.eclipse.edc.policy.model.Operator.LT; import static org.eclipse.edc.policy.model.Operator.NEQ; import static org.eclipse.edc.spi.agent.ParticipantAgent.PARTICIPANT_IDENTITY; -import static org.eclipse.tractusx.edc.validation.businesspartner.functions.BusinessPartnerGroupFunction.BUSINESS_PARTNER_CONSTRAINT_KEY; -import static org.mockito.ArgumentMatchers.endsWith; -import static org.mockito.ArgumentMatchers.eq; +import static org.junit.jupiter.params.provider.Arguments.arguments; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.reset; -import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; class BusinessPartnerGroupFunctionTest { @@ -67,48 +60,48 @@ class BusinessPartnerGroupFunctionTest { public static final String TEST_GROUP_1 = "test-group-1"; public static final String TEST_GROUP_2 = "test-group-2"; private static final String TEST_BPN = "BPN000TEST"; - private final PolicyContext context = mock(); - private BusinessPartnerGroupFunction function; - private BusinessPartnerStore store; - - @BeforeEach - void setUp() { - store = mock(); - function = new BusinessPartnerGroupFunction(store); - } + private final PolicyContext context = new PolicyContextImpl() { + @Override + public String scope() { + return "any"; + } + }; + private final BusinessPartnerStore store = mock(); + private final BusinessPartnerGroupFunction function = new BusinessPartnerGroupFunction(store); @Test @DisplayName("PolicyContext does not carry ParticipantAgent") void evaluate_noParticipantAgentOnContext() { - reset(context); - assertThat(function.evaluate(EQ, "test-group", createPermission(EQ, List.of()), context)).isFalse(); - verify(context).reportProblem(eq("ParticipantAgent not found on PolicyContext")); + var result = function.evaluate(EQ, "test-group", null, context); + + assertThat(result).isFalse(); + + assertThat(context.getProblems()).containsOnly("ParticipantAgent not found on PolicyContext"); } @ParameterizedTest(name = "Invalid operator {0}") @ArgumentsSource(InvalidOperatorProvider.class) @DisplayName("Invalid operators, expect report in policy context") void evaluate_invalidOperator(Operator invalidOperator) { - when(context.getContextData(eq(ParticipantAgent.class))).thenReturn(new ParticipantAgent(Map.of(), Map.of())); - assertThat(function.evaluate(invalidOperator, "test-group", createPermission(invalidOperator, List.of()), context)).isFalse(); - verify(context).reportProblem(endsWith("but was [" + invalidOperator.name() + "]")); + var agent = new ParticipantAgent(Map.of(), Map.of()); + + var result = function.evaluate(invalidOperator, "test-group", agent, context); + + assertThat(result).isFalse(); + assertThat(context.getProblems()).hasSize(1).anyMatch(it -> it.endsWith("but was [" + invalidOperator.name() + "]")); } - @Test + @ParameterizedTest + @ArgumentsSource(RightOperandNotStringNorCollection.class) @DisplayName("Right-hand operand is not String or Collection") - void evaluate_rightOperandNotStringOrCollection() { + void evaluate_rightOperandNotStringOrCollection(Object rightValue) { when(store.resolveForBpn(TEST_BPN)).thenReturn(StoreResult.success(List.of("test-group"))); - when(context.getContextData(eq(ParticipantAgent.class))).thenReturn(new ParticipantAgent(Map.of(), Map.of(PARTICIPANT_IDENTITY, TEST_BPN))); + var agent = new ParticipantAgent(Map.of(), Map.of(PARTICIPANT_IDENTITY, TEST_BPN)); - assertThat(function.evaluate(EQ, 42, createPermission(EQ, List.of("test-group")), context)).isFalse(); - assertThat(function.evaluate(EQ, 42L, createPermission(EQ, List.of("test-group")), context)).isFalse(); - assertThat(function.evaluate(EQ, true, createPermission(EQ, List.of("test-group")), context)).isFalse(); - assertThat(function.evaluate(EQ, new Object(), createPermission(EQ, List.of("test-group")), context)).isFalse(); + var result = function.evaluate(EQ, rightValue, agent, context); - verify(context).reportProblem("Right operand expected to be either String or a Collection, but was " + Integer.class); - verify(context).reportProblem("Right operand expected to be either String or a Collection, but was " + Long.class); - verify(context).reportProblem("Right operand expected to be either String or a Collection, but was " + Boolean.class); - verify(context).reportProblem("Right operand expected to be either String or a Collection, but was " + Object.class); + assertThat(result).isFalse(); + assertThat(context.getProblems()).containsOnly("Right operand expected to be either String or a Collection, but was " + rightValue.getClass()); } @ParameterizedTest(name = "{1} :: {0}") @@ -116,20 +109,24 @@ void evaluate_rightOperandNotStringOrCollection() { @DisplayName("Valid operators, evaluating different circumstances") void evaluate_validOperator(String ignored, Operator operator, List assignedBpn, boolean expectedOutcome) { var allowedGroups = List.of(TEST_GROUP_1, TEST_GROUP_2); - when(context.getContextData(eq(ParticipantAgent.class))).thenReturn(new ParticipantAgent(Map.of(), Map.of(PARTICIPANT_IDENTITY, TEST_BPN))); + var agent = new ParticipantAgent(Map.of(), Map.of(PARTICIPANT_IDENTITY, TEST_BPN)); when(store.resolveForBpn(TEST_BPN)).thenReturn(StoreResult.success(assignedBpn)); - assertThat(function.evaluate(operator, allowedGroups, createPermission(operator, allowedGroups), context)).isEqualTo(expectedOutcome); + + var result = function.evaluate(operator, allowedGroups, agent, context); + + assertThat(result).isEqualTo(expectedOutcome); } @Test void evaluate_failedResolveForBpn_shouldBeFalse() { var allowedGroups = List.of(TEST_GROUP_1, TEST_GROUP_2); - var operator = EQ; - when(context.getContextData(eq(ParticipantAgent.class))).thenReturn(new ParticipantAgent(Map.of(), Map.of(PARTICIPANT_IDENTITY, TEST_BPN))); + var agent = new ParticipantAgent(Map.of(), Map.of(PARTICIPANT_IDENTITY, TEST_BPN)); when(store.resolveForBpn(TEST_BPN)).thenReturn(StoreResult.notFound("foobar")); - assertThat(function.evaluate(operator, allowedGroups, createPermission(operator, allowedGroups), context)).isFalse(); - verify(context).reportProblem("foobar"); + var result = function.evaluate(EQ, allowedGroups, agent, context); + + assertThat(result).isFalse(); + assertThat(context.getProblems()).containsOnly("foobar"); } @ArgumentsSource(OperatorForEmptyGroupsProvider.class) @@ -137,25 +134,17 @@ void evaluate_failedResolveForBpn_shouldBeFalse() { void evaluate_groupsAssignedButNoGroupsSentToEvaluate(Operator operator, List assignedBpnGroups, boolean expectedOutcome) { List allowedGroups = List.of(); - - when(context.getContextData(eq(ParticipantAgent.class))).thenReturn(new ParticipantAgent(Map.of(), Map.of(PARTICIPANT_IDENTITY, TEST_BPN))); + var agent = new ParticipantAgent(Map.of(), Map.of(PARTICIPANT_IDENTITY, TEST_BPN)); when(store.resolveForBpn(TEST_BPN)).thenReturn(StoreResult.success(assignedBpnGroups)); - assertThat(function.evaluate(operator, allowedGroups, createPermission(operator, allowedGroups), context)).isEqualTo(expectedOutcome); - } + var result = function.evaluate(operator, allowedGroups, agent, context); - private Permission createPermission(Operator op, List rightOperand) { - return Permission.Builder.newInstance() - .constraint(AtomicConstraint.Builder.newInstance() - .leftExpression(new LiteralExpression(BUSINESS_PARTNER_CONSTRAINT_KEY)) - .operator(op) - .rightExpression(new LiteralExpression(rightOperand)).build()) - .build(); + assertThat(result).isEqualTo(expectedOutcome); } private static class InvalidOperatorProvider implements ArgumentsProvider { @Override - public Stream provideArguments(ExtensionContext extensionContext) throws Exception { + public Stream provideArguments(ExtensionContext extensionContext) { return Stream.of( Arguments.of(GEQ), Arguments.of(GT), @@ -224,4 +213,18 @@ public Stream provideArguments(ExtensionContext extensionCo ); } } + + private static class RightOperandNotStringNorCollection implements ArgumentsProvider { + + @Override + public Stream provideArguments(ExtensionContext context) { + return Stream.of( + arguments(42), + arguments(42L), + arguments(true), + arguments(new Object()) + ); + } + } + } diff --git a/edc-extensions/bpn-validation/bpn-validation-core/src/test/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerNumberPermissionFunctionTest.java b/edc-extensions/bpn-validation/bpn-validation-core/src/test/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerNumberPermissionFunctionTest.java index e178c3838..8c36ce82e 100644 --- a/edc-extensions/bpn-validation/bpn-validation-core/src/test/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerNumberPermissionFunctionTest.java +++ b/edc-extensions/bpn-validation/bpn-validation-core/src/test/java/org/eclipse/tractusx/edc/validation/businesspartner/functions/BusinessPartnerNumberPermissionFunctionTest.java @@ -20,10 +20,9 @@ package org.eclipse.tractusx.edc.validation.businesspartner.functions; import org.eclipse.edc.policy.engine.spi.PolicyContext; +import org.eclipse.edc.policy.engine.spi.PolicyContextImpl; import org.eclipse.edc.policy.model.Operator; -import org.eclipse.edc.policy.model.Permission; import org.eclipse.edc.spi.agent.ParticipantAgent; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.params.ParameterizedTest; @@ -36,156 +35,162 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.mockito.ArgumentMatchers.argThat; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.ArgumentMatchers.startsWith; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; class BusinessPartnerNumberPermissionFunctionTest { - private final Permission permission = mock(); - private BusinessPartnerNumberPermissionFunction validation; - private PolicyContext policyContext; - private ParticipantAgent participantAgent; - - @BeforeEach - void beforeEach() { - this.policyContext = mock(PolicyContext.class); - this.participantAgent = mock(ParticipantAgent.class); - - when(policyContext.getContextData(eq(ParticipantAgent.class))).thenReturn(participantAgent); - - validation = new BusinessPartnerNumberPermissionFunction() { - }; - } + private final PolicyContext policyContext = new PolicyContextImpl() { + @Override + public String scope() { + return "any"; + } + }; + private final ParticipantAgent participantAgent = mock(); + private final BusinessPartnerNumberPermissionFunction validation = new BusinessPartnerNumberPermissionFunction(); @ParameterizedTest(name = "Illegal Operator {0}") @ArgumentsSource(IllegalOperatorProvider.class) void testFailsOnUnsupportedOperations(Operator illegalOperator) { - assertFalse(validation.evaluate(illegalOperator, "foo", permission, policyContext)); - verify(policyContext).reportProblem(argThat(message -> message.startsWith("Operator %s is not supported.".formatted(illegalOperator)))); + var result = validation.evaluate(illegalOperator, "foo", participantAgent, policyContext); + + assertFalse(result); + assertThat(policyContext.getProblems()).hasSize(1) + .anyMatch(it -> it.startsWith("Operator %s is not supported.".formatted(illegalOperator))); } @Test void testFailsOnUnsupportedRightValue() { when(participantAgent.getIdentity()).thenReturn("foo"); - assertFalse(validation.evaluate(Operator.EQ, 1, permission, policyContext)); - verify(policyContext).reportProblem(argThat(message -> message.contains("Invalid right-value: operator 'EQ' requires a 'String' or a 'List' but got a 'java.lang.Integer'"))); + var result = validation.evaluate(Operator.EQ, 1, participantAgent, policyContext); + + assertFalse(result); + assertThat(policyContext.getProblems()).hasSize(1) + .anyMatch(it -> it.contains("Invalid right-value: operator 'EQ' requires a 'String' or a 'List' but got a 'java.lang.Integer'")); } @Test void testValidationFailsIdentityIsMissing() { - assertThat(validation.evaluate(Operator.EQ, "foo", permission, policyContext)).isFalse(); - verify(policyContext).reportProblem(argThat(message -> message.contains("Identity of the participant agent cannot be null"))); + var result = validation.evaluate(Operator.EQ, "foo", participantAgent, policyContext); + + assertThat(result).isFalse(); + assertThat(policyContext.getProblems()).hasSize(1) + .anyMatch(it -> it.contains("Identity of the participant agent cannot be null")); } @Test void testValidationFailsParticipantAgentMissing() { - var context = mock(PolicyContext.class); - assertThat(validation.evaluate(Operator.EQ, "foo", permission, context)).isFalse(); - verify(context).reportProblem(argThat(message -> message.contains("Required PolicyContext data not found"))); + var result = validation.evaluate(Operator.EQ, "foo", null, policyContext); + + assertThat(result).isFalse(); + assertThat(policyContext.getProblems()).hasSize(1) + .anyMatch(it -> it.contains("Required PolicyContext data not found")); } @Test void testValidationWhenSingleParticipantIsValid() { when(participantAgent.getIdentity()).thenReturn("foo"); - assertThat(validation.evaluate(Operator.EQ, "foo", permission, policyContext)).isTrue(); + + var result = validation.evaluate(Operator.EQ, "foo", participantAgent, policyContext); + + assertThat(result).isTrue(); } @Test void testValidationFailsInvalidIdentity() { when(participantAgent.getIdentity()).thenReturn("bar"); - assertThat(validation.evaluate(Operator.EQ, "foo", permission, policyContext)).isFalse(); + + var result = validation.evaluate(Operator.EQ, "foo", participantAgent, policyContext); + + assertThat(result).isFalse(); } @Test void testValidationForMultipleParticipants() { when(participantAgent.getIdentity()).thenReturn("quazz"); - assertThat(validation.evaluate(Operator.IN, List.of("foo", "bar"), permission, policyContext)).isFalse(); - assertThat(validation.evaluate(Operator.IN, List.of(1, "foo"), permission, policyContext)).isFalse(); - assertThat(validation.evaluate(Operator.IN, List.of("bar", "bar"), permission, policyContext)).isFalse(); + + assertThat(validation.evaluate(Operator.IN, List.of("foo", "bar"), participantAgent, policyContext)).isFalse(); + assertThat(validation.evaluate(Operator.IN, List.of(1, "foo"), participantAgent, policyContext)).isFalse(); + assertThat(validation.evaluate(Operator.IN, List.of("bar", "bar"), participantAgent, policyContext)).isFalse(); } @Test void evaluate_neq() { when(participantAgent.getIdentity()).thenReturn("foo"); - assertThat(validation.evaluate(Operator.NEQ, "bar", permission, policyContext)).isTrue(); + assertThat(validation.evaluate(Operator.NEQ, "bar", participantAgent, policyContext)).isTrue(); // these two should report a problem - assertThat(validation.evaluate(Operator.NEQ, 1, permission, policyContext)).isFalse(); - assertThat(validation.evaluate(Operator.NEQ, List.of("foo", "bar"), permission, policyContext)).isTrue(); + assertThat(validation.evaluate(Operator.NEQ, 1, participantAgent, policyContext)).isFalse(); + assertThat(validation.evaluate(Operator.NEQ, List.of("foo", "bar"), participantAgent, policyContext)).isTrue(); } @Test void evaluate_hasPart() { when(participantAgent.getIdentity()).thenReturn("quizzquazz"); - assertThat(validation.evaluate(Operator.HAS_PART, "quizz", permission, policyContext)).isTrue(); - assertThat(validation.evaluate(Operator.HAS_PART, "quazz", permission, policyContext)).isTrue(); - assertThat(validation.evaluate(Operator.HAS_PART, "zzqua", permission, policyContext)).isTrue(); - assertThat(validation.evaluate(Operator.HAS_PART, "zzqui", permission, policyContext)).isFalse(); - assertThat(validation.evaluate(Operator.HAS_PART, "Quizz", permission, policyContext)).isFalse(); - assertThat(validation.evaluate(Operator.HAS_PART, List.of("quizz"), permission, policyContext)).isFalse(); - assertThat(validation.evaluate(Operator.HAS_PART, List.of("quizz", "quazz"), permission, policyContext)).isFalse(); - verify(policyContext, times(2)).reportProblem(startsWith("Invalid right-value: operator 'HAS_PART' requires a 'String' but got a")); + assertThat(validation.evaluate(Operator.HAS_PART, "quizz", participantAgent, policyContext)).isTrue(); + assertThat(validation.evaluate(Operator.HAS_PART, "quazz", participantAgent, policyContext)).isTrue(); + assertThat(validation.evaluate(Operator.HAS_PART, "zzqua", participantAgent, policyContext)).isTrue(); + assertThat(validation.evaluate(Operator.HAS_PART, "zzqui", participantAgent, policyContext)).isFalse(); + assertThat(validation.evaluate(Operator.HAS_PART, "Quizz", participantAgent, policyContext)).isFalse(); + assertThat(validation.evaluate(Operator.HAS_PART, List.of("quizz"), participantAgent, policyContext)).isFalse(); + assertThat(validation.evaluate(Operator.HAS_PART, List.of("quizz", "quazz"), participantAgent, policyContext)).isFalse(); + assertThat(policyContext.getProblems()).hasSize(2) + .allMatch(it -> it.startsWith("Invalid right-value: operator 'HAS_PART' requires a 'String' but got a")); } @Test void evaluate_in() { when(participantAgent.getIdentity()).thenReturn("foo"); - assertThat(validation.evaluate(Operator.IN, List.of("foo", "bar"), permission, policyContext)).isTrue(); - assertThat(validation.evaluate(Operator.IN, List.of("foo"), permission, policyContext)).isTrue(); - assertThat(validation.evaluate(Operator.IN, List.of("bar"), permission, policyContext)).isFalse(); - assertThat(validation.evaluate(Operator.IN, "bar", permission, policyContext)).isFalse(); - verify(policyContext).reportProblem("Invalid right-value: operator 'IN' requires a 'List' but got a 'java.lang.String'"); + assertThat(validation.evaluate(Operator.IN, List.of("foo", "bar"), participantAgent, policyContext)).isTrue(); + assertThat(validation.evaluate(Operator.IN, List.of("foo"), participantAgent, policyContext)).isTrue(); + assertThat(validation.evaluate(Operator.IN, List.of("bar"), participantAgent, policyContext)).isFalse(); + assertThat(validation.evaluate(Operator.IN, "bar", participantAgent, policyContext)).isFalse(); + assertThat(policyContext.getProblems()).containsOnly("Invalid right-value: operator 'IN' requires a 'List' but got a 'java.lang.String'"); } @Test void evaluate_isAnyOf() { when(participantAgent.getIdentity()).thenReturn("foo"); - assertThat(validation.evaluate(Operator.IS_ANY_OF, List.of("foo", "bar"), permission, policyContext)).isTrue(); - assertThat(validation.evaluate(Operator.IS_ANY_OF, List.of("foo"), permission, policyContext)).isTrue(); - assertThat(validation.evaluate(Operator.IS_ANY_OF, List.of("bar"), permission, policyContext)).isFalse(); - assertThat(validation.evaluate(Operator.IS_ANY_OF, "bar", permission, policyContext)).isFalse(); - verify(policyContext).reportProblem("Invalid right-value: operator 'IS_ANY_OF' requires a 'List' but got a 'java.lang.String'"); + assertThat(validation.evaluate(Operator.IS_ANY_OF, List.of("foo", "bar"), participantAgent, policyContext)).isTrue(); + assertThat(validation.evaluate(Operator.IS_ANY_OF, List.of("foo"), participantAgent, policyContext)).isTrue(); + assertThat(validation.evaluate(Operator.IS_ANY_OF, List.of("bar"), participantAgent, policyContext)).isFalse(); + assertThat(validation.evaluate(Operator.IS_ANY_OF, "bar", participantAgent, policyContext)).isFalse(); + assertThat(policyContext.getProblems()).containsOnly("Invalid right-value: operator 'IS_ANY_OF' requires a 'List' but got a 'java.lang.String'"); } @Test void evaluate_isA() { when(participantAgent.getIdentity()).thenReturn("foo"); - assertThat(validation.evaluate(Operator.IS_A, List.of("foo", "bar"), permission, policyContext)).isTrue(); - assertThat(validation.evaluate(Operator.IS_A, List.of("foo"), permission, policyContext)).isTrue(); - assertThat(validation.evaluate(Operator.IS_A, List.of("bar"), permission, policyContext)).isFalse(); - assertThat(validation.evaluate(Operator.IS_A, "bar", permission, policyContext)).isFalse(); - verify(policyContext).reportProblem("Invalid right-value: operator 'IS_A' requires a 'List' but got a 'java.lang.String'"); - + assertThat(validation.evaluate(Operator.IS_A, List.of("foo", "bar"), participantAgent, policyContext)).isTrue(); + assertThat(validation.evaluate(Operator.IS_A, List.of("foo"), participantAgent, policyContext)).isTrue(); + assertThat(validation.evaluate(Operator.IS_A, List.of("bar"), participantAgent, policyContext)).isFalse(); + assertThat(validation.evaluate(Operator.IS_A, "bar", participantAgent, policyContext)).isFalse(); + assertThat(policyContext.getProblems()).containsOnly("Invalid right-value: operator 'IS_A' requires a 'List' but got a 'java.lang.String'"); } @Test void evaluate_isAllOf() { when(participantAgent.getIdentity()).thenReturn("foo"); - assertThat(validation.evaluate(Operator.IS_ALL_OF, List.of("foo", "bar"), permission, policyContext)).isFalse(); - assertThat(validation.evaluate(Operator.IS_ALL_OF, List.of("foo"), permission, policyContext)).isTrue(); - assertThat(validation.evaluate(Operator.IS_ALL_OF, List.of("bar"), permission, policyContext)).isFalse(); - assertThat(validation.evaluate(Operator.IS_ALL_OF, "bar", permission, policyContext)).isFalse(); + assertThat(validation.evaluate(Operator.IS_ALL_OF, List.of("foo", "bar"), participantAgent, policyContext)).isFalse(); + assertThat(validation.evaluate(Operator.IS_ALL_OF, List.of("foo"), participantAgent, policyContext)).isTrue(); + assertThat(validation.evaluate(Operator.IS_ALL_OF, List.of("bar"), participantAgent, policyContext)).isFalse(); + assertThat(validation.evaluate(Operator.IS_ALL_OF, "bar", participantAgent, policyContext)).isFalse(); } @Test void evaluate_isNoneOf() { when(participantAgent.getIdentity()).thenReturn("foo"); - assertThat(validation.evaluate(Operator.IS_NONE_OF, List.of("foo", "bar"), permission, policyContext)).isFalse(); - assertThat(validation.evaluate(Operator.IS_NONE_OF, List.of("foo"), permission, policyContext)).isFalse(); - assertThat(validation.evaluate(Operator.IS_NONE_OF, List.of("bar"), permission, policyContext)).isTrue(); - assertThat(validation.evaluate(Operator.IS_NONE_OF, "bar", permission, policyContext)).isFalse(); - verify(policyContext).reportProblem("Invalid right-value: operator 'IS_NONE_OF' requires a 'List' but got a 'java.lang.String'"); + assertThat(validation.evaluate(Operator.IS_NONE_OF, List.of("foo", "bar"), participantAgent, policyContext)).isFalse(); + assertThat(validation.evaluate(Operator.IS_NONE_OF, List.of("foo"), participantAgent, policyContext)).isFalse(); + assertThat(validation.evaluate(Operator.IS_NONE_OF, List.of("bar"), participantAgent, policyContext)).isTrue(); + assertThat(validation.evaluate(Operator.IS_NONE_OF, "bar", participantAgent, policyContext)).isFalse(); + assertThat(policyContext.getProblems()).containsOnly("Invalid right-value: operator 'IS_NONE_OF' requires a 'List' but got a 'java.lang.String'"); } private static class IllegalOperatorProvider implements ArgumentsProvider { @Override - public Stream provideArguments(ExtensionContext extensionContext) throws Exception { + public Stream provideArguments(ExtensionContext extensionContext) { return Stream.of( Arguments.of(Operator.GEQ), Arguments.of(Operator.GT), diff --git a/edc-extensions/cx-policy/build.gradle.kts b/edc-extensions/cx-policy/build.gradle.kts index b8d56b1ec..8f58405b7 100644 --- a/edc-extensions/cx-policy/build.gradle.kts +++ b/edc-extensions/cx-policy/build.gradle.kts @@ -24,10 +24,12 @@ plugins { dependencies { implementation(project(":spi:core-spi")) implementation(project(":core:core-utils")) - implementation(libs.edc.spi.policyengine) - implementation(libs.jakartaJson) + implementation(libs.edc.spi.catalog) + implementation(libs.edc.spi.contract) implementation(libs.edc.spi.identitytrust) + implementation(libs.edc.spi.policyengine) implementation(libs.edc.spi.vc) + implementation(libs.jakartaJson) testImplementation(libs.jacksonJsonP) testImplementation(libs.titaniumJsonLd) } diff --git a/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/CxPolicyExtension.java b/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/CxPolicyExtension.java index c8e93c4ed..465ad6667 100644 --- a/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/CxPolicyExtension.java +++ b/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/CxPolicyExtension.java @@ -19,21 +19,45 @@ package org.eclipse.tractusx.edc.policy.cx; +import org.eclipse.edc.connector.controlplane.catalog.spi.policy.CatalogPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.ContractNegotiationPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.TransferProcessPolicyContext; import org.eclipse.edc.policy.engine.spi.PolicyEngine; import org.eclipse.edc.policy.engine.spi.RuleBindingRegistry; +import org.eclipse.edc.policy.model.Permission; +import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; import org.eclipse.edc.spi.system.ServiceExtension; import org.eclipse.edc.spi.system.ServiceExtensionContext; +import org.eclipse.tractusx.edc.policy.cx.dismantler.DismantlerCredentialConstraintFunction; +import org.eclipse.tractusx.edc.policy.cx.framework.FrameworkAgreementCredentialConstraintFunction; +import org.eclipse.tractusx.edc.policy.cx.membership.MembershipCredentialConstraintFunction; -import static org.eclipse.tractusx.edc.policy.cx.CxPolicyRegistration.registerBindings; -import static org.eclipse.tractusx.edc.policy.cx.CxPolicyRegistration.registerFunctions; +import java.util.Set; +import java.util.stream.Stream; + +import static org.eclipse.edc.policy.model.OdrlNamespace.ODRL_SCHEMA; +import static org.eclipse.tractusx.edc.edr.spi.CoreConstants.CX_POLICY_NS; +import static org.eclipse.tractusx.edc.policy.cx.common.PolicyScopes.CATALOG_REQUEST_SCOPE; +import static org.eclipse.tractusx.edc.policy.cx.common.PolicyScopes.CATALOG_SCOPE; +import static org.eclipse.tractusx.edc.policy.cx.common.PolicyScopes.NEGOTIATION_REQUEST_SCOPE; +import static org.eclipse.tractusx.edc.policy.cx.common.PolicyScopes.NEGOTIATION_SCOPE; +import static org.eclipse.tractusx.edc.policy.cx.common.PolicyScopes.TRANSFER_PROCESS_REQUEST_SCOPE; +import static org.eclipse.tractusx.edc.policy.cx.common.PolicyScopes.TRANSFER_PROCESS_SCOPE; +import static org.eclipse.tractusx.edc.policy.cx.dismantler.DismantlerCredentialConstraintFunction.DISMANTLER_LITERAL; +import static org.eclipse.tractusx.edc.policy.cx.framework.FrameworkAgreementCredentialConstraintFunction.FRAMEWORK_AGREEMENT_LITERAL; +import static org.eclipse.tractusx.edc.policy.cx.membership.MembershipCredentialConstraintFunction.MEMBERSHIP_LITERAL; /** * Provides implementations of standard CX usage policies. */ +@Extension(CxPolicyExtension.NAME) public class CxPolicyExtension implements ServiceExtension { - private static final String NAME = "CX Policy"; + + public static final String NAME = "CX Policy"; + private static final Set RULE_SCOPES = Set.of(CATALOG_REQUEST_SCOPE, NEGOTIATION_REQUEST_SCOPE, + TRANSFER_PROCESS_REQUEST_SCOPE, CATALOG_SCOPE, NEGOTIATION_SCOPE, TRANSFER_PROCESS_SCOPE); @Inject private PolicyEngine policyEngine; @@ -51,4 +75,32 @@ public void initialize(ServiceExtensionContext context) { registerFunctions(policyEngine); registerBindings(bindingRegistry); } + + + public static void registerFunctions(PolicyEngine engine) { + engine.registerFunction(CatalogPolicyContext.class, Permission.class, DismantlerCredentialConstraintFunction.catalog()); + engine.registerFunction(ContractNegotiationPolicyContext.class, Permission.class, DismantlerCredentialConstraintFunction.contractNegotiation()); + engine.registerFunction(TransferProcessPolicyContext.class, Permission.class, DismantlerCredentialConstraintFunction.transferProcess()); + + engine.registerFunction(CatalogPolicyContext.class, Permission.class, FrameworkAgreementCredentialConstraintFunction.catalog()); + engine.registerFunction(ContractNegotiationPolicyContext.class, Permission.class, FrameworkAgreementCredentialConstraintFunction.contractNegotiation()); + engine.registerFunction(TransferProcessPolicyContext.class, Permission.class, FrameworkAgreementCredentialConstraintFunction.transferProcess()); + + engine.registerFunction(CatalogPolicyContext.class, Permission.class, MembershipCredentialConstraintFunction.catalog()); + engine.registerFunction(ContractNegotiationPolicyContext.class, Permission.class, MembershipCredentialConstraintFunction.contractNegotiation()); + engine.registerFunction(TransferProcessPolicyContext.class, Permission.class, MembershipCredentialConstraintFunction.transferProcess()); + } + + public static void registerBindings(RuleBindingRegistry registry) { + registry.dynamicBind(s -> { + if (Stream.of(FRAMEWORK_AGREEMENT_LITERAL, DISMANTLER_LITERAL, MEMBERSHIP_LITERAL).anyMatch(postfix -> s.startsWith(CX_POLICY_NS + postfix))) { + return RULE_SCOPES; + } + return Set.of(); + }); + + registry.bind(ODRL_SCHEMA + "use", CATALOG_SCOPE); + registry.bind(ODRL_SCHEMA + "use", NEGOTIATION_SCOPE); + registry.bind(ODRL_SCHEMA + "use", TRANSFER_PROCESS_SCOPE); + } } diff --git a/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/CxPolicyRegistration.java b/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/CxPolicyRegistration.java deleted file mode 100644 index 70c2a6960..000000000 --- a/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/CxPolicyRegistration.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.eclipse.tractusx.edc.policy.cx; - -import org.eclipse.edc.policy.engine.spi.PolicyEngine; -import org.eclipse.edc.policy.engine.spi.RuleBindingRegistry; -import org.eclipse.edc.policy.model.Permission; -import org.eclipse.tractusx.edc.policy.cx.dismantler.DismantlerCredentialConstraintFunction; -import org.eclipse.tractusx.edc.policy.cx.framework.FrameworkAgreementCredentialConstraintFunction; -import org.eclipse.tractusx.edc.policy.cx.membership.MembershipCredentialConstraintFunction; - -import java.util.Set; -import java.util.stream.Stream; - -import static org.eclipse.edc.policy.model.OdrlNamespace.ODRL_SCHEMA; -import static org.eclipse.tractusx.edc.edr.spi.CoreConstants.CX_POLICY_NS; -import static org.eclipse.tractusx.edc.policy.cx.common.PolicyScopes.CATALOG_REQUEST_SCOPE; -import static org.eclipse.tractusx.edc.policy.cx.common.PolicyScopes.CATALOG_SCOPE; -import static org.eclipse.tractusx.edc.policy.cx.common.PolicyScopes.NEGOTIATION_REQUEST_SCOPE; -import static org.eclipse.tractusx.edc.policy.cx.common.PolicyScopes.NEGOTIATION_SCOPE; -import static org.eclipse.tractusx.edc.policy.cx.common.PolicyScopes.TRANSFER_PROCESS_REQUEST_SCOPE; -import static org.eclipse.tractusx.edc.policy.cx.common.PolicyScopes.TRANSFER_PROCESS_SCOPE; -import static org.eclipse.tractusx.edc.policy.cx.dismantler.DismantlerCredentialConstraintFunction.DISMANTLER_LITERAL; -import static org.eclipse.tractusx.edc.policy.cx.framework.FrameworkAgreementCredentialConstraintFunction.FRAMEWORK_AGREEMENT_LITERAL; -import static org.eclipse.tractusx.edc.policy.cx.membership.MembershipCredentialConstraintFunction.MEMBERSHIP_LITERAL; - -public class CxPolicyRegistration { - private static final Set FUNCTION_SCOPES = Set.of(CATALOG_SCOPE, NEGOTIATION_SCOPE, TRANSFER_PROCESS_SCOPE); - private static final Set RULE_SCOPES = Set.of(CATALOG_REQUEST_SCOPE, NEGOTIATION_REQUEST_SCOPE, TRANSFER_PROCESS_REQUEST_SCOPE, CATALOG_SCOPE, NEGOTIATION_SCOPE, TRANSFER_PROCESS_SCOPE); - - public static void registerFunctions(PolicyEngine engine) { - FUNCTION_SCOPES.forEach(scope -> { - engine.registerFunction(scope, Permission.class, new DismantlerCredentialConstraintFunction()); - engine.registerFunction(scope, Permission.class, new MembershipCredentialConstraintFunction()); - engine.registerFunction(scope, Permission.class, new FrameworkAgreementCredentialConstraintFunction()); - }); - } - - public static void registerBindings(RuleBindingRegistry registry) { - registry.dynamicBind(s -> { - if (Stream.of(FRAMEWORK_AGREEMENT_LITERAL, DISMANTLER_LITERAL, MEMBERSHIP_LITERAL).anyMatch(postfix -> s.startsWith(CX_POLICY_NS + postfix))) { - return RULE_SCOPES; - } - return Set.of(); - }); - - registry.bind(ODRL_SCHEMA + "use", CATALOG_SCOPE); - registry.bind(ODRL_SCHEMA + "use", NEGOTIATION_SCOPE); - registry.bind(ODRL_SCHEMA + "use", TRANSFER_PROCESS_SCOPE); - } -} diff --git a/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/common/AbstractDynamicCredentialConstraintFunction.java b/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/common/AbstractDynamicCredentialConstraintFunction.java index 1648cee3f..bd935ef63 100644 --- a/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/common/AbstractDynamicCredentialConstraintFunction.java +++ b/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/common/AbstractDynamicCredentialConstraintFunction.java @@ -21,7 +21,7 @@ import org.eclipse.edc.iam.verifiablecredentials.spi.model.CredentialSubject; import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredential; -import org.eclipse.edc.policy.engine.spi.DynamicAtomicConstraintFunction; +import org.eclipse.edc.policy.engine.spi.DynamicAtomicConstraintRuleFunction; import org.eclipse.edc.policy.engine.spi.PolicyContext; import org.eclipse.edc.policy.model.Operator; import org.eclipse.edc.policy.model.Permission; @@ -36,12 +36,14 @@ * This is a base class for dynamically bound Tractus-X constraint evaluation functions that implements some basic common functionality and defines some * common constants */ -public abstract class AbstractDynamicCredentialConstraintFunction implements DynamicAtomicConstraintFunction { +public abstract class AbstractDynamicCredentialConstraintFunction implements DynamicAtomicConstraintRuleFunction { public static final String VC_CLAIM = "vc"; public static final String ACTIVE = "active"; public static final String CREDENTIAL_LITERAL = "Credential"; protected static final Collection EQUALITY_OPERATORS = List.of(Operator.EQ, Operator.NEQ); + protected abstract ParticipantAgent getParticipantAgent(C context); + protected boolean checkOperator(Operator actual, PolicyContext context, Collection expectedOperators) { if (!expectedOperators.contains(actual)) { context.reportProblem("Invalid operator: this constraint only allows the following operators: %s, but received '%s'.".formatted(EQUALITY_OPERATORS, actual)); @@ -50,15 +52,6 @@ protected boolean checkOperator(Operator actual, PolicyContext context, Collecti return true; } - protected Result extractParticipantAgent(PolicyContext context) { - // make sure the ParticipantAgent is there - var participantAgent = context.getContextData(ParticipantAgent.class); - if (participantAgent == null) { - return Result.failure("Required PolicyContext data not found: " + ParticipantAgent.class.getName()); - } - return Result.success(participantAgent); - } - /** * Extracts a {@link List} of {@link VerifiableCredential} objects from the {@link ParticipantAgent}. Credentials must be * stored in the agent's claims map using the "vc" key. diff --git a/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/dismantler/DismantlerCredentialConstraintFunction.java b/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/dismantler/DismantlerCredentialConstraintFunction.java index 02c8be79a..9a3e6d90e 100644 --- a/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/dismantler/DismantlerCredentialConstraintFunction.java +++ b/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/dismantler/DismantlerCredentialConstraintFunction.java @@ -20,10 +20,15 @@ package org.eclipse.tractusx.edc.policy.cx.dismantler; import jakarta.json.JsonObject; +import org.eclipse.edc.connector.controlplane.catalog.spi.policy.CatalogPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.ContractNegotiationPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.TransferProcessPolicyContext; import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredential; +import org.eclipse.edc.policy.engine.spi.DynamicAtomicConstraintRuleFunction; import org.eclipse.edc.policy.engine.spi.PolicyContext; import org.eclipse.edc.policy.model.Operator; import org.eclipse.edc.policy.model.Permission; +import org.eclipse.edc.spi.agent.ParticipantAgent; import org.eclipse.tractusx.edc.core.utils.credentials.CredentialTypePredicate; import org.eclipse.tractusx.edc.policy.cx.common.AbstractDynamicCredentialConstraintFunction; import org.jetbrains.annotations.NotNull; @@ -49,7 +54,7 @@ *
  • allowedBrands: whether an existing DismantlerCredential permits the vehicle brands required by the constraint
  • * */ -public class DismantlerCredentialConstraintFunction extends AbstractDynamicCredentialConstraintFunction { +public abstract class DismantlerCredentialConstraintFunction extends AbstractDynamicCredentialConstraintFunction { public static final String ALLOWED_VEHICLE_BRANDS_LITERAL = "allowedVehicleBrands"; public static final String DISMANTLER_LITERAL = "Dismantler"; @@ -57,19 +62,41 @@ public class DismantlerCredentialConstraintFunction extends AbstractDynamicCrede public static final String RIGHT_OPERAND_LIST_SEPARATOR = ","; private static final String ALLOWED_ACTIVITIES_LITERAL = "activityType"; + public static DynamicAtomicConstraintRuleFunction transferProcess() { + return new DismantlerCredentialConstraintFunction<>() { + @Override + protected ParticipantAgent getParticipantAgent(TransferProcessPolicyContext context) { + return context.agent(); + } + }; + } + + public static DynamicAtomicConstraintRuleFunction contractNegotiation() { + return new DismantlerCredentialConstraintFunction<>() { + @Override + protected ParticipantAgent getParticipantAgent(ContractNegotiationPolicyContext context) { + return context.agent(); + } + }; + } + + public static DynamicAtomicConstraintRuleFunction catalog() { + return new DismantlerCredentialConstraintFunction<>() { + @Override + protected ParticipantAgent getParticipantAgent(CatalogPolicyContext context) { + return context.agent(); + } + }; + } + @Override - public boolean evaluate(Object leftOperand, Operator operator, Object rightOperand, Permission permission, PolicyContext context) { + public boolean evaluate(Object leftOperand, Operator operator, Object rightOperand, Permission permission, C context) { Predicate predicate; - // make sure the ParticipantAgent is there - var participantAgent = extractParticipantAgent(context); - if (participantAgent.failed()) { - context.reportProblem(participantAgent.getFailureDetail()); - return false; - } + var participantAgent = getParticipantAgent(context); // check if the participant agent contains the correct data - var vcListResult = getCredentialList(participantAgent.getContent()); + var vcListResult = getCredentialList(participantAgent); if (vcListResult.failed()) { // couldn't extract credential list from agent context.reportProblem(vcListResult.getFailureDetail()); return false; diff --git a/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/framework/FrameworkAgreementCredentialConstraintFunction.java b/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/framework/FrameworkAgreementCredentialConstraintFunction.java index eb12ee221..4af338aae 100644 --- a/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/framework/FrameworkAgreementCredentialConstraintFunction.java +++ b/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/framework/FrameworkAgreementCredentialConstraintFunction.java @@ -19,7 +19,11 @@ package org.eclipse.tractusx.edc.policy.cx.framework; +import org.eclipse.edc.connector.controlplane.catalog.spi.policy.CatalogPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.ContractNegotiationPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.TransferProcessPolicyContext; import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredential; +import org.eclipse.edc.policy.engine.spi.DynamicAtomicConstraintRuleFunction; import org.eclipse.edc.policy.engine.spi.PolicyContext; import org.eclipse.edc.policy.model.Operator; import org.eclipse.edc.policy.model.Permission; @@ -53,23 +57,51 @@ * policy is considered not fulfilled. Note that if the {@code version} is specified, it must be satisfied by the same * credential that satisfies the {@code subtype} requirement. */ -public class FrameworkAgreementCredentialConstraintFunction extends AbstractDynamicCredentialConstraintFunction { +public abstract class FrameworkAgreementCredentialConstraintFunction extends AbstractDynamicCredentialConstraintFunction { public static final String CONTRACT_VERSION_LITERAL = "contractVersion"; public static final String FRAMEWORK_AGREEMENT_LITERAL = "FrameworkAgreement"; + public static DynamicAtomicConstraintRuleFunction transferProcess() { + return new FrameworkAgreementCredentialConstraintFunction<>() { + @Override + protected ParticipantAgent getParticipantAgent(TransferProcessPolicyContext context) { + return context.agent(); + } + }; + } + + public static DynamicAtomicConstraintRuleFunction contractNegotiation() { + return new FrameworkAgreementCredentialConstraintFunction<>() { + @Override + protected ParticipantAgent getParticipantAgent(ContractNegotiationPolicyContext context) { + return context.agent(); + } + }; + } + + public static DynamicAtomicConstraintRuleFunction catalog() { + return new FrameworkAgreementCredentialConstraintFunction<>() { + @Override + protected ParticipantAgent getParticipantAgent(CatalogPolicyContext context) { + return context.agent(); + } + }; + } + /** * Evaluates the constraint's left-operand and right-operand against a list of {@link VerifiableCredential} objects. * * @param leftValue the left-side expression for the constraint. Must be either {@code FrameworkAgreement} or {@code FrameworkAgreement.subtype}. * @param operator the operation Must be {@link Operator#EQ} or {@link Operator#NEQ} * @param rightValue the right-side expression for the constraint. Must be a string that is either {@code "active":[version]} or {@code subtype[:version]}. - * @param rule the rule associated with the constraint. Ignored by this function. + * @param permission the permission associated with the constraint. Ignored by this function. * @param context the policy context. Must contain the {@link ParticipantAgent}, which in turn must contain a list of {@link VerifiableCredential} stored * in its claims using the {@code "vc"} key. * @return true if at least one credential satisfied the requirement imposed by the constraint. */ @Override - public boolean evaluate(Object leftValue, Operator operator, Object rightValue, Permission rule, PolicyContext context) { + public boolean evaluate(Object leftValue, Operator operator, Object rightValue, Permission permission, C context) { + var participantAgent = getParticipantAgent(context); if (!checkOperator(operator, context, EQUALITY_OPERATORS)) { return false; @@ -81,12 +113,6 @@ public boolean evaluate(Object leftValue, Operator operator, Object rightValue, return false; } - var participantAgent = extractParticipantAgent(context); - if (participantAgent.failed()) { - context.reportProblem(participantAgent.getFailureDetail()); - return false; - } - var leftOperand = leftValue.toString(); var rightOperand = rightValue.toString(); Result>> predicateResult; @@ -106,7 +132,7 @@ public boolean evaluate(Object leftValue, Operator operator, Object rightValue, return false; } - var vcListResult = getCredentialList(participantAgent.getContent()); + var vcListResult = getCredentialList(participantAgent); if (vcListResult.failed()) { // couldn't extract credential list from agent context.reportProblem(vcListResult.getFailureDetail()); return false; diff --git a/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/membership/MembershipCredentialConstraintFunction.java b/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/membership/MembershipCredentialConstraintFunction.java index b44593dfa..d3d2c9c40 100644 --- a/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/membership/MembershipCredentialConstraintFunction.java +++ b/edc-extensions/cx-policy/src/main/java/org/eclipse/tractusx/edc/policy/cx/membership/MembershipCredentialConstraintFunction.java @@ -19,7 +19,11 @@ package org.eclipse.tractusx.edc.policy.cx.membership; +import org.eclipse.edc.connector.controlplane.catalog.spi.policy.CatalogPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.ContractNegotiationPolicyContext; +import org.eclipse.edc.connector.controlplane.contract.spi.policy.TransferProcessPolicyContext; import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredential; +import org.eclipse.edc.policy.engine.spi.DynamicAtomicConstraintRuleFunction; import org.eclipse.edc.policy.engine.spi.PolicyContext; import org.eclipse.edc.policy.model.Operator; import org.eclipse.edc.policy.model.Permission; @@ -35,11 +39,40 @@ * This constraint function checks that a MembershipCredential is present in a list of {@link VerifiableCredential} * objects extracted from a {@link ParticipantAgent} which is expected to be present on the {@link PolicyContext}. */ -public class MembershipCredentialConstraintFunction extends AbstractDynamicCredentialConstraintFunction { +public abstract class MembershipCredentialConstraintFunction extends AbstractDynamicCredentialConstraintFunction { public static final String MEMBERSHIP_LITERAL = "Membership"; + + public static DynamicAtomicConstraintRuleFunction transferProcess() { + return new MembershipCredentialConstraintFunction<>() { + @Override + protected ParticipantAgent getParticipantAgent(TransferProcessPolicyContext context) { + return context.agent(); + } + }; + } + + public static DynamicAtomicConstraintRuleFunction contractNegotiation() { + return new MembershipCredentialConstraintFunction<>() { + @Override + protected ParticipantAgent getParticipantAgent(ContractNegotiationPolicyContext context) { + return context.agent(); + } + }; + } + + public static DynamicAtomicConstraintRuleFunction catalog() { + return new MembershipCredentialConstraintFunction<>() { + @Override + protected ParticipantAgent getParticipantAgent(CatalogPolicyContext context) { + return context.agent(); + } + }; + } + + @Override - public boolean evaluate(Object leftOperand, Operator operator, Object rightOperand, Permission permission, PolicyContext context) { + public boolean evaluate(Object leftOperand, Operator operator, Object rightOperand, Permission permission, C context) { if (!ACTIVE.equals(rightOperand)) { context.reportProblem("Right-operand must be equal to '%s', but was '%s'".formatted(ACTIVE, rightOperand)); return false; @@ -49,11 +82,7 @@ public boolean evaluate(Object leftOperand, Operator operator, Object rightOpera return false; } // make sure the ParticipantAgent is there - var participantAgent = context.getContextData(ParticipantAgent.class); - if (participantAgent == null) { - context.reportProblem("Required PolicyContext data not found: " + ParticipantAgent.class.getName()); - return false; - } + var participantAgent = getParticipantAgent(context); var credentialResult = getCredentialList(participantAgent); if (credentialResult.failed()) { diff --git a/edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/dismantler/DismantlerConstraintFunctionTest.java b/edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/dismantler/DismantlerCredentialConstraintFunctionTest.java similarity index 97% rename from edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/dismantler/DismantlerConstraintFunctionTest.java rename to edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/dismantler/DismantlerCredentialConstraintFunctionTest.java index f5b68805c..a5a2c1a9f 100644 --- a/edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/dismantler/DismantlerConstraintFunctionTest.java +++ b/edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/dismantler/DismantlerCredentialConstraintFunctionTest.java @@ -22,7 +22,6 @@ import org.eclipse.edc.policy.engine.spi.PolicyContext; import org.eclipse.edc.policy.model.Operator; import org.eclipse.edc.spi.agent.ParticipantAgent; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -47,18 +46,16 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -class DismantlerConstraintFunctionTest { +class DismantlerCredentialConstraintFunctionTest { - private final DismantlerCredentialConstraintFunction function = new DismantlerCredentialConstraintFunction(); + private final ParticipantAgent participantAgent = mock(); + private final DismantlerCredentialConstraintFunction function = new DismantlerCredentialConstraintFunction<>() { + @Override + protected ParticipantAgent getParticipantAgent(PolicyContext context) { + return participantAgent; + } + }; private final PolicyContext context = mock(); - private ParticipantAgent participantAgent; - - @BeforeEach - void setup() { - participantAgent = mock(ParticipantAgent.class); - when(context.getContextData(eq(ParticipantAgent.class))) - .thenReturn(participantAgent); - } @Test void evaluate_leftOperandInvalid() { @@ -67,13 +64,6 @@ void evaluate_leftOperandInvalid() { verify(context).reportProblem(eq("Invalid left-operand: must be 'Dismantler[.activityType | .allowedBrands ], but was 'foobar'")); } - @Test - void evaluate_noParticipantAgentOnContext() { - when(context.getContextData(eq(ParticipantAgent.class))).thenReturn(null); - assertThat(function.evaluate("Dismantler", Operator.EQ, "active", null, context)).isFalse(); - verify(context).reportProblem("Required PolicyContext data not found: org.eclipse.edc.spi.agent.ParticipantAgent"); - } - @Test void evaluate_noVcClaimOnParticipantAgent() { assertThat(function.evaluate("Dismantler", Operator.EQ, "active", null, context)).isFalse(); @@ -459,4 +449,4 @@ void evaluate_righOpInvalidType() { verify(context).reportProblem(startsWith("Invalid right-operand type: expected String or List, but received:")); } } -} \ No newline at end of file +} diff --git a/edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/framework/FrameworkAgreementConstraintFunctionTest.java b/edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/framework/FrameworkAgreementCredentialConstraintFunctionTest.java similarity index 80% rename from edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/framework/FrameworkAgreementConstraintFunctionTest.java rename to edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/framework/FrameworkAgreementCredentialConstraintFunctionTest.java index dad68ccc4..a200d5a0d 100644 --- a/edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/framework/FrameworkAgreementConstraintFunctionTest.java +++ b/edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/framework/FrameworkAgreementCredentialConstraintFunctionTest.java @@ -22,9 +22,7 @@ import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredential; import org.eclipse.edc.policy.engine.spi.PolicyContext; import org.eclipse.edc.policy.model.Operator; -import org.eclipse.edc.policy.model.Permission; import org.eclipse.edc.spi.agent.ParticipantAgent; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -44,45 +42,33 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; -class FrameworkAgreementConstraintFunctionTest { - private final FrameworkAgreementCredentialConstraintFunction function = new FrameworkAgreementCredentialConstraintFunction(); +class FrameworkAgreementCredentialConstraintFunctionTest { + private final ParticipantAgent participantAgent = mock(); + private final FrameworkAgreementCredentialConstraintFunction function = new FrameworkAgreementCredentialConstraintFunction<>() { + @Override + protected ParticipantAgent getParticipantAgent(PolicyContext context) { + return participantAgent; + } + }; private final PolicyContext context = mock(); - private Permission permission; - private ParticipantAgent participantAgent; - - @BeforeEach - void setup() { - participantAgent = mock(ParticipantAgent.class); - when(context.getContextData(eq(ParticipantAgent.class))) - .thenReturn(participantAgent); - } @Test void evaluate_leftOperandInvalid() { - assertThat(function.evaluate("ThisIsInvalid", Operator.EQ, "irrelevant", permission, context)).isFalse(); + assertThat(function.evaluate("ThisIsInvalid", Operator.EQ, "irrelevant", null, context)).isFalse(); verify(context).reportProblem(startsWith("Constraint left-operand must start with 'FrameworkAgreement'")); } @Test void evaluate_invalidOperator() { - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.foobar", Operator.HAS_PART, "irrelevant", permission, context)).isFalse(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.foobar", Operator.HAS_PART, "irrelevant", null, context)).isFalse(); verify(context).reportProblem(eq("Invalid operator: this constraint only allows the following operators: [EQ, NEQ], but received 'HAS_PART'.")); verifyNoMoreInteractions(context); } - @Test - void evaluate_noParticipantOnContext() { - when(context.getContextData(eq(ParticipantAgent.class))).thenReturn(null); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.foobar", Operator.EQ, "irrelevant", permission, context)).isFalse(); - verify(context).reportProblem(eq("Required PolicyContext data not found: " + ParticipantAgent.class.getName())); - verify(context).getContextData(eq(ParticipantAgent.class)); - verifyNoMoreInteractions(context); - } - @Test void evaluate_vcClaimNotPresent() { when(participantAgent.getClaims()).thenReturn(Map.of()); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.foobar", Operator.EQ, "active", permission, context)).isFalse(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.foobar", Operator.EQ, "active", null, context)).isFalse(); verify(context).reportProblem(eq("ParticipantAgent did not contain a 'vc' claim.")); } @@ -91,7 +77,7 @@ void evaluate_vcClaimNotListOfCredentials() { when(participantAgent.getClaims()).thenReturn(Map.of( "vc", new Object() )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.foobar", Operator.EQ, "active:0.0.1", permission, context)).isFalse(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.foobar", Operator.EQ, "active:0.0.1", null, context)).isFalse(); verify(context).reportProblem(eq("ParticipantAgent contains a 'vc' claim, but the type is incorrect. Expected java.util.List, received java.lang.Object.")); } @@ -100,7 +86,7 @@ void evaluate_vcClaimCredentialsEmpty() { when(participantAgent.getClaims()).thenReturn(Map.of( "vc", new ArrayList() )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.foobar", Operator.EQ, "active", permission, context)).isFalse(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.foobar", Operator.EQ, "active", null, context)).isFalse(); verify(context).reportProblem(eq("ParticipantAgent contains a 'vc' claim but it did not contain any VerifiableCredentials.")); } @@ -109,7 +95,7 @@ void evaluate_rightOperandInvalidFormat() { when(participantAgent.getClaims()).thenReturn(Map.of( "vc", List.of(createPcfCredential().build()) )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.pcf", Operator.EQ, "/violate$", permission, context)).isFalse(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.pcf", Operator.EQ, "/violate$", null, context)).isFalse(); verify(context).reportProblem(eq("Right-operand must contain the keyword 'active' followed by an optional version string: 'active'[:version], but was '/violate$'.")); } @@ -120,7 +106,7 @@ void evaluate_requiredCredentialNotFound() { createCredential(CX_POLICY_NS + "PcfCredential", "1.3.0").build(), createCredential(CX_POLICY_NS + "PcfCredential", "1.0.0").build()) )); - assertThat(function.evaluate("FrameworkAgreement", Operator.EQ, "someOther:1.3.0", permission, context)).isFalse(); + assertThat(function.evaluate("FrameworkAgreement", Operator.EQ, "someOther:1.3.0", null, context)).isFalse(); } @Test @@ -131,7 +117,7 @@ void evaluate_requiredCredential_wrongVersion() { createCredential("PcfCredential", "1.8.0").build(), createCredential("PcfCredential", "1.0.0").build()) )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf:1.3.0", permission, context)).isFalse(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf:1.3.0", null, context)).isFalse(); } @Test @@ -142,7 +128,7 @@ void evaluate_requiredCredentialFound() { createCredential("SomeOtherType", "3.4.1").build() ) )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf", permission, context)).isTrue(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf", null, context)).isTrue(); } @Test @@ -153,7 +139,7 @@ void evaluate_requiredCredentialFound_withCorrectVersion() { createCredential("PcfCredential", "1.3.0").build(), createCredential("PcfCredential", "1.0.0").build()) )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf:1.3.0", permission, context)).isTrue(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf:1.3.0", null, context)).isTrue(); } @Test @@ -164,7 +150,7 @@ void evaluate_neq_requiredCredentialFound() { createCredential("SomeOtherType", "3.4.1").build() ) )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.NEQ, "sustainability", permission, context)).isTrue(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.NEQ, "sustainability", null, context)).isTrue(); } @Test @@ -176,7 +162,7 @@ void evaluate_neq_oneOfManyViolates() { createCredential("SomeOtherType", "3.4.1").build() ) )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.NEQ, "sustainability", permission, context)).isTrue(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.NEQ, "sustainability", null, context)).isTrue(); } @Test @@ -186,7 +172,7 @@ void evaluate_neq_oneViolates() { createCredential("SustainabilityCredential", "6.0.0").build() ) )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.NEQ, "sustainability", permission, context)).isFalse(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.NEQ, "sustainability", null, context)).isFalse(); } @Test @@ -197,7 +183,7 @@ void evaluate_neq_requiredCredentialFound_withCorrectVersion() { createCredential("FooBarCredential", "1.3.0").build(), createCredential("BarBazCredential", "1.0.0").build()) )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.NEQ, "sustainability:1.3.0", permission, context)).isTrue(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.NEQ, "sustainability:1.3.0", null, context)).isTrue(); } @@ -208,7 +194,7 @@ void evaluate_leftOperand_notContainSubtype() { when(participantAgent.getClaims()).thenReturn(Map.of( "vc", List.of(createPcfCredential().build()) )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.", Operator.EQ, "active:0.4.2", permission, context)).isFalse(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.", Operator.EQ, "active:0.4.2", null, context)).isFalse(); verify(context).reportProblem(eq("Left-operand must contain the sub-type 'FrameworkAgreement.'.")); } @@ -217,7 +203,7 @@ void evaluate_leftOperand_notContainFrameworkLiteral() { when(participantAgent.getClaims()).thenReturn(Map.of( "vc", List.of(createPcfCredential().build()) )); - assertThat(function.evaluate(CX_POLICY_NS + "foobar.pcf", Operator.EQ, "active:0.4.2", permission, context)).isFalse(); + assertThat(function.evaluate(CX_POLICY_NS + "foobar.pcf", Operator.EQ, "active:0.4.2", null, context)).isFalse(); verify(context).reportProblem(startsWith("Constraint left-operand must start with 'FrameworkAgreement' but was")); } @@ -226,7 +212,7 @@ void evaluate_leftOperand_notStartsWithFrameworkLiteral() { when(participantAgent.getClaims()).thenReturn(Map.of( "vc", List.of(createPcfCredential().build()) )); - assertThat(function.evaluate(CX_POLICY_NS + "foobarFrameworkAgreement.pcf", Operator.EQ, "active:0.4.2", permission, context)).isFalse(); + assertThat(function.evaluate(CX_POLICY_NS + "foobarFrameworkAgreement.pcf", Operator.EQ, "active:0.4.2", null, context)).isFalse(); verify(context).reportProblem(startsWith("Constraint left-operand must start with 'FrameworkAgreement' but was")); } @@ -235,7 +221,7 @@ void evaluate_rightOperand_notStartWithActiveLiteral() { when(participantAgent.getClaims()).thenReturn(Map.of( "vc", List.of(createPcfCredential().build()) )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.pcf", Operator.EQ, "violates", permission, context)).isFalse(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.pcf", Operator.EQ, "violates", null, context)).isFalse(); verify(context).reportProblem(eq("Right-operand must contain the keyword 'active' followed by an optional version string: 'active'[:version], but was 'violates'.")); } @@ -244,8 +230,8 @@ void evaluate_rightOperandWithVersion() { when(participantAgent.getClaims()).thenReturn(Map.of( "vc", List.of(createPcfCredential().build()) )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.pcf", Operator.EQ, "active:1.0.0", permission, context)).isTrue(); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.pcf", Operator.EQ, "active:5.3.1", permission, context)).isFalse(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.pcf", Operator.EQ, "active:1.0.0", null, context)).isTrue(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.pcf", Operator.EQ, "active:5.3.1", null, context)).isFalse(); } @Test @@ -253,7 +239,7 @@ void evaluate_rightOperand() { when(participantAgent.getClaims()).thenReturn(Map.of( "vc", List.of(createPcfCredential().build()) )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.pcf", Operator.EQ, "active", permission, context)).isTrue(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement.pcf", Operator.EQ, "active", null, context)).isTrue(); } } @@ -264,7 +250,7 @@ void evaluate_leftOperandNotFrameworkLiteral() { when(participantAgent.getClaims()).thenReturn(Map.of( "vc", List.of(createPcfCredential().build()) )); - assertThat(function.evaluate("Foobar", Operator.EQ, "active:0.4.2", permission, context)).isFalse(); + assertThat(function.evaluate("Foobar", Operator.EQ, "active:0.4.2", null, context)).isFalse(); verify(context).reportProblem(eq("Constraint left-operand must start with 'FrameworkAgreement' but was 'Foobar'.")); } @@ -273,7 +259,7 @@ void evaluate_rightOperand_onlySubtype() { when(participantAgent.getClaims()).thenReturn(Map.of( "vc", List.of(createPcfCredential().build()) )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf", permission, context)).isTrue(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf", null, context)).isTrue(); } @Test @@ -281,8 +267,8 @@ void evaluate_rightOperand_withVersion() { when(participantAgent.getClaims()).thenReturn(Map.of( "vc", List.of(createPcfCredential().build()) )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf:1.0.0", permission, context)).isTrue(); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf:4.2.0", permission, context)).isFalse(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf:1.0.0", null, context)).isTrue(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf:4.2.0", null, context)).isFalse(); } @Test @@ -290,8 +276,8 @@ void evaluate_withoutNamespace() { when(participantAgent.getClaims()).thenReturn(Map.of( "vc", List.of(createPlainPcfCredential().build()) )); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf:1.0.0", permission, context)).isTrue(); - assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf:4.2.0", permission, context)).isFalse(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf:1.0.0", null, context)).isTrue(); + assertThat(function.evaluate(CX_POLICY_NS + "FrameworkAgreement", Operator.EQ, "pcf:4.2.0", null, context)).isFalse(); } @Test @@ -299,7 +285,7 @@ void evaluate_rightOperandMissesSubtype() { when(participantAgent.getClaims()).thenReturn(Map.of( "vc", List.of(createPcfCredential().build()) )); - assertThat(function.evaluate("FrameworkAgreement", Operator.EQ, ":1.0.0", permission, context)).isFalse(); + assertThat(function.evaluate("FrameworkAgreement", Operator.EQ, ":1.0.0", null, context)).isFalse(); } } } diff --git a/edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/membership/MembershipConstraintFunctionTest.java b/edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/membership/MembershipCredentialConstraintFunctionTest.java similarity index 84% rename from edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/membership/MembershipConstraintFunctionTest.java rename to edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/membership/MembershipCredentialConstraintFunctionTest.java index 69839f3e6..f9714a9b8 100644 --- a/edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/membership/MembershipConstraintFunctionTest.java +++ b/edc-extensions/cx-policy/src/test/java/org/eclipse/tractusx/edc/policy/cx/membership/MembershipCredentialConstraintFunctionTest.java @@ -22,7 +22,6 @@ import org.eclipse.edc.policy.engine.spi.PolicyContext; import org.eclipse.edc.policy.model.Operator; import org.eclipse.edc.spi.agent.ParticipantAgent; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import java.util.List; @@ -38,18 +37,16 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -class MembershipConstraintFunctionTest { +class MembershipCredentialConstraintFunctionTest { - private final MembershipCredentialConstraintFunction function = new MembershipCredentialConstraintFunction(); + private final ParticipantAgent participantAgent = mock(); + private final MembershipCredentialConstraintFunction function = new MembershipCredentialConstraintFunction<>() { + @Override + protected ParticipantAgent getParticipantAgent(PolicyContext context) { + return participantAgent; + } + }; private final PolicyContext context = mock(); - private ParticipantAgent participantAgent; - - @BeforeEach - void setup() { - participantAgent = mock(ParticipantAgent.class); - when(context.getContextData(eq(ParticipantAgent.class))) - .thenReturn(participantAgent); - } @Test void evaluate_leftOperandInvalid() { @@ -58,13 +55,6 @@ void evaluate_leftOperandInvalid() { verify(context).reportProblem(startsWith("Invalid left-operand: must be 'Membership', but was")); } - @Test - void evaluate_noParticipantAgentOnContext() { - when(context.getContextData(eq(ParticipantAgent.class))).thenReturn(null); - assertThat(function.evaluate(CX_POLICY_NS + "Membership", Operator.EQ, "active", null, context)).isFalse(); - verify(context).reportProblem("Required PolicyContext data not found: org.eclipse.edc.spi.agent.ParticipantAgent"); - } - @Test void evaluate_noVcClaimOnParticipantAgent() { assertThat(function.evaluate(CX_POLICY_NS + "Membership", Operator.EQ, "active", null, context)).isFalse(); @@ -111,4 +101,4 @@ void evaluate_whenCredentialNotFound() { when(participantAgent.getClaims()).thenReturn(Map.of("vc", List.of(createPcfCredential().build()))); assertThat(function.evaluate(CX_POLICY_NS + "Membership", Operator.EQ, "active", null, context)).isFalse(); } -} \ No newline at end of file +} diff --git a/edc-extensions/dcp/tx-dcp/build.gradle.kts b/edc-extensions/dcp/tx-dcp/build.gradle.kts index ebeda88ae..136a28920 100644 --- a/edc-extensions/dcp/tx-dcp/build.gradle.kts +++ b/edc-extensions/dcp/tx-dcp/build.gradle.kts @@ -29,6 +29,7 @@ dependencies { implementation(libs.edc.spi.contract) implementation(libs.edc.spi.transfer) implementation(libs.edc.spi.catalog) + implementation(libs.edc.spi.request.policy.context) implementation(project(":spi:core-spi")) implementation(project(":core:core-utils")) diff --git a/edc-extensions/dcp/tx-dcp/src/main/java/org/eclipse/tractusx/edc/iam/iatp/IatpDefaultScopeExtension.java b/edc-extensions/dcp/tx-dcp/src/main/java/org/eclipse/tractusx/edc/iam/iatp/IatpDefaultScopeExtension.java index 68551adc4..4169604cb 100644 --- a/edc-extensions/dcp/tx-dcp/src/main/java/org/eclipse/tractusx/edc/iam/iatp/IatpDefaultScopeExtension.java +++ b/edc-extensions/dcp/tx-dcp/src/main/java/org/eclipse/tractusx/edc/iam/iatp/IatpDefaultScopeExtension.java @@ -19,6 +19,9 @@ package org.eclipse.tractusx.edc.iam.iatp; +import org.eclipse.edc.policy.context.request.spi.RequestCatalogPolicyContext; +import org.eclipse.edc.policy.context.request.spi.RequestContractNegotiationPolicyContext; +import org.eclipse.edc.policy.context.request.spi.RequestTransferProcessPolicyContext; import org.eclipse.edc.policy.engine.spi.PolicyEngine; import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; @@ -68,13 +71,11 @@ public String name() { @Override public void initialize(ServiceExtensionContext context) { - var contextMappingFunction = new DefaultScopeExtractor(defaultScopes(context)); - policyEngine.registerPostValidator(CATALOG_REQUEST_SCOPE, contextMappingFunction); - policyEngine.registerPostValidator(NEGOTIATION_REQUEST_SCOPE, contextMappingFunction); - policyEngine.registerPostValidator(TRANSFER_PROCESS_REQUEST_SCOPE, contextMappingFunction); + policyEngine.registerPostValidator(RequestCatalogPolicyContext.class, new DefaultScopeExtractor<>(defaultScopes(context))); + policyEngine.registerPostValidator(RequestContractNegotiationPolicyContext.class, new DefaultScopeExtractor<>(defaultScopes(context))); + policyEngine.registerPostValidator(RequestTransferProcessPolicyContext.class, new DefaultScopeExtractor<>(defaultScopes(context))); } - private Set defaultScopes(ServiceExtensionContext context) { var config = context.getConfig(TX_IATP_DEFAULT_SCOPE_PREFIX); var scopes = config.partition().map(this::createScope).collect(Collectors.toSet()); diff --git a/edc-extensions/dcp/tx-dcp/src/main/java/org/eclipse/tractusx/edc/iam/iatp/scope/CredentialScopeExtractor.java b/edc-extensions/dcp/tx-dcp/src/main/java/org/eclipse/tractusx/edc/iam/iatp/scope/CredentialScopeExtractor.java index 1504f4b9f..1e884678c 100644 --- a/edc-extensions/dcp/tx-dcp/src/main/java/org/eclipse/tractusx/edc/iam/iatp/scope/CredentialScopeExtractor.java +++ b/edc-extensions/dcp/tx-dcp/src/main/java/org/eclipse/tractusx/edc/iam/iatp/scope/CredentialScopeExtractor.java @@ -23,6 +23,7 @@ import org.eclipse.edc.connector.controlplane.contract.spi.types.negotiation.ContractRequestMessage; import org.eclipse.edc.connector.controlplane.transfer.spi.types.protocol.TransferRequestMessage; import org.eclipse.edc.iam.identitytrust.spi.scope.ScopeExtractor; +import org.eclipse.edc.policy.context.request.spi.RequestPolicyContext; import org.eclipse.edc.policy.engine.spi.PolicyContext; import org.eclipse.edc.policy.model.Operator; import org.eclipse.edc.spi.iam.RequestContext; @@ -32,6 +33,7 @@ import java.util.Optional; import java.util.Set; +import static java.util.Collections.emptySet; import static org.eclipse.tractusx.edc.TxIatpConstants.CREDENTIAL_TYPE_NAMESPACE; import static org.eclipse.tractusx.edc.edr.spi.CoreConstants.CX_POLICY_NS; @@ -56,22 +58,27 @@ public CredentialScopeExtractor(Monitor monitor) { @Override public Set extractScopes(Object leftValue, Operator operator, Object rightValue, PolicyContext context) { - Set scopes = Set.of(); + if (context instanceof RequestPolicyContext requestPolicyContext) { - var requestContext = context.getContextData(RequestContext.class); + var requestContext = requestPolicyContext.requestContext(); - if (requestContext != null) { - if (leftValue instanceof String leftOperand && leftOperand.startsWith(CX_POLICY_NS) && isMessageSupported(requestContext)) { - leftOperand = leftOperand.replace(CX_POLICY_NS, ""); - var credentialType = extractCredentialType(leftOperand, rightValue); - scopes = Set.of(SCOPE_FORMAT.formatted(CREDENTIAL_TYPE_NAMESPACE, CREDENTIAL_FORMAT.formatted(capitalize(credentialType)))); + if (requestContext != null) { + if (leftValue instanceof String leftOperand && leftOperand.startsWith(CX_POLICY_NS) && isMessageSupported(requestContext)) { + leftOperand = leftOperand.replace(CX_POLICY_NS, ""); + var credentialType = extractCredentialType(leftOperand, rightValue); + return Set.of(SCOPE_FORMAT.formatted(CREDENTIAL_TYPE_NAMESPACE, CREDENTIAL_FORMAT.formatted(capitalize(credentialType)))); + } + + } else { + monitor.warning("RequestContext not found in the PolicyContext: scope cannot be extracted from the policy. Defaulting to empty scopes"); } } else { monitor.warning("RequestContext not found in the PolicyContext: scope cannot be extracted from the policy. Defaulting to empty scopes"); } - return scopes; + + return emptySet(); } private boolean isMessageSupported(RequestContext ctx) { diff --git a/edc-extensions/dcp/tx-dcp/src/main/java/org/eclipse/tractusx/edc/iam/iatp/scope/DefaultScopeExtractor.java b/edc-extensions/dcp/tx-dcp/src/main/java/org/eclipse/tractusx/edc/iam/iatp/scope/DefaultScopeExtractor.java index 6224fb1c2..8d392ca3c 100644 --- a/edc-extensions/dcp/tx-dcp/src/main/java/org/eclipse/tractusx/edc/iam/iatp/scope/DefaultScopeExtractor.java +++ b/edc-extensions/dcp/tx-dcp/src/main/java/org/eclipse/tractusx/edc/iam/iatp/scope/DefaultScopeExtractor.java @@ -19,24 +19,24 @@ package org.eclipse.tractusx.edc.iam.iatp.scope; -import org.eclipse.edc.policy.engine.spi.PolicyContext; +import org.eclipse.edc.policy.context.request.spi.RequestPolicyContext; +import org.eclipse.edc.policy.engine.spi.PolicyValidatorRule; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.spi.EdcException; import org.eclipse.edc.spi.iam.RequestScope; import java.util.Set; -import java.util.function.BiFunction; import static java.lang.String.format; /** * Extract for TX default scopes e.g. MembershipCredential scope */ -public record DefaultScopeExtractor(Set defaultScopes) implements BiFunction { +public record DefaultScopeExtractor(Set defaultScopes) implements PolicyValidatorRule { @Override - public Boolean apply(Policy policy, PolicyContext policyContext) { - var scopes = policyContext.getContextData(RequestScope.Builder.class); + public Boolean apply(Policy policy, RequestPolicyContext policyContext) { + var scopes = policyContext.requestScopeBuilder(); if (scopes == null) { throw new EdcException(format("%s not set in policy context", RequestScope.Builder.class.getName())); } diff --git a/edc-extensions/dcp/tx-dcp/src/test/java/org/eclipse/tractusx/edc/iam/iatp/IatpDefaultScopeExtensionTest.java b/edc-extensions/dcp/tx-dcp/src/test/java/org/eclipse/tractusx/edc/iam/iatp/IatpDefaultScopeExtensionTest.java index 71e430e51..35ad6a28b 100644 --- a/edc-extensions/dcp/tx-dcp/src/test/java/org/eclipse/tractusx/edc/iam/iatp/IatpDefaultScopeExtensionTest.java +++ b/edc-extensions/dcp/tx-dcp/src/test/java/org/eclipse/tractusx/edc/iam/iatp/IatpDefaultScopeExtensionTest.java @@ -20,6 +20,9 @@ package org.eclipse.tractusx.edc.iam.iatp; import org.eclipse.edc.junit.extensions.DependencyInjectionExtension; +import org.eclipse.edc.policy.context.request.spi.RequestCatalogPolicyContext; +import org.eclipse.edc.policy.context.request.spi.RequestContractNegotiationPolicyContext; +import org.eclipse.edc.policy.context.request.spi.RequestTransferProcessPolicyContext; import org.eclipse.edc.policy.engine.spi.PolicyEngine; import org.eclipse.edc.spi.EdcException; import org.eclipse.edc.spi.system.ServiceExtensionContext; @@ -35,9 +38,6 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.eclipse.tractusx.edc.TxIatpConstants.DEFAULT_SCOPES; -import static org.eclipse.tractusx.edc.iam.iatp.IatpDefaultScopeExtension.CATALOG_REQUEST_SCOPE; -import static org.eclipse.tractusx.edc.iam.iatp.IatpDefaultScopeExtension.NEGOTIATION_REQUEST_SCOPE; -import static org.eclipse.tractusx.edc.iam.iatp.IatpDefaultScopeExtension.TRANSFER_PROCESS_REQUEST_SCOPE; import static org.eclipse.tractusx.edc.iam.iatp.IatpDefaultScopeExtension.TX_IATP_DEFAULT_SCOPE_PREFIX; import static org.mockito.ArgumentMatchers.argThat; import static org.mockito.ArgumentMatchers.eq; @@ -59,9 +59,9 @@ void setup(ServiceExtensionContext context) { void initialize(ServiceExtensionContext context, IatpDefaultScopeExtension extension) { extension.initialize(context); - verify(policyEngine).registerPostValidator(eq(CATALOG_REQUEST_SCOPE), argThat(new ScopeMatcher(DEFAULT_SCOPES))); - verify(policyEngine).registerPostValidator(eq(NEGOTIATION_REQUEST_SCOPE), argThat(new ScopeMatcher(DEFAULT_SCOPES))); - verify(policyEngine).registerPostValidator(eq(TRANSFER_PROCESS_REQUEST_SCOPE), argThat(new ScopeMatcher(DEFAULT_SCOPES))); + verify(policyEngine).registerPostValidator(eq(RequestCatalogPolicyContext.class), argThat(new ScopeMatcher(DEFAULT_SCOPES))); + verify(policyEngine).registerPostValidator(eq(RequestContractNegotiationPolicyContext.class), argThat(new ScopeMatcher(DEFAULT_SCOPES))); + verify(policyEngine).registerPostValidator(eq(RequestTransferProcessPolicyContext.class), argThat(new ScopeMatcher(DEFAULT_SCOPES))); } @Test @@ -79,9 +79,9 @@ void initialize_withConfiguredScopes(ServiceExtensionContext context, IatpDefaul var expectedScopes = Set.of("org.test.alias.foo:FooCredential:read", "org.test.alias.bar:BarCredential:write"); - verify(policyEngine).registerPostValidator(eq(CATALOG_REQUEST_SCOPE), argThat(new ScopeMatcher(expectedScopes))); - verify(policyEngine).registerPostValidator(eq(NEGOTIATION_REQUEST_SCOPE), argThat(new ScopeMatcher(expectedScopes))); - verify(policyEngine).registerPostValidator(eq(TRANSFER_PROCESS_REQUEST_SCOPE), argThat(new ScopeMatcher(expectedScopes))); + verify(policyEngine).registerPostValidator(eq(RequestCatalogPolicyContext.class), argThat(new ScopeMatcher(expectedScopes))); + verify(policyEngine).registerPostValidator(eq(RequestContractNegotiationPolicyContext.class), argThat(new ScopeMatcher(expectedScopes))); + verify(policyEngine).registerPostValidator(eq(RequestTransferProcessPolicyContext.class), argThat(new ScopeMatcher(expectedScopes))); } @Test diff --git a/edc-extensions/dcp/tx-dcp/src/test/java/org/eclipse/tractusx/edc/iam/iatp/scope/CredentialScopeExtractorTest.java b/edc-extensions/dcp/tx-dcp/src/test/java/org/eclipse/tractusx/edc/iam/iatp/scope/CredentialScopeExtractorTest.java index b7ea750b7..03ffeabee 100644 --- a/edc-extensions/dcp/tx-dcp/src/test/java/org/eclipse/tractusx/edc/iam/iatp/scope/CredentialScopeExtractorTest.java +++ b/edc-extensions/dcp/tx-dcp/src/test/java/org/eclipse/tractusx/edc/iam/iatp/scope/CredentialScopeExtractorTest.java @@ -26,10 +26,11 @@ import org.eclipse.edc.connector.controlplane.contract.spi.types.offer.ContractOffer; import org.eclipse.edc.connector.controlplane.transfer.spi.types.protocol.TransferRequestMessage; import org.eclipse.edc.connector.controlplane.transfer.spi.types.protocol.TransferTerminationMessage; +import org.eclipse.edc.policy.context.request.spi.RequestPolicyContext; import org.eclipse.edc.policy.engine.spi.PolicyContextImpl; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.spi.iam.RequestContext; -import org.eclipse.edc.spi.iam.TokenParameters; +import org.eclipse.edc.spi.iam.RequestScope; import org.eclipse.edc.spi.monitor.Monitor; import org.eclipse.edc.spi.types.domain.message.RemoteMessage; import org.eclipse.tractusx.edc.edr.spi.CoreConstants; @@ -63,30 +64,41 @@ void setup() { @ParameterizedTest(name = "{1}") @ArgumentsSource(SupportedMessages.class) void verify_extractScopes(RemoteMessage message) { - var builder = TokenParameters.Builder.newInstance(); var requestContext = RequestContext.Builder.newInstance().message(message).direction(RequestContext.Direction.Egress).build(); - var ctx = PolicyContextImpl.Builder.newInstance().additional(TokenParameters.Builder.class, builder).additional(RequestContext.class, requestContext).build(); + var ctx = new TestRequestPolicyContext(requestContext, null); + var scopes = extractor.extractScopes(CoreConstants.CX_POLICY_NS + FRAMEWORK_CREDENTIAL_PREFIX + ".pfc", null, null, ctx); + assertThat(scopes).contains(CREDENTIAL_TYPE_NAMESPACE + ":PfcCredential:read"); } - @DisplayName("Scope extractor with not supported messages") @ParameterizedTest(name = "{1}") @ArgumentsSource(NotSupportedMessages.class) void verify_extractScopes_isEmpty_whenNotSupportedMessages(RemoteMessage message) { - var builder = TokenParameters.Builder.newInstance(); var requestContext = RequestContext.Builder.newInstance().message(message).direction(RequestContext.Direction.Egress).build(); - var ctx = PolicyContextImpl.Builder.newInstance().additional(TokenParameters.Builder.class, builder).additional(RequestContext.class, requestContext).build(); + var ctx = new TestRequestPolicyContext(requestContext, null); + var scopes = extractor.extractScopes(CoreConstants.CX_POLICY_NS + FRAMEWORK_CREDENTIAL_PREFIX + ".pfc", null, null, ctx); + assertThat(scopes).isEmpty(); } @Test void verify_extractScope_Empty() { - var builder = TokenParameters.Builder.newInstance(); - var ctx = PolicyContextImpl.Builder.newInstance().additional(TokenParameters.Builder.class, builder).build(); + var ctx = new TestRequestPolicyContext(null, null); + + var scopes = extractor.extractScopes("wrong", null, null, ctx); + + assertThat(scopes).isEmpty(); + } + + @Test + void verify_extractScope_contextNotRequestType() { + var ctx = new NotRequestPolicyContext(); + var scopes = extractor.extractScopes("wrong", null, null, ctx); + assertThat(scopes).isEmpty(); } @@ -112,4 +124,24 @@ public Stream provideArguments(ExtensionContext extensionCo ); } } + + private static class TestRequestPolicyContext extends RequestPolicyContext { + + protected TestRequestPolicyContext(RequestContext requestContext, RequestScope.Builder requestScopeBuilder) { + super(requestContext, requestScopeBuilder); + } + + @Override + public String scope() { + return "request.any"; + } + } + + private static class NotRequestPolicyContext extends PolicyContextImpl { + + @Override + public String scope() { + return "any"; + } + } } diff --git a/edc-extensions/dcp/tx-dcp/src/test/java/org/eclipse/tractusx/edc/iam/iatp/scope/DefaultScopeExtractorTest.java b/edc-extensions/dcp/tx-dcp/src/test/java/org/eclipse/tractusx/edc/iam/iatp/scope/DefaultScopeExtractorTest.java index f510f71bc..60048ac00 100644 --- a/edc-extensions/dcp/tx-dcp/src/test/java/org/eclipse/tractusx/edc/iam/iatp/scope/DefaultScopeExtractorTest.java +++ b/edc-extensions/dcp/tx-dcp/src/test/java/org/eclipse/tractusx/edc/iam/iatp/scope/DefaultScopeExtractorTest.java @@ -19,9 +19,10 @@ package org.eclipse.tractusx.edc.iam.iatp.scope; -import org.eclipse.edc.policy.engine.spi.PolicyContextImpl; +import org.eclipse.edc.policy.context.request.spi.RequestPolicyContext; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.spi.EdcException; +import org.eclipse.edc.spi.iam.RequestContext; import org.eclipse.edc.spi.iam.RequestScope; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -34,28 +35,43 @@ public class DefaultScopeExtractorTest { private static final Set SCOPES = Set.of("scope1", "scope2"); - private DefaultScopeExtractor extractor; + private DefaultScopeExtractor extractor; @BeforeEach void setup() { - extractor = new DefaultScopeExtractor(SCOPES); + extractor = new DefaultScopeExtractor<>(SCOPES); } @Test void verify_applyExtractor() { var builder = RequestScope.Builder.newInstance(); - var ctx = PolicyContextImpl.Builder.newInstance().additional(RequestScope.Builder.class, builder).build(); - extractor.apply(Policy.Builder.newInstance().build(), ctx); + var context = new TestRequestPolicyContext(null, builder); + var result = extractor.apply(Policy.Builder.newInstance().build(), context); + + assertThat(result).isTrue(); assertThat(builder.build().getScopes()).contains("scope1", "scope2"); } @Test void verify_applyExtractorFails_whenTokenParamsBuilderMissing() { - var ctx = PolicyContextImpl.Builder.newInstance().build(); - assertThatThrownBy(() -> extractor.apply(Policy.Builder.newInstance().build(), ctx)) + var context = new TestRequestPolicyContext(null, null); + + assertThatThrownBy(() -> extractor.apply(Policy.Builder.newInstance().build(), context)) .isInstanceOf(EdcException.class) .hasMessageContaining("not set in policy context"); } + + private static class TestRequestPolicyContext extends RequestPolicyContext { + + protected TestRequestPolicyContext(RequestContext requestContext, RequestScope.Builder requestScopeBuilder) { + super(requestContext, requestScopeBuilder); + } + + @Override + public String scope() { + return "request.any"; + } + } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3e12dd1cc..e535dc382 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -30,6 +30,7 @@ edc-spi-core = { module = "org.eclipse.edc:core-spi", version.ref = "edc" } edc-spi-policy = { module = "org.eclipse.edc:policy-spi", version.ref = "edc" } edc-spi-contract = { module = "org.eclipse.edc:contract-spi", version.ref = "edc" } edc-spi-policyengine = { module = "org.eclipse.edc:policy-engine-spi", version.ref = "edc" } +edc-spi-request-policy-context = { module = "org.eclipse.edc:request-policy-context-spi", version.ref = "edc" } edc-spi-transaction-datasource = { module = "org.eclipse.edc:transaction-datasource-spi", version.ref = "edc" } edc-spi-transactionspi = { module = "org.eclipse.edc:transaction-spi", version.ref = "edc" } edc-spi-controlplane = { module = "org.eclipse.edc:control-plane-spi", version.ref = "edc" }