Skip to content

Commit

Permalink
chore: updates edc to 0.6.3 (#1285)
Browse files Browse the repository at this point in the history
* chore: updates edc to 0.6.3

* chore: deps file
  • Loading branch information
wolf4ood authored May 6, 2024
1 parent e4d15af commit 8d61e97
Show file tree
Hide file tree
Showing 14 changed files with 210 additions and 207 deletions.
359 changes: 181 additions & 178 deletions DEPENDENCIES

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void requestCatalog_filteredByDismantler_shouldReturnOffer() {
assertThat(catalog).isNotEmpty()
.hasSize(1)
.allSatisfy(co -> {
assertThat(getDatasetAssetId(co)).isEqualTo("test-asset");
assertThat(getDatasetAssetId(co.asJsonObject())).isEqualTo("test-asset");
});

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void requestCatalog_fulfillsPolicy_shouldReturnOffer() {
assertThat(catalog).isNotEmpty()
.hasSize(1)
.allSatisfy(co -> {
assertThat(getDatasetAssetId(co)).isEqualTo("test-asset");
assertThat(getDatasetAssetId(co.asJsonObject())).isEqualTo("test-asset");
});

}
Expand Down Expand Up @@ -176,7 +176,7 @@ void requestCatalog_multipleOffersForAsset() {
var catalog = PLATO.getCatalogDatasets(SOKRATES);
assertThat(catalog).hasSize(1)
.allSatisfy(cd -> {
assertThat(getDatasetAssetId(cd)).isEqualTo("asset-1");
assertThat(getDatasetAssetId(cd.asJsonObject())).isEqualTo("asset-1");
assertThat(getDatasetPolicies(cd)).hasSize(2);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
import static org.eclipse.edc.jsonld.spi.PropertyAndTypeNames.ODRL_ASSIGNER_ATTRIBUTE;
import static org.eclipse.edc.jsonld.spi.PropertyAndTypeNames.ODRL_TARGET_ATTRIBUTE;
import static org.eclipse.edc.spi.constants.CoreConstants.EDC_NAMESPACE;
import static org.eclipse.tractusx.edc.tests.helpers.CatalogHelperFunctions.getDatasetContractId;
import static org.eclipse.tractusx.edc.tests.helpers.CatalogHelperFunctions.getDatasetFirstPolicy;
import static org.eclipse.tractusx.edc.tests.helpers.CatalogHelperFunctions.getDatasetOfferId;
import static org.eclipse.tractusx.edc.tests.helpers.EdrNegotiationHelperFunctions.createEdrNegotiationRequest;

/**
Expand Down Expand Up @@ -122,9 +122,9 @@ public String negotiateEdr(TransferParticipant other, String assetId, JsonArray
.add(ODRL_TARGET_ATTRIBUTE, createObjectBuilder().add(ID, dataset.get(ID)))
.add(ODRL_ASSIGNER_ATTRIBUTE, createObjectBuilder().add(ID, other.getBpn()))
.build();
var contractId = getDatasetContractId(dataset);
var offerId = getDatasetOfferId(dataset);

var requestBody = createEdrNegotiationRequest(other.getProtocolEndpoint().getUrl().toString(), other.getBpn(), contractId.toString(), contractId.assetIdPart(), policy, callbacks);
var requestBody = createEdrNegotiationRequest(other.getProtocolEndpoint().getUrl().toString(), other.getBpn(), offerId, assetId, policy, callbacks);


var response = baseEdrRequest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import jakarta.json.JsonArray;
import jakarta.json.JsonObject;
import jakarta.json.JsonValue;
import org.eclipse.edc.connector.controlplane.contract.spi.ContractId;

import static org.eclipse.edc.connector.controlplane.catalog.spi.CatalogRequest.CATALOG_REQUEST_QUERY_SPEC;
import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.ID;
Expand All @@ -45,17 +44,12 @@ public static JsonObject createCatalogRequest(JsonObject query, String dspEndpoi
return jsonBuilder.build();
}

public static ContractId getDatasetContractId(JsonObject dataset) {
var id = dataset.getJsonArray(ODRL_POLICY_ATTRIBUTE).get(0).asJsonObject().getString(ID);
return ContractId.parseId(id).orElseThrow(f -> new RuntimeException(f.getFailureDetail()));
public static String getDatasetOfferId(JsonObject dataset) {
return dataset.getJsonArray(ODRL_POLICY_ATTRIBUTE).get(0).asJsonObject().getString(ID);
}

public static String getDatasetAssetId(JsonObject dataset) {
return getDatasetContractId(dataset).assetIdPart();
}

public static String getDatasetAssetId(JsonValue dataset) {
return getDatasetContractId(dataset.asJsonObject()).assetIdPart();
return dataset.getString(ID);
}

public static JsonArray getDatasetPolicies(JsonObject dataset) {
Expand Down
2 changes: 2 additions & 0 deletions edc-tests/edc-controlplane/iatp-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ dependencies {
testImplementation(libs.edc.ih.did)
testImplementation(libs.edc.ih.spi)
testImplementation(libs.edc.ih.spi.store)
testImplementation(libs.edc.ih.spi.participant.context)
testImplementation(libs.edc.ih.spi.credentials)
testImplementation(libs.edc.junit)
testImplementation(libs.edc.core.token)
testImplementation(libs.edc.identity.vc.ldp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import org.eclipse.edc.iam.verifiablecredentials.spi.model.CredentialStatus;
import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredential;
import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer;
import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource;
import org.eclipse.edc.identityhub.spi.store.CredentialStore;
import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource;
import org.eclipse.edc.jsonld.spi.JsonLd;
import org.eclipse.edc.policy.model.Operator;
import org.eclipse.edc.spi.query.Criterion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import org.eclipse.edc.iam.verifiablecredentials.spi.model.Issuer;
import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredential;
import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer;
import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource;
import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource;
import org.eclipse.edc.jsonld.spi.JsonLd;
import org.eclipse.edc.security.signature.jws2020.JsonWebKeyPair;
import org.eclipse.edc.security.signature.jws2020.Jws2020ProofDraft;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
import jakarta.json.JsonObjectBuilder;
import org.eclipse.edc.iam.did.spi.document.DidDocument;
import org.eclipse.edc.iam.did.spi.resolution.DidResolverRegistry;
import org.eclipse.edc.identityhub.spi.ParticipantContextService;
import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource;
import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor;
import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest;
import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService;
import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor;
import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest;
import org.eclipse.edc.identityhub.spi.store.CredentialStore;
import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource;
import org.eclipse.edc.jsonld.spi.JsonLd;
import org.eclipse.edc.junit.extensions.EdcExtension;
import org.eclipse.edc.spi.security.Vault;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies {
implementation(libs.edc.identity.trust.transform)
implementation(libs.edc.identity.trust.issuers.configuration)
implementation(libs.edc.auth.oauth2.client)
implementation(libs.edc.ih.api)
implementation(libs.edc.ih.api.presentation)
implementation(libs.edc.ih.credentials)
implementation(libs.edc.ih.keypairs)
implementation(libs.edc.ih.participants)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies {
implementation(libs.edc.identity.trust.sts.remote.client)
implementation(libs.edc.identity.trust.issuers.configuration)
implementation(libs.edc.auth.oauth2.client)
implementation(libs.edc.ih.api)
implementation(libs.edc.ih.api.presentation)
implementation(libs.edc.ih.credentials)
implementation(libs.edc.ih.keypairs)
implementation(libs.edc.ih.participants)
Expand Down
6 changes: 4 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
format.version = "1.1"

[versions]
edc = "0.6.2"
edc = "0.6.3"
apache-sshd = "2.12.1"
assertj = "3.25.3"
awaitility = "4.2.1"
Expand Down Expand Up @@ -154,10 +154,12 @@ edc-identity-trust-sts-client-configuration = { module = "org.eclipse.edc:identi

## IH for testing

edc-ih-api = { module = "org.eclipse.edc:identity-hub-api", version.ref = "edc" }
edc-ih-api-presentation = { module = "org.eclipse.edc:presentation-api", version.ref = "edc" }
edc-ih-credentials = { module = "org.eclipse.edc:identity-hub-credentials", version.ref = "edc" }
edc-ih-spi-store = { module = "org.eclipse.edc:identity-hub-store-spi", version.ref = "edc" }
edc-ih-spi = { module = "org.eclipse.edc:identity-hub-spi", version.ref = "edc" }
edc-ih-spi-participant-context = { module = "org.eclipse.edc:participant-context-spi", version.ref = "edc" }
edc-ih-spi-credentials = { module = "org.eclipse.edc:verifiable-credential-spi", version.ref = "edc" }
edc-ih-keypairs = { module = "org.eclipse.edc:identity-hub-keypairs", version.ref = "edc" }
edc-ih-participants = { module = "org.eclipse.edc:identity-hub-participants", version.ref = "edc" }
edc-ih-did = { module = "org.eclipse.edc:identity-hub-did", version.ref = "edc" }
Expand Down
2 changes: 2 additions & 0 deletions samples/edc-dast/edc-dast-extensions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ dependencies {
implementation(libs.edc.core.token)
implementation(libs.edc.ih.spi)
implementation(libs.edc.ih.spi.store)
implementation(libs.edc.ih.spi.participant.context)
implementation(libs.edc.ih.spi.credentials)
}

edcBuild {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
import org.eclipse.edc.iam.verifiablecredentials.spi.model.Issuer;
import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredential;
import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer;
import org.eclipse.edc.identityhub.spi.ParticipantContextService;
import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource;
import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor;
import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest;
import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService;
import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor;
import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest;
import org.eclipse.edc.identityhub.spi.store.CredentialStore;
import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource;
import org.eclipse.edc.runtime.metamodel.annotation.Extension;
import org.eclipse.edc.runtime.metamodel.annotation.Inject;
import org.eclipse.edc.security.token.jwt.CryptoConverter;
Expand Down

0 comments on commit 8d61e97

Please sign in to comment.